Query well known ports list
$ getent services <<service>>
Uses the file located in /etc/services
View this command to comment, vote or add to favourites
View all commands by unixmonkey4200
by David Winterbottom (codeinthehole.com)
$ getent services <<service>>
Uses the file located in /etc/services
View this command to comment, vote or add to favourites
View all commands by unixmonkey4200
by David Winterbottom (codeinthehole.com)
$ sed -e ‘/\\$/{:0;N;s/\\\n//;t0}’
Joins each line that end with backslash (common way to mark line continuation in many languages) with the following one while removing the backslash.
View this command to comment, vote or add to favourites
Vi…
$ paste(){ curl -s -S –data-urlencode "txt=$($*)" "http://pastehtml.com/upload/create?input_type=txt&result=address";echo;}
paste(){ curl -s -S –data-urlencode “txt=$($@)” ”
View this command to comment, vote or add to fa…
$ Tunnel a MySQL server listening on a UNIX socket to the local machine
Listens on local port 5500 and connects to remotehost with username user to tunnel the given socket file. Will work with anything, but can be useful if there’s a need for a local a…
$ upper() { echo ${@^^}; }
Usage: upper [STRING]…
View this command to comment, vote or add to favourites
View all commands by sharfah
by David Winterbottom (codeinthehole.com)
$ lower() { echo ${@,,}; }
Usage: lower [STRING]…
View this command to comment, vote or add to favourites
View all commands by sharfah
by David Winterbottom (codeinthehole.com)
$ listhw(){ curl -s -S –data-urlencode "txt=$(sudo lshw -html)" "http://pastehtml.com/upload/create?input_type=html&result=address";echo;}
In this Linux box i need to become root to get the complete hardware list, so either bec…
$ mailme(){ mailx -s "$@" $USER <<< "$@"; }
Usage: mailme message
This is a useful function if you want to get notified about process completion or failure. e.g.
mailme "process X completed"
View this command…
$ stap -v strace.stp -c /path/to/command
The stap script is :
#! /usr/bin/env stap
probe syscall.* {
if (pid() == target())
printf(“%s %s\n”, name, argstr);
}
View this command to comment, vote or add to favourites
View all commands …
$ grep -c ^processor /proc/cpuinfo
this works for a Linux based system, other UNIX systems may have other way(s) to check the number of CPUs.
View this command to comment, vote or add to favourites
View all commands by gerard
by David Winter…