find . -type f -exec grep -Iq 'UseConcMarkSweep' {} \; -ls
Rants and ravings of a semi-autistic developer who has a hard time remembering idiotic nonsense details. Why remember it, when you know where to find it.
Thursday, March 31, 2016
find all the ascii files with certain pattern - the fastest way
Tuesday, February 16, 2016
Starting a process remotely thru SSH
[user@prh01967.prod /home/user]$ cat startFlagsAgent.sh JAVA_HOME=/opt/java/hotspot/7/current/jre PATH=$JAVA_HOME/bin:$PATH nohup $JAVA_HOME/bin/java -jar ~/FlagsAgent-0.0.1-SNAPSHOT.jar -https > ~/agent.log & pId=$! echo "kill $pId" > ~/stop_agent.sh chmod u+x ~/stop_agent.sh 217 ssh userprh01628.prod 'bash -s' < ./startFlagsAgent.sh
Labels:
ssh
Saturday, November 7, 2015
/proc/pid/environ contents readable
xargs --null --max-args=1 echo < /proc/13200/environ
Tuesday, October 27, 2015
Netcat testing port connectivity
-bash-4.1$ telnet 10.75.20.102 8471 Trying 10.75.20.102... Connected to 10.75.20.102. Escape character is '^]'. ^CConnection closed by foreign host. -bash-4.1$ nc 10.75.20.102 8471 ^C -bash-4.1$ nc -vz 10.75.20.102 8471 Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! -bash-4.1$Or in a loop
MBP:~ username$ for i in `seq 60 75`; do ssh username@mrh009$i.company.com 'nc -vz 10.75.20.102 8471'; done; Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded! Connection to 10.75.20.102 8471 port [tcp/pim-port] succeeded!
Thursday, October 22, 2015
Installing authorized_keys over a range of hosts automatically
$ for i in `seq 60 75`; do ssh -o "StrictHostKeyChecking no" username@mrh009$i.host.com '[ ! -e .ssh ] && mkdir .ssh; echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEArnIJhZCiJz8arKHd1C5gi2B7G22VuMeqDGcj8jv+sdfsdfsdfsdfsdfsdfsfdsfNBekqviSUFXiG1cBNpNxaAstOWyWmKaS1oefeNJ5waihlzR5V9QTTdBCrYavHj4viPMLWfm70eOhZhOzXQjl4x/xSrh/sadfasdfasdf= " > .ssh/authorized_keys && chmod 700 .ssh '; done;
Tuesday, August 4, 2015
Monday, July 6, 2015
ssh-keygen without prompts and publishing known_hosts
Self provisioning PKI infrastructure and auto registration destination known_hosts
# Generating PKI for publishing the build ssh-keygen -q -t dsa -N '' -f /opt/jenkins/.ssh/id_dsa # Registering the mvndev.mycompany.com target ssh-keyscan -H destination.com,10.76.20.41 >> /opt/jenkins/.ssh/known_hosts
Labels:
ssh,
ssh-keygen,
ssh-keyscan,
ssl
Subscribe to:
Posts (Atom)