Check These Out
For each directory from the current one, list the counts of files in each of these directories. Change the -maxdepth to drill down further through directories.
To create directory, use:
$ tempdir=$(/bin/mktemp -d)
Grabs all rar files in any current subdirectories and feeds it to unrar. Doesn't work well with things packaged like file.part01.rar. Works best with File.rar. You can recurse into other directories by adding more /*'s
Just create a function in your .bashrc like this
shorturl() {
curl -s -d URL="$1" http://is.gd/create.php | sed '/Your new shortened/!d;s/.*value="\([^"]*\)".*/\1/'
}
Using this command you can track a moment when usb device was attached.
Connect-back shell using Bash built-ins. Useful in a web app penetration test, if it's the case of a locked down environment, without the need for file uploads or a writable directory.
--
/dev/tcp and /dev/udb redirects must be enabled at compile time in Bash.
Most Linux distros enable this feature by default but at least Debian is known to disable it.
--
http://labs.neohapsis.com/2008/04/17/connect-back-shell-literally/
Many times I give the same commands in loop to find informations about a file. I use this as an alias to summarize that informations in a single command. Now with variables! :D
And then to complete the task:
Go to target host;
$ssh host
Turn everything off:
$for i in `chkconfig --list | fgrep :on | awk '{print $1}'` ; do chkconfig --level 12345 $i off; done
Create duplicate config:
$while read line; do chkconfig --level $line on; done < foo
Shows all block devices in a tree with descruptions of what they are.
look at /boot/grub/menu.lst for somethig like:
## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
## defoptions=vga=795
# defoptions=vga=873
## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(verbose mode) vga=775 debug
# altoptions=(console mode) vga=ask
# altoptions=(graphic mode) quiet splash
# altoptions=(recovery mode) single
vga=(decimal value) is framebuffer mode