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/sh | |
set -e | |
dir="$1" | |
if [ -z "$dir" ]; then | |
{ | |
echo 'This script is for destroying old /var/lib/docker directories more safely than' | |
echo ' "rm -rf", which can cause data loss or other serious issues.' | |
echo |
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 | |
sudo apt-get -y install wget | |
set -e; | |
if [ -z "$1" ] | |
then | |
echo "Please specify the version you want." | |
exit |
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
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
$ 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) |
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
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/* |
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
<?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"; |
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
<?php | |
if (class_exists("ZMQ") && defined("ZMQ::LIBZMQ_VER")) { | |
echo ZMQ::LIBZMQ_VER, PHP_EOL; | |
} |
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 | |
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 |
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
svnadmin dump /home/svn/repository | gzip > repobackup.svn.gz |
NewerOlder