Check These Out
If you run this command on a VMWare Virtual Machine, it will return the string "VMware Virtual Platform". If you run it on a physical machine, it will return nothing. Useful for having a script determine if it's running on a VM or not. Of course, you must have dmidecode installed for this to work.
Try it this way in a script: ISVM=$(dmidecode | awk '/VMware Virtual Platform/ {print $3,$4,$5}')
Then test if $ISVM has text in it, or is blank.
Oracle DBA remove some logfiles which are still open by the database and he is complaining the space has not been reclaimed? Use the above command to find out what PID needs to be stopped. Or alternatively recover the file via:
$ cp /proc/pid/fd/filehandle /new/file.txt
Requires netcat.
Run as root. Path may vary depending on laptop model and video card (this was tested on an Acer laptop with ATI HD3200 video).
$ cat /proc/acpi/video/VGA/LCD/brightness
to discover the possible values for your display.
It's not my code, but I found it useful to know how many open connections per request I have on a machine to debug connections without opening another http connection for it.
You can also decide to sort things out differently then the way it appears in here.
will decode a mime message. usefull when you receive some email and file attachment that cant be read.
Convert some SVG files into PNG using ImageMagick's convert command.
Run the conversions in parallel to save time.
This is safer than robinro's forkbomb approach :-)
xargs runs four processes at a time -P4
From the man page.
lft ? display the route packets take to a network host/socket using one of several layer-4
protocols and methods; optionally show heuristic network information in transitu
-A Enable lookup and display of of AS (autonomous system) numbers (e.g., [1]). This option
queries one of several whois servers (see options 'C' and 'r') in order to ascertain the origin
ASN of the IP address in question. By default, LFT uses the pWhoIs service whose ASN data
tends to be more accurate and more timely than using the RADB as it is derived from the
Internet's global routing table.
-N Enable lookup and display of network or AS names (e.g., [GNTY-NETBLK-4]). This option
queries Prefix WhoIs, RIPE NCC, or the RADB (as requested). In the case of Prefix WhoIs or
RADB, the network name is displayed. In the case of RIPE NCC, the AS name is displayed.