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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
use Aws\Common\Aws; | |
use Aws\S3\Exception\S3Exception; | |
// make sure the SDK is installed | |
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html | |
/* | |
* jQuery File Upload Plugin PHP Class 7.1.0 | |
* https://github.com/blueimp/jQuery-File-Upload |
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 | |
use Aws\Common\Aws; | |
use Aws\S3\Exception\S3Exception; | |
// make sure the SDK is installed | |
// I've used Composer to autoload it: http://docs.aws.amazon.com/aws-sdk-php/guide/latest/installation.html | |
/* | |
* jQuery File Upload Plugin PHP Class 7.1.0 | |
* https://github.com/blueimp/jQuery-File-Upload |
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
# 1) Configure pure-ftpd | |
echo "40110 40210" > /etc/pure-ftpd/conf/PassivePortRange | |
/etc/init.d/pure-ftpd-mysql restart | |
# 2) Configure the firewall. If you use ISPConfig 3 on my server to configure the bastille firewall, you can add the nescessery port range in the ISPConfig firewall settings. | |
Change the list of Open TCP ports from: | |
20,21,22,25,53,80,110,143,443,3306,8080,10000 | |
to: | |
20,21,22,25,53,80,110,143,443,3306,8080,10000,40110:40210 | |
and then click on "Save". |
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
#source : http://kloudrocks.com/ | |
# Unregister and clean AMI snapshots | |
$amiName = 'ami-XXXX' # replace this with the AMI ID you need to clean-up | |
$myImage = Get-EC2Image $amiName | |
$count = $myImage[0].BlockDeviceMapping.Count | |
# Loop and store snapshotID(s) to an array | |
$mySnaps = @() | |
for ($i=0; $i -lt $count; $i++) |
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
$query_RecordsetLot = "UPDATE Lots SET `status` = 'optionné' , date='".date("Y-m-d", mktime(0, 0, 0, date("m") , date("d")+14, date("Y")))."', userid=".$_SESSION['kt_login_id']." WHERE idLot =".$idLot; | |
Pour faire une verif et voir l'erreur. | |
1/ consulter les logs | |
2/ Rempalcer les variables par des valeurs | |
Exemple : | |
$query_RecordsetLot = "UPDATE Lots SET `status` = 'optionné' , date='2014-11-26', userid=1 WHERE idLot = 547"; |
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
Mise a jour heure | |
dpkg-reconfigure tzdata |
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
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> | |
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
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 | |
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
Install PIP | |
download file : | |
wget https://bootstrap.pypa.io/get-pip.py | |
install pip | |
python get-pip.py | |
install AWS | |
pip install awscli |
OlderNewer