Skip to content

Instantly share code, notes, and snippets.

View yoimbert's full-sized avatar

yoimbert yoimbert

View GitHub Profile
@yoimbert
yoimbert / pkill
Created June 12, 2015 10:24
pkill
pkill -HUP -t pts/6
@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 / 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 / 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.
Via windows
NBTSTAT -A IP
Via Macos / tools prévu pour le netbios
smbutil status IP
@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";
}
?>
@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 / mysqlpassword
Created November 9, 2015 14:51
password mysql
mysqladmin -u root -p password 'monnouveaumotdepasse'
Enter password:OLDPASSWORD
@yoimbert
yoimbert / applescriptreboot
Created November 23, 2015 16:46
applescriptreboot
do shell script "shutdown -r now" user name "user" password "password" with administrator privileges
@yoimbert
yoimbert / Shrinking Header: Nightly.markdown
Created February 15, 2016 22:01
Shrinking Header: Nightly