Skip to content

Instantly share code, notes, and snippets.

@peterrehm
Forked from aarongustafson/gist:9600892
Created August 27, 2014 19:22
Show Gist options
  • Save peterrehm/6ed3368d5e3e8a490865 to your computer and use it in GitHub Desktop.
Save peterrehm/6ed3368d5e3e8a490865 to your computer and use it in GitHub Desktop.
# Laravel
php -dmemory_limit=1G /usr/local/bin/composer install
php -dmemory_limit=1G /usr/local/bin/composer update
php -dmemory_limit=1G /usr/local/bin/composer require SOMETHING
php artisan package:install lucadegasperi/oauth2-server-laravel
# Git - Remove a folder without deleting locally
git rm -r --cached folder_name
# heroku
heroku run …
heroku run /app/php/bin/php /app/www/artisan migrate
# OS X SVN bug & locked files
sudo chflags -R nouchg .
# backup Flickr
backupflickr
# compress JS with YUI Compressor
java -jar '/Applications/yuicompressor.jar' --type js input.js -o output.js
# Convert TTF to EOT
ttf2eot < input.ttf > output.eot
# Convert TTF to SVG
java -jar /Applications/batik/batik-ttf2svg.jar ./MuseoSans-500.ttf -o museo.svg -id museo
# compress PNGs
for s in *.png;do pngout -c3 -b0 -v "$s" tmp.png && mv -f tmp.png "$s";done
# search files for strings
find /var/www -type f -name ”*.php” -exec grep -il ”@eval(urldecode(” {} \;
# recovering screen sharing
ps auxwww|grep loginwindow
sudo kill -9 THEPROCESSID
# untar
tar -xvzf filename.tar.gz
# find large files
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
# adding new ssh
cd ~/bin && ln 'which ssh' nickname
alias nickname = ~/bin/nickname youserveraddress.com
# email management
cd /etc/mail
cp virtusertable virtusertable.2008-04-13
vi virtusertable
makemap hash virtusertable < virtusertable
# update Django
cd ~/Source/django/
git svn rebase
git gc
cd 1.0.X
sudo python setup.py clean
sudo python setup.py build
sudo python setup.py install
# sync directories
echo "yes" | cp -Ru ::source:: ::destination::
(TAP staging: syncimages as root)
# mysql user adding
GRANT ALL ON database.* TO 'username'@'localhost' IDENTIFIED BY 'password';
# Transfer cake to a production environment
index.php?url=/pages/build/
# imagemagick delegate libraries
ftp.imagemagick.org/pub/ImageMagick/delegates/
# fixing postfix
service postfix start
# setting up a site link
ln -s '/Users/aaron/Clients/Unidine/Projects/unidine.com/trunk/' '/Users/aaron/Sites/unidine.com'
# restarting MAMP MySQL
1) Quit MAMP
2) Open the terminal and type: killall -9 mysqld
3) Restart MAMP
# flushing DNS cache
dscacheutil -flushcache
# corrupted inbox cure
mv MAILBOX_FILE MAILBOX_FILE.old
touch MAILBOX_FILE
# check your email
cat MAILBOX_FILE.old >> MAILBOX_FILE
# merge trunk to branch (from inside the branch)
# XXX = starting revision
# YYY = ending revision
# --dry-run param optional
svn merge -r XXX:YYY url://of/the/trunk .
# smush
smusher /apps/x/public/images/*.png
# git svn creation
git svn init REPO
# reset (unadd)
git reset HEAD .
# subtree merge
git remote add -f Bproject /path/to/B (1)
git merge -s ours --no-commit Bproject/master (2)
git read-tree --prefix=dir-B/ -u Bproject/master (3)
git commit -m "Merge B project as our subdirectory" (4)
git pull -s subtree Bproject master (or gitsm Bproject master)
# remove .svn folders
find . -regex '.*.svn' -exec rm -rf "{}" \;
# migrate SVN to Git
# create users.txt on Desktop:
jmaddox = Jon Maddox <[email protected]>
bigpappa = Brian Biggs <[email protected]>
# then…
mkdir my_blog_tmp
cd my_blog_tmp
git-svn init http://code.yoursite.net/my_blog/trunk/ --no-metadata
git config svn.authorsfile ~/Desktop/users.txt
git-svn fetch
# wait…
git log
# make sure users are mapped, then clone
git clone my_blog_tmp my_blog
# add submodule to git
git submodule add git://github.com/jeresig/sizzle.git vendors/sizzle
# remove submodule
git rm --cached vendors/sizzle
# update a submodule (in the submodule directory)
git fetch
git merge origin/master
then commit the parent project
# checking memory usage
top
# resolving an SSL conflict on (mt)
cp /etc/httpd/conf.d/ssl.conf /etc/httpd/conf.d/ssl.conf.bak-2010-05-11 && vi +/VirtualHost +\:\.\,\$\ s\/\^\/\#\/g +\:x /etc/httpd/conf.d/ssl.conf && service httpd restart
# saving a page & all assets to a folder
wget --mirror http://domain.tld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment