This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"font_size": 9, | |
"highlight_line": true, | |
"shift_tab_unindent": true, | |
"default_line_ending": "unix", | |
"ensure_newline_at_eof_on_save": true, | |
"trim_trailing_white_space_on_save": true, | |
"translate_tabs_to_spaces": true, | |
"word_wrap": false, | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add this to fstab | |
/var/www/ /home/luan/www none rw,bind 0 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paste line by line into the right console | |
sudo su postgres | |
psql -d template1 | |
ALTER USER postgres WITH PASSWORD 'newpass'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/apt/apt.conf | |
Acquire { | |
HTTP::Proxy "http://10.55.2.224:3142"; | |
FTP::Proxy "http://10.55.2.224:3142"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php5 -q | |
//require https://gist.github.com/725875 | |
<?php | |
while(true) | |
{ | |
$alone = shell_exec('./aloneInTheNetwork.php'); | |
if ($alone == 'true') | |
{ | |
echo 'go go go!'; | |
echo shell_exec('transmission-remote localhost:9091 -AS'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php5 -q | |
<?php | |
$broadcast = "10.55.2.255"; | |
$ignore = array('10.55.2.240','10.55.2.66'); | |
$ignore = implode('|',$ignore); | |
$string = "ping -b {$broadcast} -c 2 | grep 'icmp_req=1' | grep -vE '{$ignore}'"; | |
$result = shell_exec($string); | |
if (trim($result)) | |
{ | |
exit('false'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ob_start(); | |
?> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Etag test</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /home/secombkp/backup/ | |
DATE=`/bin/date +%Y-%m-%d` | |
for FILE in * | |
do | |
FILENAME=$FILE"-"$DATE".tar.gz" | |
echo "Creating" $FILENAME | |
tar -zcf ../backup_history/$FILENAME $FILE | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/bin/rsync --progress -avhz --delete --update /folder/from/ user@host:~/folter/to/ --ignore-errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LIST=$(/usr/bin/psql -l | /usr/bin/awk '{ print $1}' | grep -vE '^-|^\(|^List|^N[o|a]me|template[0|1]') | |
for d in $LIST | |
do | |
echo "Backuping: " $d | |
pg_dump -i -h 127.0.0.1 -p 5432 -U postgres -F t -b -f "/backup/backup/$d.backup" $d | |
tar -zcf /backup/backup/$d.tar.gz -C / backup/backup/$d.backup | |
rm /backup/backup/$d.backup |