Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
#Declare Variables | |
cat > cas <<EOF | |
#CAS TEST CONFIG | |
# Vars starting with APP_ are used to replace contents in skeletons files | |
APP_HTTP_PORT=12385 | |
APP_HTTPS_PORT=12386 | |
APP_AJP_PORT=12387 | |
APP_HTTP_MAX_THREADS=150 |
#get certificate issuer/expiry date | |
$echo | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 -noout -issuer -subject -dates | |
issuer= /C=US/O=Google Inc/CN=Google Internet Authority G2 | |
subject= /C=US/ST=California/L=Mountain View/O=Google Inc/CN=*.google.com | |
notBefore=Dec 11 12:49:14 2013 GMT | |
notAfter=Apr 10 00:00:00 2014 GMT | |
# Hash value | |
$ echo | openssl s_client -connect google.com:443 2>/dev/null | openssl x509 -noout -hash | |
a18bd28a |
#If your Kernel is compiled with CONFIG_MAGIC_SYSRQ (sysrq-trigger). | |
#If so, you have the possibility so send binding command. | |
Reset your server (like pressing the hardware RESET button) : | |
# echo b > /proc/sysrq-trigger | |
Sync the hard disks before: | |
# echo s > /proc/sysrq-trigger |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
# This is the ProFTPD configuration file | |
# | |
# See: http://www.proftpd.org/docs/directives/linked/by-name.html | |
# Server Config - config used for anything outside a <VirtualHost> or <Global> context | |
# See: http://www.proftpd.org/docs/howto/Vhost.html | |
# Trace logging, disabled by default for performance reasons | |
# (http://www.proftpd.org/docs/howto/Tracing.html) |
This are my cheat sheets that I have compiled over the years. Tired of searching Google for the same things, I started adding the information here. As time went on, this list has grown. I use this almost everday and this Gist is the first bookmark on my list for quick and easy access.
I recommend that you compile your own list of cheat sheets as typing out the commands has been super helpful in allowing me to retain the information longer.
#Read multiple keys from an authorized_keys file and print the finger print | |
[root@server01 .ssh]# while read line; do ssh-keygen -l -f /dev/stdin <<< $line; done < authorized_keys | |
2048 87:7a:4d:70:d2:10:a4:4b:b7:e1:2b:7c:77:92:25:04 /dev/stdin (RSA) | |
2048 7d:f0:89:94:00:09:bc:70:46:59:8d:9a:70:3b:ac:70 /dev/stdin (RSA) | |
2048 61:63:ee:0d:f6:d2:d8:d6:ae:37:0c:35:ae:da:51:6a /dev/stdin (RSA) | |
#read a key from authorized key file | |
[root@server01 .ssh]# ssh-keygen -l -f authorized_keys | |
2048 87:7a:4d:70:d2:10:a4:4b:b7:e1:2b:7c:77:92:25:04 authorized_keys (RSA) |
##SSHAGENT PPID TRICK for DESKTOP | |
#source ~/.ssh-agent.sh in your .bashrc | |
SSHAGENTPPID=$(ps -eo ppid,comm|awk '/ssh-agent/ {print $1}') | |
if [ -n "$SSHAGENTPPID" ] | |
then | |
export SSH_AUTH_SOCK=`ls /tmp/ssh*/agent.$SSHAGENTPPID` | |
export SSH_AGENT_PID=`pgrep -P $SSHAGENTPPID ssh-agent` | |
echo "SSH agent pid $SSH_AGENT_PID"; |
#Install Ansible from EPEL | |
yum install ansible ansible-lint | |
#Update config file for ansible | |
cat >> /etc/ansible/hosts <<EOF | |
192.168.0.1 | |
[web_servers] | |
192.168.0.20 |