recentpopularlog in

command

« earlier   
VoxHub.io - Silvius - Online Programming by Voice
Silvius is an open source system for writing code by voice. Speak characters and words and they are typed for you automatically. You can try it on our server, or set it up yourself.
speech  recognition  programming  voice  command 
20 hours ago by kybernetikos
Reading a Single TIFF Pixel Without Any TIFF Tools – Planet Stories – Medium
tiff をコマンドラインで操作する流れ。dd 使うとか面白い。
image  command 
2 days ago by summerwind
How to Launch GUI Applications from the Terminal
open -a ApplicationName

$ open
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-b ] [-a ] [filenames] [--args arguments]
Help: Open opens files from a shell.
By default, opens each file using the default application for that file.
If the file is in the form of a URL, the file will be opened as a URL.
Options:
-a Opens with the specified application.
-b Opens with the specified application bundle identifier.
-e Opens with TextEdit.
-t Opens with default text editor.
-f Reads input from standard input and opens with TextEdit.
-F --fresh Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
-R, --reveal Selects in the Finder instead of opening.
-W, --wait-apps Blocks until the used applications are closed (even if they were already running).
--args All remaining arguments are passed in argv to the application's main() function instead of opened.
-n, --new Open a new instance of the application even if one is already running.
-j, --hide Launches the app hidden.
-g, --background Does not bring the application to the foreground.
-h, --header Searches header file locations for headers matching the given filenames, and opens them.
MacBook  macOS  launch  application  command  line  open 
7 days ago by meFavs
bash - Extract JSON value to shell variable using jq - Stack Overflow
$ cat input.json
[
{"id":10,
"list_file":[
"/var/a b.txt",
"/dev/c\nd.txt",
"*"]}
]
A jq command that extracts and outputs properly quoted strings for use by the shell:

$ $ jq -r '.[] | .list_file[] | @sh' input.json
'/var/a b.txt'
'/dev/c
d.txt'
'*'
And a shell command that can make use of the output:

$ declare -a "x=($(jq -r '.[] | .list_file[] | @sh' input.json))"
Proof that it worked properly:

$ printf '==%s==\n' "${x[@]}"
==/var/a b.txt==
==/dev/c
d.txt==
==*==
bash  declare  @  shell  command 
7 days ago by fareed
9 Really Useful Tricks With pv- Pipe Viewer
1) Simulate typing
echo "You can simulate on-screen typing just like in the movies" | pv -qL 10
This will output the characters at 10 per second.

2) Monitor progress of a command
pv access.log | gzip > access.log.gz
Pipe viewer is a terminal-based tool for monitoring the progress of data through a pipeline. It can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.

3) live ssh network throughput test
yes | pv | ssh $host "cat > /dev/null"
connects to host via ssh and displays the live transfer speed, directing all transferred data to /dev/null

4) copy working directory and compress it on-the-fly while showing progress
tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz

What happens here is we tell tar to create “-c” an archive of all files in current dir “.” (recursively) and output the data to stdout “-f -“. Next we specify the size “-s” to pv of all files in current dir. The “du -sb . | awk ?{print $1}?” returns number of bytes in current dir, and it gets fed as “-s” parameter to pv. Next we gzip the whole content and output the result to out.tgz file. This way “pv” knows how much data is still left to be processed and shows us that it will take yet another 4 mins 49 secs to finish.

5) Copy a file using pv and watch its progress
pv sourcefile > destfile
pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. (man pv)

6) Another live ssh network throughput test
pv /dev/zero|ssh $host 'cat > /dev/null'
connects to host via ssh and displays the live transfer speed, directing all transferred data to /dev/null

7) dd with progress bar and statistics
sudo dd if=/dev/sdc bs=4096 | pv -s 2G | sudo dd bs=4096 of=~/USB_BLACK_BACKUP.IMG
This command utilizes ‘pv’ to show dd’s progress.

Notes on use with dd:

— dd block size (bs=…) is a widely debated command-line switch and should usually be between 1024 and 4096. You won’t see much performance improvements beyond 4096, but regardless of the block size, dd will transfer every bit of data.

— pv’s switch, ‘-s’ should be as close to the size of the data source as possible.

— dd’s out file, ‘of=…’ can be anything as the data within that file are the same regardless of the filename / extension.



8) [re]verify a disc with very friendly output
dd if=/dev/cdrom | pv -s 700m | md5sum | tee test.md5
[re]verify those burned CD’s early and often – better safe than sorry –

at a bare minimum you need the good old `dd` and `md5sum` commands,

but why not throw in a super “user-friendly” progress gauge with the `pv` command –

adjust the “-s” “size” argument to your needs – 700 MB in this case,

and capture that checksum in a “test.md5” file with `tee` – just in-case for near-future reference.

*uber-bonus* ability – positively identify those unlabeled mystery discs –

for extra credit, what disc was used for this sample output?

9) time how fast the computer reads from /dev/zero
pv /dev/zero > /dev/null
my stats 217GB 0:00:38 [4,36GB/s]
linux  shell  command  pv 
12 days ago by iteruel
UI Copy: UX Guidelines for Command Names and Keyboard Shortcuts
как проектировать названия команд
copywriting  ux  command 
14 days ago by akimkin
Don't git revert that last commit, git reset instead
Do you want to reverse a change in your code and think you need to git revert the last commit? For better version control, the best option is almost always git reset.
git  reset  revert  command  tutorial 
15 days ago by gilberto5757

Copy this bookmark:





to read