Skip to content

Commit

Permalink
pull from commandlinefu.com
Browse files Browse the repository at this point in the history
tg123 committed Feb 15, 2015

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b0c8fca commit 54f4577
Showing 32 changed files with 256 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _data/alias_sound_volume_amixer_d_pulse_sset_master.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14039
translator:
weibo: ''
hide: true
command: |-
alias Sound-volume='amixer -D pulse sset Master '
summary: |-
change the volume with the pront
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14032
translator:
weibo: ''
hide: true
command: |-
awk 'function max(x){i=0;for(val in x){if(i<=x[val]){i=x[val];}}return i;} /^#/{next} {a[$<col_num>]=$<col_num>;next} END{maximum=max(a);print "Max = "maximum}' <file_name>
summary: |-
Use awk to find max and min values of a list
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14021
translator:
weibo: ''
hide: true
command: |-
cat /dev/urandom | strings | grep -o '[[:alnum:]]' | head -n 15 | tr -d '\n'; echo
summary: |-
Generate a random alphanumeric string (works on Mac)
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14035
translator:
weibo: ''
hide: true
command: |-
command foo bar | sudo tee /etc/write-protected > /dev/null
summary: |-
Redirect output to a write-protected file with sudo but without sh -c, using tee.
8 changes: 8 additions & 0 deletions _data/compress_pictures_pictures_tar_gz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14038
translator:
weibo: ''
hide: true
command: |-
compress pictures/ pictures.tar.gz
summary: |-
compress a file/folder to tar,zip,rar...
8 changes: 8 additions & 0 deletions _data/convert_delay_20_loop_0_jpg_myimage_gif.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14029
translator:
weibo: ''
hide: true
command: |-
convert -delay 20 -loop 0 *.jpg myimage.gif
summary: |-
Create an animated gif from pictures
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14025
translator:
weibo: ''
hide: true
command: |-
curl -s ip.appspot.com | xargs -n 1 curl -s "freegeoip.net/csv/$1" | cut -d ',' -f '9 10' | sed 's/,/\&lon=/g' | xargs -n 1 echo "http://api.openweathermap.org/data/2.5/weather?mode=html&lat=$1" | sed 's/ //g' | xargs -n 1 curl -s $1 | lynx -stdin -dump
summary: |-
What's the weather like?
8 changes: 8 additions & 0 deletions _data/curl_whatismyip_akamai_com_echo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14034
translator:
weibo: ''
hide: true
command: |-
curl whatismyip.akamai.com && echo
summary: |-
Get your external IP address
8 changes: 8 additions & 0 deletions _data/du_hsl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14023
translator:
weibo: ''
hide: true
command: |-
du -hsL */
summary: |-
View disk usage
8 changes: 8 additions & 0 deletions _data/extract_file_tar_gz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14036
translator:
weibo: ''
hide: true
command: |-
extract file.tar.gz
summary: |-
a function that extracts packt files
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14046
translator:
weibo: ''
hide: true
command: |-
for f in `find /path -name "*string*"`; do newfn=`echo "$f" | sed s/string/new_string/`; cp $f $newfn; done
summary: |-
Copy files with a given string to a new set of files with a different string.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14019
translator:
weibo: ''
hide: true
command: |-
git branch | grep -v "master" | sed 's/^[ *]*//' | sed 's/^/git branch -D /' | bash
summary: |-
Delete all git branches except master
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14018
translator:
weibo: ''
hide: true
command: |-
git branch | grep -v "master" | sed 's/^[ *]*//' | sed 's/.*/& &/' | sed 's/^/git tag archive\//' | bash
summary: |-
Archive git branches in "arhive/" tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14027
translator:
weibo: ''
hide: true
command: |-
git rev-list --all|tail -n1|xargs git show|grep -v diff|head -n1|cut -f1-3 -d' '
summary: |-
Find the date of the first commit in a git repository
8 changes: 8 additions & 0 deletions _data/gnome_open.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14037
translator:
weibo: ''
hide: true
command: |-
gnome-open
summary: |-
open the default program
8 changes: 8 additions & 0 deletions _data/grep_include_html_r_some_string_2_dev_null.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14026
translator:
weibo: ''
hide: true
command: |-
grep --include=\*.html -R "some string" . 2>/dev/null
summary: |-
Search recursively to find a word or phrase in certain file types, such as C code
8 changes: 8 additions & 0 deletions _data/hexdump_n6_e_1_02x_dev_random_sed_s_n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14030
translator:
weibo: ''
hide: true
command: |-
hexdump -n6 -e '/1 "%02X:"' /dev/random|sed 's/:$/\n/'
summary: |-
Generat a Random MAC address
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14043
translator:
weibo: ''
hide: true
command: |-
ifconfig -a | grep inet | awk '{print $2}' | cut -d ":" -f 2 | grep -v 127.0.0.1
summary: |-
Get non-localhost IPs from all Internet interfaces
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14048
translator:
weibo: ''
hide: true
command: |-
ip -o -4 addr show eth0 | grep -v ": lo " | sed 's/ \+/\t/g' | cut -f 4 | cut -d\/ -f1
summary: |-
Show your local ipv4 IP
8 changes: 8 additions & 0 deletions _data/json_xs_t_yaml_foo_json_foo_yaml.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14016
translator:
weibo: ''
hide: true
command: |-
json_xs -t yaml < foo.json > foo.yaml
summary: |-
Convert JSON to YAML (unicode safe)
8 changes: 8 additions & 0 deletions _data/ls_lt_grep_awk_nr_n_print_9_xargs_rm_rf_i.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14044
translator:
weibo: ''
hide: true
command: |-
ls -lt | grep ^- | awk 'NR>=N {print $9}' | xargs rm -rf -i
summary: |-
Delete files sorted by dates. Delete all other files except latest N files.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14049
translator:
weibo: ''
hide: true
command: |-
lsof -i -n -P | grep -e "$(ps aux | grep node | grep -v grep | awk -F' ' '{print $2}' | xargs | awk -F' ' '{str = $1; for(i = 2; i < NF; i++) {str = str "\\|" $i} print str}')"
summary: |-
dynamically list open files for a given process name
8 changes: 8 additions & 0 deletions _data/pbpaste_awk_x_0_pbcopy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14031
translator:
weibo: ''
hide: true
command: |-
pbpaste | awk ' !x[$0]++' | pbcopy
summary: |-
Remove duplicate lines from the current copy buffer.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14047
translator:
weibo: ''
hide: true
command: |-
postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } / user@example\.com/ { print $1 }' | tr -d '*!' | postsuper -d -
summary: |-
Delete specific sender in mailq
8 changes: 8 additions & 0 deletions _data/ps1_t_w_nyuki_n.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14033
translator:
weibo: ''
hide: true
command: |-
PS1='(\t <\w>)\nYUKI.N>'
summary: |-
Yuki Nagato bash promt.
8 changes: 8 additions & 0 deletions _data/ssh_root_host_domain_tld_date_s_date.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14017
translator:
weibo: ''
hide: true
command: |-
ssh [email protected] "date -s '"$(date)"'";
summary: |-
Sync local machine date to remote machine over ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14045
translator:
weibo: ''
hide: true
command: |-
ssh -t [email protected] "ssh -t [email protected] bash -l"
summary: |-
Multiple level ssh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14024
translator:
weibo: ''
hide: true
command: |-
sudo gpg --refresh-keys; sudo apt-key update; sudo rm -rf /var/lib/apt/{lists,lists.old}; sudo mkdir -p /var/lib/apt/lists/partial; sudo apt-get clean all; sudo apt-get update
summary: |-
Clean apt-get and gpg cache and keys
8 changes: 8 additions & 0 deletions _data/sudo_rm_rf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14020
translator:
weibo: ''
hide: true
command: |-
sudo rm -rf /
summary: |-
Delete everything!
8 changes: 8 additions & 0 deletions _data/sudo_service_network_manager_start.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14040
translator:
weibo: ''
hide: true
command: |-
sudo service network-manager start
summary: |-
turn on/off wifi
8 changes: 8 additions & 0 deletions _data/using_3_thread_to_download_some_big_file.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14022
translator:
weibo: ''
hide: true
command: |-
using 3 thread to download some big file
summary: |-
axel -a -n 3 http://somelink-to-download/
8 changes: 8 additions & 0 deletions _data/xbacklight_set_100.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
commandlinefu_id: 14041
translator:
weibo: ''
hide: true
command: |-
xbacklight -set 100
summary: |-
set screen brightness

0 comments on commit 54f4577

Please sign in to comment.