start new:
tmux
start new with session name:
tmux new -s myname
| #Sample apache mod_proxy ssl vhost with location based access | |
| <VirtualHost *:443 *:60443> | |
| ServerName www.nerdplanet.co.uk | |
| ServerAlias nerdplanet.co.uk | |
| DocumentRoot /var/www/vhosts/nerdplanet.co.uk/ | |
| #LogLevel debug | |
| CustomLog /var/log/httpd/nerdplanet.co.uk_access_log combined | |
| ErrorLog /var/log/httpd/nerdplanet.co.uk_error_log | |
| SSLEngine on |
| #Redirect NonSSL to SSL | |
| RewriteEngine on | |
| RewriteCond %{HTTPS} off | |
| RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
| #Redirect if the host name not begins with WWW | |
| RewriteEngine on | |
| RewriteCond %{HTTP_HOST} !^www.nerdplanet.co.uk$ [NC] | |
| RewriteRule ^(.*)$ https://www.nerdplanet.co.uk$1 [R=301] | |
| ########### apache-sync.sh | |
| #!/bin/bash | |
| #Purpose:To update apache configs via git to the rest of the apache servers | |
| #Note: This script should only be run from node01 to keep things consistent | |
| #Date: 11/09/2014 | |
| #Author: Mohan | |
| #HOST IPS are read from hosts file in the current dir | |
| . hosts |
| #connect to ssl site | |
| openssl s_client -connect ip:port | |
| #vhost connect | |
| openssl s_client -servername mysite.co.uk -connect mysite.co.uk:443 | |
| #Reading CSR | |
| openssl req -noout -text -in uat-mobi.scotrail.co.uk.csr | |
| #Reading certificates |
| #create new LVM 100% space with single disk | |
| ########################################### | |
| [root@nodem01 ~]# pvcreate /dev/sdc1 | |
| Physical volume "/dev/sdc1" successfully created | |
| [root@nodem01 ~]# vgcreate DataVG /dev/sdc1 | |
| Volume group "DataVG" successfully created | |
| #create a lvm with 100% usage on DataVG |
| METHOD 1: (with nc in localbox) | |
| ssh -D 60002 [email protected] | |
| sftp -o 'ProxyCommand=nc -xlocalhost:60002 %h %p' [email protected] | |
| METHOD 2: (with nc in remote box) | |
| sftp -o 'ProxyCommand ssh -q -l mohan 10.1.1.20 nc remotehost.com 22' [email protected] | |
| METHOD 3: (without nc at all) | |
| ssh -L 60002:remotehost.com:22 [email protected] | |
| sftp -o Port=60002 USER@localhost |
| #!/bin/bash | |
| # | |
| #puppet bootstrap script | |
| # | |
| #chkconfig: 2345 99 99 | |
| #description: simple bash script to run puppet after reboot | |
| #Date: 16/12/2014 | |
| #Author:Mohan | |
| #Bootstrapping startup process |
| ##TCP FLAGS## | |
| Unskilled Attackers Pester Real Security Folks | |
| ============================================== | |
| TCPDUMP FLAGS | |
| Unskilled = URG = (Not Displayed in Flag Field, Displayed elsewhere) | |
| Attackers = ACK = (Not Displayed in Flag Field, Displayed elsewhere) | |
| Pester = PSH = [P] (Push Data) | |
| Real = RST = [R] (Reset Connection) | |
| Security = SYN = [S] (Start Connection) |