Skip to content

Instantly share code, notes, and snippets.

View alaahd's full-sized avatar

Alaa Hadad alaahd

View GitHub Profile
@alaahd
alaahd / gist:4569098
Created January 18, 2013 22:13
git Ignoring modifications to tracked files
//Ignoring modifications to tracked files
git update-index --assume-unchanged FILENAME
//undo
git update-index --no-assume-unchanged FILENAME
# The loopback interface
auto lo
iface lo inet loopback
# Configuration for eth0 and aliases
# This line ensures that the interface will be brought up during boot.
auto eth0 eth0:0
# eth0 - This is the main IP address that will be used for most outbound connections.
@alaahd
alaahd / gist:4569144
Created January 18, 2013 22:18
remove deleted files from the index
//remove deleted files from the index (unstage)
git ls-files -d | xargs git rm --cached
@alaahd
alaahd / gist:4577138
Created January 20, 2013 07:22
Rsync "optimised"
rsync -vrz --ignore-existing --size-only -e "ssh -i /Users/mark/id_rsa-readonly" readonly@1.1.1.1:/var/www/project/images/2012 /var/www/project/images/
//note the the source has no trailing slash
// target has a trailing slash
@alaahd
alaahd / gist:4581633
Created January 20, 2013 20:50
Basic Authentication
AuthType Basic
AuthName "a"
AuthUserFile "/home3/amcsycom/.htpasswds/public_html/wp-admin/passwd"
require valid-user
@alaahd
alaahd / FTP + wget
Last active December 11, 2015 09:39
Download site contents FTP + wget
wget -r ftp://username:password@ftp.hostname.com/public_html/
mysqldump --user=wikiadmin --password --host=db.mywiki.com wikidb > wikidb.sql
#Recursive
scp -r local-folder-name username@hostname:public_html/wp-content/plugins/
@alaahd
alaahd / gist:4598621
Created January 22, 2013 21:31
drupal clear image styles
Clearing cache, won't flush image styles: http://drupal.org/node/997332
You could:
delete them manually
use image_style_flush
use the command line: rm -rf sites/default/files/styles
use drush: drush image-flush
ssh -D 8080 -C -N username@example.com