Check These Out
This will send a test print job to a networked printer.
The command tasksel allows the choice of packages from the command line to get predefined configurations for specific services (usually this option is offered during installation).
Center the output text in max line length of buffered output pipe;
This command modifies the preferences file of Firefox that is located in .mozilla/firefox/*.default/prefs.js. It edits the file with sed and the -i option. Then it searches the string "browser.startup.homepage", and the string next to it (second string). Finally, it replaces the second string with the new homepage, that is http://sliceoflinux.com in the example.
It doesn't work if you haven't set any homepage.
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Best result when file size less than half of RAM size
Only tested on Linux Ubunty Hardy. Works when file names have spaces. The "-maxdepth 2" limits the find search to the current directory and the next one deeper in this example. This was faster on my system because find was searching every directory before the current directory without the -maxdepth option. Almost as fast as locate when used as above. Must use double quotes around pattern to handle spaces in file names. -print0 is used in combination with xargs -0. Those are zeros not "O"s. For xargs, -I is used to replace the following "{}" with the incoming file-list items from find. Echo just prints to the command line what is happening with mv. mv needs "{}" again so it knows what you are moving from. Then end with the move destination. Some other versions may only require one "{}" in the move command and not after the -I, however this is what worked for me on Ubuntu 8.04. Some like to use -type f in the find command to limit the type.
gg puts the cursor at the begin
g? ROT13 until the next mov
G the EOF
This provides a list of shared object names (sonames) that are exported by a given tree. This is usually useful to make sure that a given required dependency (NEEDED entry) is present in a firmware image tree.
The shorter (usable) version for it would be
$ scanelf -RBSq -F "+S#f"
But I used the verbose parameters in the command above, for explanation.
Syntax:
$ prepend content to add [filename]
Uses ed, so no temp files created.