Check These Out
Adjust the
$ head -c
part for password length.
I use filenames like "hans@commandlinefu.com.gpg" and a vim which automatically decrypts files with .gpg suffixes.
This command is a great way to check to see if acpi is doing damage to your disks by agressivly parking the read arm and wearing down it's life. As you can see, mine has lost half its life. I'm sure this could be shortened though somehow. It will use smartctl to dump the stats and then grep out just the temperature and load cycles for the disk (a load cycle is when a the read arm comes out of park and wears on the drive).
ZenCart uses a MD5 with a salt to secure its passwords. If you need to forcibly change someone's password to a known value within the database, this one-liner can generate the password. Change the value of 'p' to the password you want.
Thanks to the authors of:
$ awk '!x[$0]++'
and the author of:
$ joinargs() { (local IFS="$1"; shift && echo "$*") }
and others, we can have a fast Linux or android.
IMPORTANT if you find a priority order problem in PATH you can push a path directory to the front without duplication as follows:
$ PATH=/bin:$PATH
then ...
Check duplication with:
$ echo $PATH|tr : '\n'|sort|uniq -d
Finally do a very neat line by line list of $PATH:
$ echo "${PATH//:/$'\n'}
The speed up is very noticeable for android, and builds on Linux Ubantu are much faster with make and scripts.
I will update the command on request. Timothy from SONY
Linux offers an interesting option to restrict the use of dmesg. It is available via /proc/sys/kernel/dmesg_restrict.
You can check the status with:
$ cat /proc/sys/kernel/dmesg_restrict
Alternatively you can use sysctl:
$ sudo sysctl -w kernel.dmesg_restrict=1
To make your change persistent across reboot, edit a fille in /etc/sysctl.d/.
First set the variable $hexchars:
$hexchars="0123456789ABCDEF"
Change the number in the first for loop if you need less then 1200 mac addresses
This is a slightly modified version of the knoppix5 user oneliner (https://www.commandlinefu.com/commands/view/24571/draw-line-separator).
i've been writing a bash script where i needed to query the installed version number of the nvidia driver when it's not loaded. Unfortunately i have not found a easy way of doing this.
If i'm a stupid person, please enlighten me of a better way ;)
displays the output of ls -l without the rest of the crud. pretty simple but useful.