Skip to content

Instantly share code, notes, and snippets.

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

Achilleas Pipinellis axilleas

🏠
Working from home
View GitHub Profile
@axilleas
axilleas / jail.pl
Created December 7, 2013 19:26 — forked from wilbowma/jail.pl
#a/usr/bin/perl
# This script was hastily cobbled together for my own use. It can
# probably break your system. Use at your own risk.
$JAIL = "/srv/http";
$USER = "http";
$GROUP = "http";
$WWW_DIR = "www";
sub run{
@axilleas
axilleas / jail.pl
Created February 2, 2013 17:48 — forked from wilbowma/jail.pl
#a/usr/bin/perl
# This script was hastily cobbled together for my own use. It can
# probably break your system. Use at your own risk.
$JAIL = "/srv/http";
$USER = "http";
$GROUP = "http";
$WWW_DIR = "www";
sub run{
--- _django.org 2012-06-16 23:48:07.256319726 +0900
+++ .compfunc/_django 2012-06-16 23:55:32.556331127 +0900
@@ -31,7 +31,6 @@
"cleanup:remove old data from the database"
"compilemessages:compile .po files to .mo for use with gettext"
"createcachetable:creates table for SQL cache backend"
- "createsuperuser:create a superuser"
"dbshell:run command-line client for the current database"
"diffsettings:display differences between the current settings and Django defaults"
"dumpdata:output contents of database as a fixture"
@axilleas
axilleas / gist:3115671
Created July 15, 2012 07:23
Adding magnet protocol association to Firefox
In about:config add the following:
network.protocol-handler.expose.magnet
Set it's initial value to false. When you open a magnet link you will be prompted with a Launch Application dialogue. From there simply select your chosen torrent client. This technique can also be used with other protocols.
@axilleas
axilleas / gitlab.sh
Created June 17, 2012 10:13 — forked from cristianrasch/gitlab.sh
Install Gitlab on Debian Squeeze/Wheezy
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1
aptitude install -y mysql-server libmysqlclient-dev
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
adduser --disabled-login --gecos 'gitlab system' gitlab
usermod -a -G git gitlab
su - gitlab
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa
aptitude install gitolite
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub
su - git
user www-data;
worker_processes 4; # number of cores on machine
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
http {

Vagrant & NFS for systemd users

Create group vagrant and add your user to the vagrant group:

groupadd vagrant
usermod -aG vagrant user

Drop these lines in a new file /etc/sudoers.d/vagrant

echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/v0.10.37/node-v0.10.37-linux-x86.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.com/install.sh | sh
BEFORE:
sam@ubuntu discourse % rm -fr tmp/cache
sam@ubuntu discourse % rm -fr public/assets
sam@ubuntu discourse % time RAILS_ENV=production bin/rake assets:precompile
58.55s user 1.79s system 100% cpu 1:00.02 total
AFTER:
#!/usr/bin/php -qC
<?php
/******************************************************************************
*
* @file gitolab.php
* @author Benoit Zohar
* @link http://benoitzohar.fr/
* @last-edited 2015-01-09
* @description Migrate projects from Gitolite to GitLab