apply and init /var/www/ to normal user

sudo groupadd www
sudo usermod -a -G www ec2-user
exit
groups
sudo chown -R root:www /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;
echo “<?php phpinfo(); ?>" > /var/www/html/phpinfo.php

MAC 10.11 notification when someone login by SSH

sudo vim /etc/profile

then add those endo fo file, u will get MAC notification when someone login by SSH

if [ -n “$SSH_CLIENT" ]; then

        TEXT="$(date): ssh login to ${USER}@$(hostname -f)"

        TEXT="$TEXT from $(echo $SSH_CLIENT|awk ‘{print $1}’)"

        #echo $TEXT|mail -s “ssh login" you@your.domain

        osascript -e ‘display notification “[][][] $TEXT" with title “xLogin"‘

fi

find Duplicate File

findDuplicateFile.sh

#!/bin/sh

dirname=./

find $dirname -type f | sed ‘s_.*/__’ | sort|  uniq -d|

while read fileName

do

find $dirname -type f | grep “$fileName"

done

[ping]

#!/bin/sh
"echo "PPTP Connection test"
while sleep 10
do
  if ! ping -c 1 192.168.102.6; then
    /tmp/pptpd_client/vpn stop
    /tmp/pptpd_client/vpn start
  fi
done

socat

socat STDIO UDP4-DATAGRAM:239.239.239.239:23900,bind=:23900,range=192.168.168.0/24,ip-add-membership=239.239.239.239:192.168.168.6

and then go tologsash by unicat udp

socat STDIO UDP4-DATAGRAM:239.239.239.239:23900,bind=:23900,range=192.168.168.0/24,ip-add-membership=239.239.239.239:192.168.168.4 | socat STDIN UDP-SENDTO:localhost:23911

Mac command line

networksetup -setdhcp “Wi-Fi 2″

xlinx@xPro:~$ networksetup -renamenetworkservice “Wi-Fi 2″ “AWIFI"

xlinx@xPro:~$ networksetup -setmanual “Wi-Fi 2″ 192.168.0.100 255.255.255.0 192.168.0.1

autossh

sudo ssh -Nf -p 443 ccc@ccc.no-ip.org -R 22001/127.0.0.1/22
sudo ssh -Nf -p 443 ccc@ccc.no-ip.org -L 0.0.0.0:8080/192.168.168.2/80
sudo autossh -f -M 23423 -N -R 23422/127.0.0.1/22 ccc@ccc.no-ip.org -p 443
sudo autossh -f -M 23480 -N -L 0.0.0.0:80/192.168.168.2/80 ccc@ccc.no-ip.org -p 443