Check These Out
If you wish to launch the kde4 screen saver without the password prompt to exit, use this command:
$ qdbus org.freedesktop.ScreenSaver /ScreenSaver org.freedesktop.ScreenSaver.SetActive True
Also can be done with:
$ /usr/lib/kde4/libexec/kscreenlocker --forcelock
Also ignoring "sshd" server is necessary since you should not kill ssh server processes.
You can display, save and restore the value of $IFS using conventional Bash commands, but these functions, which you can add to your ~/.bashrc file make it really easy.
To display $IFS use the function ifs shown above. In the sample output, you can see that it displays the characters and their hexadecimal equivalent.
This function saves it in a variable called $saveIFS:
$ sifs () { saveIFS=$IFS; }
Use this function to restore it
$ rifs () { IFS=$saveIFS; }
Add this line in your ~/.bashrc file to save a readonly copy of $IFS:
$ declare -r roIFS=$IFS
Use this function to restore that one to $IFS
$ rrifs () { IFS=$roIFS; }
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Note: Replace 200000 with drive bytes/512, and /dev/sdx with the destination drive/partition. ;)
Note: You may need to install pipebench, this is easy with "sudo apt-get install pipebench" on Ubuntu.
The reason I hunted around for the pieces to make up this command is that I wanted to specifically flip all of the bits on a new HDD, before running an Extended SMART Self-Test (actually, the second pass, as I've already done one while factory-zeroed) to ensure there are no physical faults waiting to compromise my valuable data. There were several sites that came up in a Google search which had a zero-fill command with progress indicator, and one or two with a fill-with-ones command, but none that I could find with these two things combined (I had to shuffle around the dd command(s) to get this to happen without wasting speed on an md5sum as well).
For reference, these are the other useful-looking commands I found in my search:
Zero-fill drive "/dev/sdx", with progress indicator and md5 verification (run sudo fdisk -l to get total disk bytes, then divide by 512 and enter the resulting value into this command for a full wipe)
$ dd if=/dev/zero bs=512 count= | pipebench | sudo tee /dev/sdx | md5sum
And this command for creating a file filled with ones is my other main source (besides the above command and man pages, that is - I may be a Linux newbie but I do read!):
$ tr '\000' '\377' < /dev/zero | dd of=allones bs=1024 count=2k
Hope someone finds this useful! :)
Cheers,
- Gliktch
Friday is the 5th day of the week, monday is the 1st.
Output may be affected by locale.
-p Tell me the name of the program and it's PID
-l that is listening
-u on a UDP port.
-n Give me numeric IP addresses (don't resolve them)
-t oh, also TCP ports
You might want to secure your AWS operations requiring to use a MFA token. But then to use API or tools, you need to pass credentials generated with a MFA token.
This commands asks you for the MFA code and retrieves these credentials using AWS Cli. To print the exports, you can use:
`awk '{ print "export AWS_ACCESS_KEY_ID=\"" $1 "\"\n" "export AWS_SECRET_ACCESS_KEY=\"" $2 "\"\n" "export AWS_SESSION_TOKEN=\"" $3 "\"" }'`
You must adapt the command line to include:
* $MFA_IDis ARN of the virtual MFA or serial number of the physical one
* TTL for the credentials
Loads file content on clipboard. Very useful when text selection size is higher than console size.