Skip to content

Instantly share code, notes, and snippets.

View mk-qi's full-sized avatar
💭
I may be slow to respond.

mkqi mk-qi

💭
I may be slow to respond.
View GitHub Profile
@mk-qi
mk-qi / gist:1427194
Created December 3, 2011 14:01 — forked from andymboyle/gist:947608
Varnish default.vcl file
# This is a basic VCL configuration file for varnish. See the vcl(7)
# man page for details on VCL syntax and semantics.
#
# Default backend definition. Set this to point to your content
# server.
#
backend default {
.host = "50.16.96.248";
.port = "8000";
}
# Pre-reqs
sudo apt-get -y install libc6-dev libssl-dev libmysql++-dev libsqlite3-dev make build-essential libssl-dev libreadline5-dev zlib1g-dev
# Install ruby 1.9.2 -p290
sudo mkdir /usr/local/src
cd /usr/local/src
sudo curl -O ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz
sudo tar xzvf ruby-1.9.2-p290.tar.gz
cd ruby-1.9.2-p290
sudo ./configure --prefix=/usr/local
@mk-qi
mk-qi / dabblet.html
Created February 17, 2012 03:20
Untitled
<!-- content to be placed inside <body>…</body> -->
@mk-qi
mk-qi / gist:1867530
Created February 20, 2012 03:13
TextMate 2 .tm_properties

This is all based on the [alpha release][1].

Properties

From the built-in help system:

For many settings TextMate will look for a .tm_properties file in the current folder and in any parent folders (up to the user’s home folder).

These are simple setting = value listings where the value is a format string in which other variables can be referenced.

@mk-qi
mk-qi / gist:2156656
Created March 22, 2012 06:32 — forked from actsasflinn/gist:75212
ruby-tokyotyrant c client benchmark
=begin
Tokyo::Tyrant (Ruby FFI)
user system total real
inserting data 0.140000 0.180000 0.320000 ( 1.208150)
reading data 0.240000 0.170000 0.410000 ( 1.467640)
TokyoTyrant::RDB (Ruby)
user system total real
inserting data 0.300000 0.170000 0.470000 ( 1.481900)
@mk-qi
mk-qi / learn_ruby_by_example.rb
Created March 25, 2012 06:33 — forked from guillermo/learn_ruby_by_example.rb
learn ruby with multi process
#!/usr/bin/env ruby
#
# This fork add support for running code in a forked process
#
# encoding: UTF-8
#
# LearnRubyByExample:
#
# Ruby is a highly expressive programming language.
# Testing software is an expressive way to communicate how it works.
@mk-qi
mk-qi / hack.sh
Created April 1, 2012 02:52 — forked from igrigorik/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@mk-qi
mk-qi / gist:2469119
Created April 23, 2012 06:25
centos5-x86_64bits-Kickstart.cfg
# Kickstart file automatically generated by anaconda.
install
url --url http://10.10.1.200/centos/
keyboard us
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 zh_CN.UTF-8
network --device=eth0 --bootproto=dhcp --onboot=on
text
skipx
@mk-qi
mk-qi / save_chrome_url.rb
Created May 10, 2012 09:41 — forked from pdxmph/save_chrome_url.rb
Add a URL from Chrome to Safari's reading list
#!/usr/bin/env ruby -wKU
require "rubygems"
require "appscript"
include Appscript
chrome = app("Google Chrome")
safari = app("Safari")
chrome_tab = chrome.windows[1].active_tab
@mk-qi
mk-qi / kscentos6_64bits.cfg
Created May 10, 2012 10:00
Kickstart file for centos6 64bits
# Kickstart file automatically generated by anaconda.
install
url --url http://192.168.200.10/centos/
lang en_US.UTF-8
keyboard us
skipx
network --device eth0 --bootproto dhcp
rootpw --iscrypted $1$mPtrz4gJ$bNrGUu91/qhiuU4LZQlYv1