Check These Out
Trace python statement execution and syscalls invoked during that simultaneously
tars the current directory (and its children) in an archive of the same name (plus ".tar" :)) in the parent directory without the absolute path, so that when the archive is extracted, only the current directory name is created for the path. Assumes bash/zsh.
Simply translates whitespace to newlines. Could be enhanced to compress out extra newlines, but that might be better handled in the next tool down the pipe, with eg uniq(1).
This command will find all files recursively containing the phrase entered, represented here by "searchphrase". This particular command searches in all php files, but you could change that to just be html files or just log files etc.
The output will likely point to '/etc/alternatives/java'.
So find out where that points by issuing ls -l like this:
ls -l /etc/alternatives/java
or: C
This command is very helpful when we need to duplicate a test scenario and first we want to find out the installed libraries together with the version and release numbers and architecture. (look example)
Command can be tuned by choosing just the names of libraries we are interested in. For example glibc and gcc.
Assumes XP/2000/2003. For Server 2008+ try offset=105,906,176 You can find this number in the System Information utility under Partition Starting Offset. UEFI based boxes you want partition 2 since the first is just the boot files (and FAT). This works with (storage side) snapshots which is handy for single file restores on NFS mounted VMware systems
A common mistake in Bash is to write command-line where there's command a reading a file and whose result is redirected to that file.
It can be easily avoided because of :
1) warnings "-bash: file.txt: cannot overwrite existing file"
2) options (often "-i") that let the command directly modify the file
but I like to have that small function that does the trick by waiting for the first command to end before trying to write into the file.
Lots of things could probably done in a better way, if you know one...