Replace a string in file for multiple occurences
Open file to edit.
vi <filename>
Press ESC and Enter ":%s/<STRING>/<NEW_STRING>/g"
To Replace string in multiple files in the same directory.
sed -i 's/<OLD_STRING>/<NEW_STRING>/g' *
To fetch PID's for active java processes.
netstat -tlnp | awk '/:80 */ {split($NF,a,"/"); print a[1]}'
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
565
738
787
To eliminate first 2 lines; move to /dev/null
netstat -tlnp 2>/dev/null | awk '/:80 */ {split($NF,a,"/"); print a[1]}'
565
738
787
netstat -tlnp 2>/dev/null | awk '/:80 */ {split($NF,a,"/"); print a[2], a[1]}'
java 565
java 738
java 787
netstat -tlnp 2>/dev/null | awk '/:9201 */ {split($NF,a,"/"); print a[1]}'
738
How To Setup Secure PasswordLess Authentication For SSH Connections in Linux
To setup SSH for logging on without passwords, connect to your Computer (from where you will be making the SSH connection to a remote system). Next open a terminal window and from the prompt, generate your keys on the local computer by using the ssh-keygen program:
ssh-keygen -t rsa
and press enter.
When prompted for 'Enter file in which to save the key" press Enter to accept the default location.
When prompted to "Enter passphrase", press Enter twice for no passphrase.
Two new files have been created in the /home/wtn/.ssh directory which are your private key (id_rsa) and public key (id_rsa.pub):
Now that your keys have been created, copy the id_rsa.pub file to the remote computer and append its content to the ~/.ssh/authorized_keys file. Since SSH is running on the remote server, you can copy and append the file remotely from your computer using the following command:
ssh user@remotehost "cat >> ~/.ssh/authorized_keys" < ~/.ssh/id_rsa.pub
Where:
user@remotehost is your user and hostname on the remote computer.
After you have successfully copy the file information to all your systems, you can now automate scripts and logon to SSH securely with needing to remember passwords!
Java: Keytool Import
To import a certificate into you Java keystore, you require a certificate (say at: c:\mycert.cer); you require a JDK installed (say at: C:\Program Files\Java\jdk1.6.0_22); and we are assuming you have a keystore at C:\Program Files\Java\jdk1.6.0_22\jre\lib\security\cacerts
Steps:
1) Change directory to C:\Program Files\Java\jdk1.6.0_22\bin
2) Run this command:
keytool -import -alias anyaliasname -keystore “C:\Program Files\Java\jdk1.6.0_22\jre\lib\security\cacerts” -file “c:\mycert.cer”
anyaliasname = this can be any alias name not already used in the keystore
3) You will be prompted to enter the password for the keystore. If you have never changed the password, use the default password: ‘changeit’; in case you have changed the password, enter it.
http://dev.day.com/docs/en/cq/current/managing/hardware_sizing_guidelines.html
WebSphere Application Server resources
https://www.ibm.com/developerworks/websphere
http://www.redbooks.ibm.com/
RedHat Linux resources
http://www.linuxtopia.org
http://www.linuxtopia.org/online_books/redhat_linux_sysadmin_intro/index.html
No comments:
Post a Comment