This file contains hidden or 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
# Different ways to test multiple | |
# flags at once in Python | |
x, y, z = 0, 1, 0 | |
if x == 1 or y == 1 or z == 1: | |
print('passed') | |
if 1 in (x, y, z): | |
print('passed') |
This file contains hidden or 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 | |
# | |
# SSH Connection with kill itself | |
# | |
# set some variables | |
#Tunnel ssh | |
ec2rebond="" | |
ec2rebondkey="" |
This file contains hidden or 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 | |
# | |
# run as a cron job to synchronize Files + SQL Right Tables from the local server to live amazon server. | |
# | |
# set environment | |
dt=`date +%d%m%Y` | |
timenow=`date +%T` | |
logfile="sync.log" | |
errfile="sync.err" | |
machine=`hostname` |
This file contains hidden or 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
##install deb file | |
sudo dpkg -i *.deb | |
## In real time info | |
tail -f fichierdelog | |
###Change time | |
sudo ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime | |
###DUMP SQL AMAZON |
This file contains hidden or 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 /mydir | |
unlink current | |
ln -s releases/${BUILD_NUMBER} current | |
cd /var/www/html | |
unlink current | |
ln -s releases/${BUILD_NUMBER} current | |
num=${BUILD_NUMBER} | |
x=4 |