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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. |
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
import pika | |
# create a connection for rabbitmq using localhost | |
connection = pika.BlockingConnection(pika.ConnectionParameters( | |
'localhost')) | |
channel = connection.channel() # create a channel | |
# declare an exchange | |
channel.exchange_declare(exchange='messages', type='direct') |
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
import pika | |
connection = pika.BlockingConnection(pika.ConnectionParameters( | |
'localhost')) | |
channel = connection.channel() | |
channel.exchange_declare(exchange='messages', type='direct') | |
routings = ['info', 'warning', 'error'] | |
# declare a queue to receive messages from exchange |
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
[mysqld] | |
bind-address=0.0.0.0 | |
console=1 | |
general_log=1 | |
general_log_file=/dev/stdout | |
log_error=/dev/stderr | |
collation-server=utf8_unicode_ci | |
character-set-server=utf8 |
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 -x | |
#apt-get update | |
#apt-get install -y unzip xz-utils curl bc git build-essential cpio gcc-multilib libc6-i386 libc6-dev-i386 kmod squashfs-tools genisoimage xorriso syslinux automake pkg-config | |
mkdir -p /workspace | |
export KERNEL_VERSION=3.15.3 | |
export AUFS_BRANCH=aufs3.15 |
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
$ history | awk '{CMD[$2]++;count++;} END { for (a in CMD )print CMD[a] " " CMD[a]/count*100 "% " a }' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n10 | |
1 988 18.2692% ls | |
2 962 17.7885% docker | |
3 869 16.0688% git | |
4 588 10.8728% cd | |
5 151 2.79216% cat | |
6 150 2.77367% ssh | |
7 131 2.42234% subl | |
8 89 1.64571% vim | |
9 78 1.44231% rm |
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
lxie:test3 git:(master*) $ grunt build | |
Running "clean:dist" (clean) task | |
Cleaning .tmp...OK | |
Cleaning dist/index.html...OK | |
Cleaning dist/scripts...OK | |
Cleaning dist/styles...OK | |
Running "jade:dist" (jade) task | |
>> 1 file created. |
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
#!/usr/bin/env python3 | |
import re | |
import math | |
class CalculationException(Exception): | |
pass | |
class Calculation: |
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
task :default => :test | |
task :test do | |
sh 'rspec calc_spec.rb' | |
end |
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
NUM = { | |
'1': 'one', | |
'2': 'two', | |
'3': 'three', | |
'4': 'four', | |
'5': 'five', | |
'6': 'six', | |
'7': 'seven', | |
'8': 'eight', | |
'9': 'nine', |
OlderNewer