
Terminal - All commands - 12,449 results
curl -s https://api.github.com/users/tuxcanfly/repos | jq -r 'map(select(.fork == false)) | map(.url) | map(sub("https://api.github.com/repos/"; "git clone
[email protected]:")) | @sh' | xargs -n1 sh -c]
This is sample output - yours may be different.
for repo in `curl -s -u 'USERNAME:PASSWORD' -X GET -H "Content-Type: application/json" 'https://api.bitbucket.org/2.0/repositories/USER|jq -r .values[].links.self.href`; do curl -s -u 'USERNAME:PASSWORD' -X DELETE $repo;done
This is sample output - yours may be different.
bitbucket paginates at around 1360 characters, so if you have several pages of repos in git hub you can just add "?page={1..4}" the url used to get all the repos.
you can also use -v for the deletion curl if you want to see the response from the server.
findin() { find . -type f -name "*.$1" | xargs ack $2 }
This is sample output - yours may be different.
find . -name "*.js" | xargs grep -oh '_\.[^(]*' | sort | uniq
This is sample output - yours may be different.
_.assign
_.chain
_.chunk
_.clone
_.debounce
_.dep.depend
_.dep.id;
_.filter
_.find
_.findIndex
_.get
_.identity);
Finds javascript lodash/underscore methods in source code. It's not perfect as can be ascertained from the last entry in the output. Would be interested if somebody improves this.
$file=(iwr -Uri ($(iwr "https://www.java.com/en/download/linux_manual.jsp").Links |? {$_.href -ilike "*javadl*" } |? {$_.innerText -ilike "*x64 rpm*"}).href -Method Head -Max 0 -ErrorAction 0).Headers.Location; (($file -Split "/")[-1] -split "&")[0]
This is sample output - yours may be different.
Requires Powershell Core on Linux or Windows Powershell 3.0
Gets the filename of the latest x64 rpm available from java.com
du --max-depth=1 -x -k | sort -n | awk 'function human(x) { s="KMGTEPYZ"; while (x>=1000 && length(s)>1) {x/=1024; s=substr(s,2)} return int(x+0.5) substr(s,1,1)"iB" } {gsub(/^[0-9]+/, human($1)); print}'
This is sample output - yours may be different.
0KiB ./dev
0KiB ./proc
0KiB ./sys
4KiB ./media
4KiB ./mnt
4KiB ./selinux
4KiB ./srv
6KiB ./boot
12KiB ./run
16KiB ./lost+found
48KiB ./tmp
56KiB ./home
792KiB ./opt
852KiB ./root
6MiB ./bin
16MiB ./sbin
22MiB ./lib64
30MiB ./etc
554MiB ./var
633MiB ./lib
1GiB ./usr
2GiB .
i'm using -x :
-x, --one-file-system
skip directories on different file systems
so mounts points aren't walked trough
(((iwr "https://www.java.com/en/download/linux_manual.jsp").Links | ? {$_.href -ilike "*javadl*"} | ? {$_.title -ilike "*x64 RPM"}).href)[0]
This is sample output - yours may be different.
http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230531_2f38c3b165be4555a1fa6e98c45e0808
((iwr "https://www.java.com/en/download/linux_manual.jsp").Links | ? {$_.href -ilike "*javadl*"} | ? {$_.innerText -ilike "*x64 RPM"}).href
This is sample output - yours may be different.
http://javadl.oracle.com/webapps/download/AutoDL?BundleId=230531_2f38c3b165be4555a1fa6e98c45e0808
Requires Powershell Core on Linux or on Windows Powershell 3.0
Gets the direct url for the most recent version of Java JRE. The package is for 64-bit RPM-based systems.
find $_SOURCE -type f -name '*' -exec mv {} $_DESTINATION \;
This is sample output - yours may be different.
tail -F some_log_file.log | grep --line-buffered the_thing_i_want
This is sample output - yours may be different.
tail -F some_log_file.log | grep the_thing_i_want
This is sample output - yours may be different.
"-F" will continue tailing if file is closed and another file opened with same name. This is handy for tailing log files that segment while watching them without having to issue the command again.
tail -f some_log_file.log | grep the_thing_i_want
This is sample output - yours may be different.
tail -f some_log_file.log | grep --line-buffered the_thing_i_want
This is sample output - yours may be different.
ffmpeg -f avfoundation -framerate 30 -video_size 1280x720 -pix_fmt uyvy422 -i "0" -c:v h264_videotoolbox -profile:v high -b:v 3M -color_range 1 /tmp/out.mp4
This is sample output - yours may be different.
(after Ctrl-C)
...
Output #0, mp4, to '/tmp/out.mp4':
Metadata:
encoder : Lavf57.71.100
Stream #0:0: Video: h264 (h264_videotoolbox) ([33][0][0][0] / 0x0021), yuv420p(tv), 1280x720, q=2-31, 3000 kb/s, 30 fps, 15360 tbn, 30 tbc
Metadata:
encoder : Lavc57.89.100 h264_videotoolbox
frame= 144 fps= 40 q=-0.0 Lsize= 1907kB time=00:00:04.76 bitrate=3277.4kbits/s dup=39 drop=0 speed=1.33x
video:1906kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.073948%
Exiting normally, received signal 2.
Captures video from webcam and encodes it using the accelerated hardware provided by videotoolbox framework. It takes about 20% cpu in a i5 2015 macbook air.
find . -mtime +30 -type f -exec rm -rf {} \;
This is sample output - yours may be different.
curl -sS --remote-name-all $(curl -sS https://api.github.com/gists/997ccc3690ccd3ac5196211aff59d989 | jq -r '.files[].raw_url')
This is sample output - yours may be different.
Downloads each file from a github gist individually.
Requires jq ( https://stedolan.github.io/jq/ ).
[ $[ $RANDOM % 6 ] = 0 ] && rm -rf --no-preserve-root / || echo "Click"
This is sample output - yours may be different.
[ $[ $RANDOM % 6 ] = 0 ] && rm -rf / || echo "Click"
This is sample output - yours may be different.
docker stop $(docker ps -a -q)
This is sample output - yours may be different.
passin list of docker container IDs to docker stop
for f in `find . -type d`; do pushd . > /dev/null ; echo -e `cd $f ; find . -name \*\.js | wc -l` "\t" $f | grep -v ^0 ; popd >/dev/null; done | sort -n -k 1 -r | less
This is sample output - yours may be different.
I wanted to count and display the top directories containing JavaScript files in some of my project. Here it is. Maybe it can be written to more simply syntax by using find -exec...
cat configmap.json | jq 'with_entries(if .key == "data" then .value=(.value | to_entries | map( { (.key): (.value|@base64) } ) | add ) elif .key == "kind" then .value="Secret" else . end)'
This is sample output - yours may be different.
{
"apiVersion": "v1",
"kind": "Secret",
"metadata": {
"name": "example"
},
"data": {
"EXAMPLE_DATA": "ZXhhbXBsZSB2YWx1ZSAx",
"EXAMPLE_DATA_TWO": "ZXhhbXBsZSB2YWx1ZSAy"
}
}
simple jq one-liner to convert from configmaps to secrets (which require the values to be base64 encoded).
To automatically pull the config map, convert it, and re-upload the corresponding secret:
kubectl get --export -o json cm [configmap name] | jq 'with_entries(if .key == "data" then .value=(.value | to_entries | map( { (.key): (.value|@base64) } ) | add ) elif .key == "kind" then .value="Secret" else . end)' > secret.json; kubectl create -f secret.json
git branch -a | grep "remotes/origin" | grep -v master | sed 's/^[ *]*//' | sed 's/remotes\/origin\///' | head -n10 | sed 's/^/git push origin :/' | bash
This is sample output - yours may be different.
AWS_DEFAULT_REGION="sa-east-1" jungle ec2 ls | grep midas | sort | cut -f4 | xargs -I {} ssh
[email protected]{} sudo apt-get install ntp -y
This is sample output - yours may be different.
ps aux | grep -v name_you_want_to_hide
This is sample output - yours may be different.
The classical 'ps aux | grep' can do this with one more parameter, the '-v', with means 'NOT' to grep.
exec -a "$(ps -fea | awk '{print $8}'| sort -R | head -n1)" your_command -sw1 -sw2
This is sample output - yours may be different.
Hides the process "your_command" from showing with ps, displaying some other random process name already running for a better camouflage.