Skip to content

Instantly share code, notes, and snippets.

View yoimbert's full-sized avatar

yoimbert yoimbert

View GitHub Profile
@yoimbert
yoimbert / inser mac tild
Last active September 7, 2016 20:47
inser sous mac tild mc Midnight Commander
ctrl + t
alt + n
~
http://austringer.net/wp/index.php/2008/06/07/mac-os-x-and-midnight-commander-the-missing-insert-key/
Mac OS X and Midnight Commander: The Missing “Insert” Key
By Wesley R. Elsberry | 2008/06/07 83 Comments
@yoimbert
yoimbert / elseif else if
Created July 21, 2015 14:41
elseif/else if
<?php
if ($a > $b) {
echo "a est plus grand que b";
} elseif ($a == $b) {
echo "a est égal à b";
} else {
echo "a est plus petit que b";
}
?>
Via windows
NBTSTAT -A IP
Via Macos / tools prévu pour le netbios
smbutil status IP
@yoimbert
yoimbert / hostname_ubuntu
Created July 10, 2015 14:04
hostname_ubuntu
You should be able to add the following line to the /etc/cloud/cloud.cfg near the top:
preserve_hostname: true
Then set the hostname in the /etc/hostname
The hostname should now persist after reboots.
@yoimbert
yoimbert / dump.php
Created July 8, 2015 08:43
dump php
<?php
echo "Votre base est en cours de restauration.......<br>";
system("mysqldump -h localhost -u user -pPASSWORD DB > dump.sql");
echo "C'est dumpé";
?>
@yoimbert
yoimbert / iptables_ddos
Last active August 29, 2015 14:23
DDOS_IPTABLES
iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --name BLACKLIST --set
iptables -A INPUT -p tcp --dport 80 -m state --state NEW -m recent --name BLACKLIST --update --seconds 10 --hitcount 10 --rttl -j DROP
SUPPRESSION
iptables -D INPUT -p tcp --dport 80 -m state --state NEW -m recent --name BLACKLIST --update --seconds 10 --hitcount 10 --rttl -j DROP
SUPPRESSION DE MA LISTE
iptables -L --line-numbers
@yoimbert
yoimbert / pkill
Created June 12, 2015 10:24
pkill
pkill -HUP -t pts/6
@yoimbert
yoimbert / PIP install
Last active August 29, 2015 14:22
PIP install
Install PIP
download file :
wget https://bootstrap.pypa.io/get-pip.py
install pip
python get-pip.py
install AWS
pip install awscli
@yoimbert
yoimbert / swapEC2
Last active August 29, 2015 14:22
Swap On EC2
You can add a 1 GB swap to your instance with these commands:
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024
sudo mkswap /swapfile
sudo swapon /swapfile
To enable it by default after reboot, add this line to /etc/fstab:
/swapfile swap swap defaults 0 0
@yoimbert
yoimbert / server-status
Created May 29, 2015 14:11
server-status Apache 2.4
ExtendedStatus on
<Location /server-status>
SetHandler server-status
Require all denied
Require ip xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx
Require host domaine.ltd
</Location>