This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get id, name and ip adresses of all active docker container | |
function do_get_ip_address() { | |
paste <(sudo docker ps | tail -n +2 | awk {'printf "%s\t%s\n", $1, $2 '}) <(sudo docker ps -q | xargs sudo docker inspect | tail -n +2 | grep \"IPAddress\" | awk '{ print $2 }' | tr -d ',"') | |
} | |
# stop and remove a container based on his id | |
function do_stop_rm_container() { | |
[ -z "$1" ] && echo "Give me a container ID" && return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name mautic.somedomain.com; | |
root /usr/share/nginx/mautic; | |
index index.php; | |
access_log /var/log/nginx/mautic.access.log; | |
error_log /var/log/nginx/mautic.error.log; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install useful tool | |
sudo apt-get install links chromium-browser chromium-browser-l10n geany geany-plugins curl screen | |
# Setup LEMP | |
→ https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-ubuntu-12-04 | |
## setup mysql | |
sudo /usr/bin/mysql_secure_installation | |
sudo apt-get install php5-fpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# add vhost reverse proxy for new docker instance for nginx and restart nginx | |
# use like this : do_nginx_proxy_vhost subdir.example.com http://192.168.0.20:8080 | |
function do_nginx_proxy_vhost() { | |
[ -z $1 -o -z $2 ] && echo "Give host and address" && return | |
host=$1 | |
address=$2 | |
[ -f /etc/nginx/sites-available/proxy_reverse_$host ] && (echo "Updating proxy for host: $host" && sudo rm /etc/nginx/sites-enabled/proxy_reverse_$host) || echo "Creating proxy for host: $host" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name __project_hosts__; | |
root __project_path__; | |
index index.php; | |
access_log /var/log/nginx/__project_name___project_dev.access.log; | |
error_log /var/log/nginx/__project_name___project_dev.error.log; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Converts an image in a multi-resolution favicon | |
# Requires Imagemagick | |
function generate_favicon() { | |
command -v convert >/dev/null 2>&1 || (echo "Imagemagick not here, install it" && return ) | |
case "$#" in | |
"0") | |
echo "Usage: $FUNCNAME input.png output.ico" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PS1='${debian_chroot:+($debian_chroot)}\u@www-nginx:\w\$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TMPDIR=$( mktemp -d 2>/dev/null ) | |
cd $TMPDIR | |
VERSION=5.3.29 #latest php released stable version in 5.3.X | |
wget http://in1.php.net/distributions/php-$VERSION.tar.bz2 | |
tar xvf php-$VERSION.tar.bz2 | |
cd php-$VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update && apt-get upgrade | |
sudo apt-get install libdate-manip-perl libterm-readkey-perl libterm-readkey-perl libdigest-hmac-perl libdigest-hmac-perl libdate-manip-perl libmail-imapclient-perl makepasswd rcs perl-doc git | |
cd /tmp | |
git clone git://github.com/imapsync/imapsync.git | |
cd imapsync | |
sh examples/install_modules_linux.sh | |
apt-get install build-essential | |
sh examples/install_modules_linux.sh |
NewerOlder