Skip to content

Instantly share code, notes, and snippets.

@juliendsv
juliendsv / gist:3314586
Created August 10, 2012 14:22
Remove the warning on Ubuntu 12.04 with ruby 1.9.3 : "It seems your ruby installation is missing psych"
sudo apt-get install libyaml-dev
sudo gem install psych
@juliendsv
juliendsv / gist:3727194
Created September 15, 2012 10:03
Fresh ubuntu 12.04 rvm rails rails-api
sudo apt-get install git-core curl nodejs
curl -L get.rvm.io | sudo bash -s stable
source /etc/profile.d/rvm.sh
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
sudo rvm install 1.9.3
rvm use 1.9.3 --default
sudo gem install rails-api
@juliendsv
juliendsv / gist:3728080
Created September 15, 2012 14:01
SVN Backup
svnadmin dump /home/svn/repository | gzip > repobackup.svn.gz
@juliendsv
juliendsv / gist:3737284
Created September 17, 2012 13:32
Speedup mysql by using RAMDISK
#!/bin/bash
sudo mkdir /db/tmpfs
sudo mount -osize=256m tmpfs /db/tmpfs -t tmpfs
sudo chmod 777 /db/tmpfs
# IMPORTANT edit your /etc/apparmor.d/usr.sbin.mysqld
# to match your new path
# so /var/lib/mysql -> /db/tmpfs/mysql/ (there must be 2 links)
# Then restart apparmor /etc/init.d/apparmor restart
@juliendsv
juliendsv / zmq version for php
Created December 12, 2012 14:42
Check if zeromq is installed and tell you the version
<?php
if (class_exists("ZMQ") && defined("ZMQ::LIBZMQ_VER")) {
echo ZMQ::LIBZMQ_VER, PHP_EOL;
}
@juliendsv
juliendsv / utc-to-local
Created May 29, 2013 14:23
PHP Convert UTC to Local time
<?php
$timezone = 'Europe/Madrid';
$date_utc = '2013-05-17 21:54:26.0 UTC';
date_default_timezone_set($timezone);
$time = strtotime($date_utc);
echo $date_utc . "\n";
@juliendsv
juliendsv / gist:5923770
Created July 3, 2013 23:31
Install cassandra on ubuntu 13.10
echo 'deb http://debian.datastax.com/community stable main' > /etc/apt/sources.list.d/cassandra.sources.list
echo deb http://some.debian.mirror/debian/ raring main contrib non-free >> /etc/apt/sources.list
curl -L http://debian.datastax.com/debian/repo_key | sudo apt-key add -
apt-get update
apt-get install dsc12
service cassandra stop
rm -rf /var/lib/cassandra/data/system/*
@juliendsv
juliendsv / contribute.sh
Created May 12, 2014 08:35
urllib in Go
$ go get github.com/kytrinyx/norwegish #for ex
$ git remote -v
origin https://github.com/kytrinyx/norwegish (fetch)
origin https://github.com/kytrinyx/norwegish (push)
# add your fork
$ git remote add fork git@github.com:you/norwegish.git
$ git remote -v
fork git@github.com:you/norwegish.git (fetch)
fork git@github.com:you/norwegish.git (push)
@juliendsv
juliendsv / 0_reuse_code.js
Created July 21, 2014 10:33
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@juliendsv
juliendsv / proxy.go
Last active August 29, 2015 14:06 — forked from vmihailenco/proxy.go
package main
import (
"bytes"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"net"