Trick to recall “ln -s” symlink argument order
I can never remember the order of arguments for the ln command (link command). The easiest way to think about it is to rethink of the “cp” (copy command) instead of “cpRead More…
I can never remember the order of arguments for the ln command (link command). The easiest way to think about it is to rethink of the “cp” (copy command) instead of “cpRead More…
This github page, https://github.com/andreafabrizi/Dropbox-Uploader, has the dropbox-uploader tool which I use to backup content from servers (Linux, Mac, etc) without having to sync my Dropbox content to the local disk on yourRead More…
Xargs is useful to run in parallel. Its parallel processing is very efficient. Read this post about its efficiency and this one about basic commands. Below, is my favorite way to runRead More…
# citing: https://www.reddit.com/r/Python/comments/jfx7wy/how_to_quickly_remove_duplicates_from_a_list/ # Let’s make some duplicates (one million numbers between 1 and 100) from random import randrange DUPLICATES = [ randrange(100) for _ in range(1_000_000) ] ### METHOD 1 ###Read More…
iostat service time is a very useful metric when analyzing disk performance and finding bottlenecks service time is essentially the inverse of IOPs so if an operation takes 1ms to service, thenRead More…
function displaytime { local T=$1 local D=$((T/60/60/24)) local H=$((T/60/60%24)) local M=$((T/60%60)) local S=$((T%60)) (( $D > 0 )) && printf ‘%d days ‘ $D (( $H > 0 )) && printf ‘%dRead More…
We need to run ifconfig and look for the status line. Remember this about ifconfig output: * if “status: active“, the port is linked up and sending traffic (now you just needRead More…
If your system gzips and rotates your logs. You can use this trick to search thru all of them. # zgrep -i — “SEARCHTERM” $(ls -1Str /var/log/messages*) Another way # zgrep -iRead More…
Got info from here: https://stackoverflow.com/questions/18363833/how-can-i-list-upnp-server-renderer-in-command-line-console-mode-on-linux Get the Upnp test tools # apt-get install gupnp-tools Example 1: Find all Upnp devices (note their target names start with urn:…. It will hint at what service itRead More…
You can use bash to do simple substitutions of variables, just like you can with sed. The bash trick turns out to take up less characters (bytes). Lets set some variable VAR1="thisRead More…