<![CDATA[Commands with 10 up-votes]]> http://www.brpent.com/feed/tenup Tue, 22 Dec 2020 07:48:48 +0000 Zend Framework Zend_Feed en-us http://blogs.law.harvard.edu/tech/rss <![CDATA[Print all git repos from a user]]> wuziduzi http://www.brpent.com/commands/view/24728/print-all-git-repos-from-a-user http://www.brpent.com/commands/view/24728/print-all-git-repos-from-a-user $ curl -s https://api.github.com/users/<username>/repos?per_page=1000 |grep git_url |awk '{print $2}'| sed 's/"\(.*\)",/\1/'

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Tue, 19 Nov 2019 20:31:19 +0000 http://www.brpent.com/commands/view/24728/print-all-git-repos-from-a-user
<![CDATA[Host cpu performance]]> kharthigeyan http://www.brpent.com/commands/view/24725/host-cpu-performance http://www.brpent.com/commands/view/24725/host-cpu-performance $ openssl speed md5
Measure the cpu performance: In-case if the cpu is thermal throttling then you can find it using this command. Check the first line of the output. Example: Doing md5 for 3s on 16 size blocks: 11406892 md5's in 2.98s ? #(When cpu is not throttling) Doing md5 for 3s on 16 size blocks: 110692 md5's in 2.98s ?? #(When cpu is thermal throttling) Practical use case: Once we had cooling outage in data center which caused thermal throttling in some of the worker nodes. We used this tool to prove that some servers are not performing well because of the cpu thermal throttling.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Thu, 07 Nov 2019 16:30:30 +0000 http://www.brpent.com/commands/view/24725/host-cpu-performance
<![CDATA[Using a single sudo to run multiple && arguments]]> metropolis http://www.brpent.com/commands/view/24653/using-a-single-sudo-to-run-multiple-arguments http://www.brpent.com/commands/view/24653/using-a-single-sudo-to-run-multiple-arguments $ sudo -s <<< 'apt update -y && apt upgrade -y'
Bash's here string

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Wed, 07 Aug 2019 14:03:30 +0000 http://www.brpent.com/commands/view/24653/using-a-single-sudo-to-run-multiple-arguments
<![CDATA[return external ip]]> MrTux (http://www.ubuntu-vn.org) http://www.brpent.com/commands/view/17722/return-external-ip http://www.brpent.com/commands/view/17722/return-external-ip $ curl ipinfo.io
Return IP information about your external ip address with JSON format

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Sun, 04 Sep 2016 08:23:25 +0000 http://www.brpent.com/commands/view/17722/return-external-ip
<![CDATA[Nice weather forecast on your shell]]> nordri (http://www.muspells.net) http://www.brpent.com/commands/view/17709/nice-weather-forecast-on-your-shell http://www.brpent.com/commands/view/17709/nice-weather-forecast-on-your-shell $ curl wttr.in/seville
Change Seville for your prefered city.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Sun, 28 Aug 2016 09:43:38 +0000 http://www.brpent.com/commands/view/17709/nice-weather-forecast-on-your-shell
<![CDATA[Optimal way of deleting huge numbers of files]]> malathion http://www.brpent.com/commands/view/17371/optimal-way-of-deleting-huge-numbers-of-files http://www.brpent.com/commands/view/17371/optimal-way-of-deleting-huge-numbers-of-files $ rsync -a --delete empty-dir/ target-dir/
This command works by rsyncing the target directory (containing the files you want to delete) with an empty directory. The '--delete' switch instructs rsync to remove files that are not present in the source directory. Since there are no files there, all the files will be deleted. I'm not clear on why it's faster than 'find -delete', but it is. Benchmarks here: https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Tue, 07 Jun 2016 16:56:55 +0000 http://www.brpent.com/commands/view/17371/optimal-way-of-deleting-huge-numbers-of-files
<![CDATA[random git-commit message]]> paulera (http://paulodev.com) http://www.brpent.com/commands/view/17250/random-git-commit-message http://www.brpent.com/commands/view/17250/random-git-commit-message $ git commit -m "$(curl -s http://whatthecommit.com/index.txt)";
Do a git commit using a random message.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Wed, 04 May 2016 09:51:18 +0000 http://www.brpent.com/commands/view/17250/random-git-commit-message
<![CDATA[Disco lights in the terminal]]> atoponce (http://pthree.org) http://www.brpent.com/commands/view/15068/disco-lights-in-the-terminal http://www.brpent.com/commands/view/15068/disco-lights-in-the-terminal $ while true; do printf "\e[38;5;$(($(od -d -N 2 -A n /dev/urandom)%$(tput colors)))m.\e[0m"; done
Looks best in an 80x24 256-color terminal emulator.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Tue, 24 Nov 2015 15:21:27 +0000 http://www.brpent.com/commands/view/15068/disco-lights-in-the-terminal
<![CDATA[Select rectangular screen area]]> knoppix5 http://www.brpent.com/commands/view/15021/select-rectangular-screen-area http://www.brpent.com/commands/view/15021/select-rectangular-screen-area $ Ctrl + Alt
Hold 'Ctrl' + 'Alt' key while selecting rectangular text area of the screen with left mouse button. Should work in any terminal screen (xterm, konsole, ...) under X, if not then try with 'Ctrl' + 'Shift' + 'Alt' or two-combination of these.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Tue, 10 Nov 2015 22:08:57 +0000 http://www.brpent.com/commands/view/15021/select-rectangular-screen-area
<![CDATA[du with colored bar graph]]> point_to_null http://www.brpent.com/commands/view/14682/du-with-colored-bar-graph http://www.brpent.com/commands/view/14682/du-with-colored-bar-graph $ du -x --max-depth=1|sort -rn|awk -F / -v c=$COLUMNS 'NR==1{t=$1} NR>1{r=int($1/t*c+.5); b="\033[1;31m"; for (i=0; i<r; i++) b=b"#"; printf " %5.2f%% %s\033[0m %s\n", $1/t*100, b, $2}'|tac
A more efficient way, with reversed order to put the focus in the big ones.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Sat, 12 Sep 2015 10:36:49 +0000 http://www.brpent.com/commands/view/14682/du-with-colored-bar-graph
<![CDATA[Determine if a port is open with bash]]> zlemini http://www.brpent.com/commands/view/14651/determine-if-a-port-is-open-with-bash http://www.brpent.com/commands/view/14651/determine-if-a-port-is-open-with-bash $ : </dev/tcp/127.0.0.1/80
For times when netcat isn't available. Will throw a Connection refused message if a port is closed. Scriptable: (: </dev/tcp/127.0.0.1/80) &>/dev/null && echo "OPEN" || echo "CLOSED"

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Fri, 28 Aug 2015 19:07:27 +0000 http://www.brpent.com/commands/view/14651/determine-if-a-port-is-open-with-bash
<![CDATA[Read and write to TCP or UDP sockets with common bash tools]]> tyzbit (http://qtosw.com) http://www.brpent.com/commands/view/14406/read-and-write-to-tcp-or-udp-sockets-with-common-bash-tools http://www.brpent.com/commands/view/14406/read-and-write-to-tcp-or-udp-sockets-with-common-bash-tools $ exec 5<>/dev/tcp/time.nist.gov/13; cat <&5 & cat >&5; exec 5>&-
Ever needed to test firewalls but didn't have netcat, telnet or even FTP? Enter /dev/tcp, your new best friend. /dev/tcp/(hostname)/(port) is a bash builtin that bash can use to open connections to TCP and UDP ports. This one-liner opens a connection on a port to a server and lets you read and write to it from the terminal. How it works: First, exec sets up a redirect for /dev/tcp/$server/$port to file descriptor 5. Then, as per some excellent feedback from @flatcap, we launch a redirect from file descriptor 5 to STDOUT and send that to the background (which is what causes the PID to be printed when the commands are run), and then redirect STDIN to file descriptor 5 with the second cat. Finally, when the second cat dies (the connection is closed), we clean up the file descriptor with 'exec 5>&-'. It can be used to test FTP, HTTP, NTP, or can connect to netcat listening on a port (makes for a simple chat client!) Replace /tcp/ with /udp/ to use UDP instead.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Thu, 30 Jul 2015 21:12:38 +0000 http://www.brpent.com/commands/view/14406/read-and-write-to-tcp-or-udp-sockets-with-common-bash-tools
<![CDATA[drop first column of output by piping to this]]> snaguber http://www.brpent.com/commands/view/14281/drop-first-column-of-output-by-piping-to-this http://www.brpent.com/commands/view/14281/drop-first-column-of-output-by-piping-to-this $ awk '{ $1="";print}'

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Tue, 26 May 2015 20:55:36 +0000 http://www.brpent.com/commands/view/14281/drop-first-column-of-output-by-piping-to-this
<![CDATA[Search for a process by name]]> pooderbill http://www.brpent.com/commands/view/14172/search-for-a-process-by-name http://www.brpent.com/commands/view/14172/search-for-a-process-by-name $ ps -fC PROCESSNAME
ps and grep is a dangerous combination -- grep tries to match everything on each line (thus the all too common: grep -v grep hack). ps -C doesn't use grep, it uses the process table for an exact match. Thus, you'll get an accurate list with: ps -fC sh rather finding every process with sh somewhere on the line.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Mon, 20 Apr 2015 13:09:44 +0000 http://www.brpent.com/commands/view/14172/search-for-a-process-by-name
<![CDATA[Mount a VMware virtual disk (.vmdk) file on a Linux box]]> rldleblanc http://www.brpent.com/commands/view/13718/mount-a-vmware-virtual-disk-.vmdk-file-on-a-linux-box http://www.brpent.com/commands/view/13718/mount-a-vmware-virtual-disk-.vmdk-file-on-a-linux-box $ kpartx -av <image-flat.vmdk>; mount -o /dev/mapper/loop0p1 /mnt/vmdk
This does not require you to know the partition offset, kpartx will find all partitions in the image and create loopback devices for them automatically. This works for all types of images (dd of hard drives, img, etc) not just vmkd. You can also activate LVM volumes in the image by running vgchange -a y and then you can mount the LV inside the image. To unmount the image, umount the partition/LV, deactivate the VG for the image vgchange -a n <volume_group> then run kpartx -dv <image-flad.vmdk> to remove the partition mappings.

commandlinefu.com

Diff your entire server config at ScriptRock.com

]]>
Thu, 25 Sep 2014 23:05:09 +0000 http://www.brpent.com/commands/view/13718/mount-a-vmware-virtual-disk-.vmdk-file-on-a-linux-box
国产片av在线观看国语_亚洲欧美aⅴ在线资源_亚洲国产综合自在线