Skip to content

Instantly share code, notes, and snippets.

View purplefish32's full-sized avatar

Donovan Tengblad purplefish32

View GitHub Profile
@purplefish32
purplefish32 / gist:1106937
Created July 26, 2011 14:54
My .bashrc aliases
#aliases
alias e='exit'
alias ll='ls -la'
alias lh='ls -lah'
alias rg='rgrep -n --color'
alias c='clear'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
@purplefish32
purplefish32 / .gitignore_global
Created July 26, 2011 15:49
.gitignore_global
# Compiled source #
###################
*.com
*.dll
*.exe
*.o
*.so
# Packages #
############
@purplefish32
purplefish32 / ssh-tar
Created March 9, 2012 14:39
Compress and copy via SSH using TAR
#Compress and copy via SSH using SCP and TAR
tar -czf - /some/file | ssh [email protected] tar -xzf - -C /destination
#Switch -c for tar creates an archive and -f which tells tar to send the new archive to stdout.
#The second tar command uses the -C switch which changes directory on the target host. It takes the input from stdin. The -x switch extracts the archive.
#The second way of doing the transfer over a network is with the -z option, which compresses the stream, decreasing time it will take to transfer over the network.
#Some people may ask why tar is used, this is great for large file trees, as it is just streaming the data from one host to another and not having to do intense operations with file trees.
#If using the -v (verbose) switch, be sure only to include it on the second tar command, otherwise you will see double output.
#Using tar and piping can also be a great way to transfer files locally to be sure that file permissions are kept correctly
@purplefish32
purplefish32 / Synergy : setxkbmap fr
Created March 14, 2012 08:47
Switch Synergy keboard to FR
setxkbmap fr
@purplefish32
purplefish32 / Git : List non tracked files
Created March 16, 2012 17:08
Git find non tracked files
git clean -dfxn
@purplefish32
purplefish32 / generatePdfThumbnail
Created October 4, 2012 12:54
Generates a JPEG thumbnail from a PDF file
#!/bin/sh
for i in `find . -name "*.pdf"`;
do
filename=$(basename $i | sed 's/\.[^.]*$//')
$(convert $filename.pdf[0] -resize 150x203 $filename.jpeg)
done
@purplefish32
purplefish32 / Debian vagrant
Created December 27, 2012 13:48
Debian vagrant vanilla install
Vanilla install from Download small CD installer, follow instructions for base box.
Hostname: vagrant-[os-name], e.g. vagrant-debian-squeeze64
Domain: vagrantup.com
Root Password: vagrant
Main account login: vagrant
Main account password: vagrant
uncheck all software
Login in as vagrant.
@purplefish32
purplefish32 / gist:5747284
Created June 10, 2013 08:33
My gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@purplefish32
purplefish32 / gist:5918954
Created July 3, 2013 15:01
Symfony deploy script
#!/bin/bash
cd ..
git fetch origin
git checkout origin/master
cd deploy/
rm composer.phar
curl -sS https://getcomposer.org/installer | php
cd ..
php deploy/composer.phar install
@purplefish32
purplefish32 / gist:6340806
Created August 26, 2013 12:12
Install claroline
#!/bin/bash
CYAN = "\e[46m"
NORMAL = "\e[0m"
PS3 = "Installation Claroline. Cela va supprimer votre répertoire Claroline/. Êtes-vous sûr de vouloir continuer ?"
LISTE=("[y] yes" "[n] no")
select CHOIX in "${LISTE[@]}" ; do
case $REPLY in
1|y)
echo -e "$CYAN###### INSTALLATION COMPOSER $NORMAL "