Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tdebarochez's full-sized avatar
🏠
Working from home

Thomas de Barochez tdebarochez

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tdebarochez on github.
  • I am tdebarochez (https://keybase.io/tdebarochez) on keybase.
  • I have a public key ASB3MmtG7Rd2SjAu7nRTP13jqf2oSzQcJDoVorBs3DPJzgo

To claim this, I am signing this object:

#!/usr/bin/env bash
mv /usr/lib/libcurl.4.dylib{,.original}
ln -s /usr/local/opt/curl/lib/libcurl.4.dylib /usr/lib/libcurl.4.dylib
apachectl -k $1
rm /usr/lib/libcurl.4.dylib
mv /usr/lib/libcurl.4.dylib{.original,}
### Keybase proof
I hereby claim:
* I am tdebarochez on github.
* I am tdebarochez (https://keybase.io/tdebarochez) on keybase.
* I have a public key whose fingerprint is D386 10F8 C406 4E63 4C23 0D87 5FBC 5EAA F36E D05C
To claim this, I am signing this object:
#!/bin/sh
[ -d static ] && rm -rf static
mkdir static
cp -R public/* static/
compass compile -e production > /dev/null
coffee -o static/javascripts/ -c app/assets/javascripts/*.coffee
for file in `ls static/javascripts/*.js`
do
java -jar /opt/yuicompressor-2.4.8.jar --type js -o $file $file
server {
listen 80;
server_name my.domaine.name;
location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
expires max;
add_header Pragma public;
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
root /home/myuser/app;
rewrite ^/assets/(.*)$ /static/$1 last;
@tdebarochez
tdebarochez / play.daemon.sh
Last active December 20, 2015 05:59
start/stop daemon for play application
#!/bin/bash
# chkconfig: 345 20 80
# description: Play start/shutdown script
# processname: play
#
# Instalation:
# copy file to /etc/init.d
# chmod +x /etc/init.d/play
# chkconfig --add /etc/init.d/play
# chkconfig play on
@tdebarochez
tdebarochez / view-source.js
Last active December 19, 2015 12:29
Load your current web page source code in an ACE code editor. Bookmark it, now !
// Inspired by work from https://gist.github.com/jdkanani/4670615
javascript:var xmlHttp = new window.XMLHttpRequest(); xmlHttp.open( "GET", document.location.href, false ); xmlHttp.send( null ); var innerHTML=xmlHttp.responseText;document.location.href='data:text/html,<link rel="shortcut icon" href="http://g.etfv.co/http://www.sublimetext.com"/> <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");e.setValue(\''+escape(innerHTML.replace(/'/g, "\\'").replace(/(\r\n|\r|\n)/g, "'$1+'\\n").replace(/script/g, "scri'+'pt"))+'\');</script>';
// URL encoded for Firefox :
javascript:var%20xmlHttp%20=%20new%20window.XMLHttpRequest();%20xmlHttp.open(%20"GET",%20document.location.href,%20false%20);%20xmlHttp.send(%20null%20)
@tdebarochez
tdebarochez / update_map.sh
Created April 16, 2011 08:36
I use this script to automatically update my rendered Minecraft map with pigmap
#!/bin/bash
if [ -f pigmap/output/pigmap.params ]
then
find world/region/ -newer pigmap/output/pigmap.params > changes.txt
date >> error_log && ./pigmap/pigmap -i world/ -o pigmap/output/ -g pigmap/images -r changes.txt -h 3 >> error_log && date >> error_log
else
date >> error_log && ./pigmap/pigmap -B 6 -T 1 -Z 10 -i world/ -o pigmap/output/ -g pigmap/images -r changes.txt -h 3 >> error_log && date >> error_log
fi
@tdebarochez
tdebarochez / transmission
Created January 28, 2011 08:27
This shell script takes care of starting and stopping transmission daemon on Openfiler distro
#!/bin/sh
#
# Created 2011-01-18 by tdebarochez
#
# transmission This shell script takes care of starting and stopping
# transmission daemon.
#
# chkconfig: - 90 10
# description: transmission is a daemon for a bittorent client
# processname: transmission
@tdebarochez
tdebarochez / ftp-upload.sh
Created January 28, 2011 08:20
Upload to ftp server any new file in a folder. When is done, send a mail and/or an IM. Requirements are lftp, nail et sendxmpp (for IM sending)
#!/bin/sh
HOST="ftp.example.com"
USER="username"
PASSWD="pass"
DISTANT_PATH="/distant/path/"
LOCAL_PATH="/local/path/"
ERROR_LOG="/var/log/ftp-uploads/err.log"
INFOS_LOG="/var/log/ftp-uploads/infos.log"
INCLUDE_FILES="\.(txt|odt|png)$"
EXCLUDE_FILES="sample|\.part$"