Skip to content

Instantly share code, notes, and snippets.

View sergey-fritzler's full-sized avatar

Sergey Fritzler sergey-fritzler

  • Düsseldorf
  • 03:24 (UTC +01:00)
View GitHub Profile
@danmilleruk
danmilleruk / backup_web.sh
Created March 10, 2013 12:24
Best path for this being /scripts/backups/backup_web.sh
#!/bin/sh
# Web backup script
# by Dan Miller
# http://www.danmiller.co.uk
### Begin Configuration ###
EMAIL="you@email.com" # Email address to send the backup report to. (sendmail must be installed)
WEBPATH="/data/www" # No trailing slash
@kparrish
kparrish / remote_backup.sh
Created October 22, 2013 18:26
Remote Backup
#!/bin/bash
# rsync backup, see www.linux.com/learn/tutorials/284789-writing-a-simple-bash-script-
SOURCEDIR1=/home/user
DESTDIR1=user@hostname:/path/to/folder
rsync -az --progress --exclude='*.bak' --rsh 'ssh ' $SOURCEDIR1 $DESTDIR1
@matthewpizza
matthewpizza / expandmactarfileinubuntu.sh
Created December 3, 2013 15:14
Problem: When I make a gzipped tar file in OS X and expand it in Ubuntu there are duplicates of every file with `._` prepended to the file name. Solution: Skip those stupid `._` files
tar -xzpvf mytarfile.tgz --exclude="._*"
@sergejmueller
sergejmueller / .htaccess
Last active June 16, 2016 08:34
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Apache
<FilesMatch "\.(txt|log|xml|css|js)$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
@IGGY-MODEL
IGGY-MODEL / WordPress
Created April 15, 2015 19:32
WordPress
//////// WordPress Get Custom Field
<?php echo get_post_meta($post->ID, 'year', true); ?>
/////// WordPress query_posts
<?php if ( have_posts() ) : query_posts('p=1');
while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php the_post_thumbnail(array(100, 100)); ?>
@holin
holin / backup-site-database.sh
Created December 23, 2015 02:48
backup site
#!/bin/sh
RANDNUMBER=`shuf -i1-10000 -n1`
# echo "RANDNUMBER $RANDNUMBER"
cd /mnt/bak
# backup files
echo "backup files..."
cp -r /www/web/brch/public_html /root/bak/public_html_`date +"%Y-%m-%d"`_$RANDNUMBER
@nacholibre
nacholibre / backup.sh
Last active June 27, 2016 09:05
Shell script for server backup (sites and mysql databases) with i/o throttling.
#!/bin/bash
CURRENT_DATE=$(date +'%Y-%m-%d')
MYSQL_USER="mysql_user"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="mysql_user_pass"
MYSQLDUMP=/usr/bin/mysqldump
BACKUP_DIR=/DATA/backup/$CURRENT_DATE
SITES_DIR=/www
@sergejmueller
sergejmueller / .htaccess
Created June 14, 2016 19:18
WordPress Security: Prevent browser and search engines to request LOG (WP debug) and TXT (plugins readme) files in Apache
# To be placed in
# /wp-content/.htaccess
<FilesMatch "\.(log|txt)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<div class="map-iframe-container">
<h3>First Map</h3>
<iframe class="map-iframe"
frameborder="0" style="border:0; width: 100%; height: 100%"
src="https://www.google.com/maps/embed/v1/place?key=%GOOGLE_API_KEY%&q=%LOCATION%" allowfullscreen>
</iframe>
</div>
<div class="map-iframe-container">
<h3>Second Map</h3>
@overstrides
overstrides / Отключение преобразования телефонных номеров в ссылки Как отключить преобразование телефонных номеров в ссылки в мобильных браузерах
Для Safari (iPhone / IPod / IPad) и Android браузера
<meta name="format-detection" content="telephone=no">