Check These Out
Like the original version except it does not include the parent apache process or the grep process and adds "sudo" so it can be run by user.
This is a very simple way to input a large number of seconds and get a more useful value in minutes and seconds. Avoids useless use of echo.
When I'm testing some scripts or programs, they end up using more memory than anticipated. In that case, computer nearly halts due to swap space usage, and sometimes I have to press Magic SysRq+REISUB to reboot.
So, I was looking for a way to limit memory usage per script and found out that ulimit can limit memory. If you run it this way:
$ $ ulimit -v 1000000
.
$ $ scriptname
Then the new memory limit will be valid for that shell. I think changing the limit within a subshell is much more flexible and it won't interfere with your current shell ulimit settings.
note: -v 1000000 corresponds to approximately 1GB of RAM
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.
This is the setup I'm using for my largest project. It gives 357 lines per page (per side), which makes it fairly easy to carry around a significant amount of code on a few sheets of paper. Try it.
(I stick to the 80 column convention in my coding. For wider code, you'll have to adjust this.)
Put this command in .bashrc and every time you open a new terminal a random quote will be downloaded and printed from onelinerz.net.
By altering the URL in the w3m statement you can change the output:
1 to 10 lines - http://www.onelinerz.net/random-one-liners/(number)/
20 newest lines - http://www.onelinerz.net/latest-one-liners/
Top 10 lines - http://www.onelinerz.net/top-100-funny-one-liners/
Top 10 lines are updated daily.
Get information of volume labels of bitlocker volumes, even if they are encrypted and locked (no access to filesystem, no password provided). Note that the volume labels can have spaces, but only if you name then before encryption. Renaming a bitlocker partition after being encrypted does not have the same effect as doing it before.
This command takes a 1280x1024 p picture from the webcam.
If prefer it smaller, try changing the -s parameter: qqvga is the tiniest, vga is 640x480, svga is 800x600 and so on.
Get your smile on and press enter! :)
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"
}
Bash's here string