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 | |
$notAllowedExt = array('exe','apk'); //Неприемлимые расширения | |
$maxFileSize = 100 * 1024 * 1024; //100 MB | |
// Получатель (измените на ваш e-mail адрес) | |
$strEmail = "from@from.ru"; | |
$email = filter_var($_REQUEST['email'],FILTER_VALIDATE_EMAIL); | |
if($email!==FALSE) { | |
$name = filter_var($_REQUEST['name'],FILTER_SANITIZE_STRING); |
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
# files | |
.DS_Store | |
Thumbs.db | |
*.sql | |
.gitignore | |
/.idea/ | |
*/webstat/ | |
# core | |
*/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 | |
if(isset($_REQUEST['ajaxform']) && isset($_REQUEST['ajaxform']['m'])) { | |
$data = $_REQUEST['ajaxform']; | |
$message_type = $data['m']; | |
$types = array( | |
1 => array( | |
'subject' => 'Обратный звонок', | |
'to' => 'mail@mail.ru', |
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 | |
#sync directories struct | |
rsync -a --include='*/' --exclude='*' /var/backups/local/ /var/backups/selectel | |
find /var/backups/local/ -name "admin-1_full*" -mtime -7 -size -4000M > /tmp/small_files.lst | |
for i in `cat /tmp/small_files.lst`; do ln -s $i `echo $i | sed 's/local/selectel/g'`; done; | |
find /var/backups/local/ -name "admin-1_full*" -mtime -7 -size +4000M > /tmp/large_files.lst | |
for i in `cat /tmp/large_files.lst`; do split --bytes=4000m $i `echo $i | sed 's/local/selectel/g'`; 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
*.komodoproject | |
.buildpath | |
.project | |
.settings | |
sitemap*.xml | |
awstats.* | |
*.sh | |
#symlinks | |
site.ru/bitrix |
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 | |
#запускать из под root | |
iptables -A FORWARD -o eth0 -i vboxnet0 -s 192.168.56.0/24 -m conntrack --ctstate NEW -j ACCEPT | |
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
iptables -A POSTROUTING -t nat -j MASQUERADE |
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
cat *.jpg | ffmpeg -f image2pipe -r 1 -vcodec mjpeg -i - -vcodec libx264 out-`/bin/date +%Y-%m-%d`.mp4 |
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 | |
USER="backuper" #MySQL user | |
PASSWORD="password" #MySQL password | |
DBTMP="/tmp/mysqldump/" #temporary dir for mysqldump | |
EXCLUDE_FILE="exclude.txt" #exclude files and dirs | |
TARGETDIR="/var/www/ /var/data/ /var/gitrepos/ /opt/nginx/ /etc/apache2/" #dirs to backup | |
BACKUPDIR="/var/backups/local/" #backup storage | |
DAYSOLD="3" #remove old backups | |
DAYSOLD_W="7" #remove old backups weekly |
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 | |
CURRENTDATE=$(date +%Y-%m-%d) | |
rm -rf /var/backups/selectel/* | |
find /var/backups/local/ -name admin-1_full-$CURRENTDATE.tar.gz -printf "%h\n"| xargs -i{} basename {} | xargs -i{} echo {}/admin-1_full-$CURRENTDATE.tar.gz > file.lst | |
rsync -a /var/backups/local /var/backups/selectel/ --files-from=file.lst | |
rm file.lst | |
/usr/bin/lftp -f /root/selectel_backup.x |
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. sudo docker pull rhamdeew/lamp | |
2. sudo docker run -v /your_empty_project_path/:/var/www/srv/ -p 80:80 -t -i rhamdeew/lamp /bin/bash | |
3. in container: cp -R /var/www/example /var/www/srv | |
4. in container: cd /var/www/srv/ | |
5. in container: ./start.sh | |
6. open http://localhost/1.php | |
Your project structure | |
projectname/ |
OlderNewer