Skip to content

Instantly share code, notes, and snippets.

View ba0f3's full-sized avatar
🇻🇳
#VietnamLeavesNoOneBehind

Huy Doan ba0f3

🇻🇳
#VietnamLeavesNoOneBehind
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<title>Velvet test with BOOMR</title>
</head>
<body>
<h1>Testing roundtrip time</h1>
<p>Using <a href="http://developer.yahoo.com/blogs/ydn/posts/2010/06/performance_testing_with_boomerang/">Boomerang</a> and <a href="http://www.velvetmetrics.com/">velvetmetrics</a></p>
<p id="results"></p>
<img src="http://www.velvetmetrics.com/chart?&path=random.path.3yb8s&groupBy=10min&f=avg&datapoints=true&title=true&axes=true&legends=true&customtitle=Avg%20roundtrip%20time%20/10%20mins&w=600&h=250&output=image&rand=2612" alt="loadtime history"/>
function trim(c) {
var ctx = c.getContext('2d'),
copy = document.createElement('canvas').getContext('2d'),
pixels = ctx.getImageData(0, 0, c.width, c.height),
l = pixels.data.length,
i,
bound = {
top: null,
left: null,
right: null,
sudo -i
# Make sure the prerequisites are installed.
apt-get -y install autoconf automake curl build-essential libxslt1-dev re2c libxml2-dev
# Install PHP 5 dependencies.
apt-get -y build-dep php5
# Download phpbrew
cd /usr/bin
curl -O https://raw.github.com/c9s/phpbrew/master/phpbrew
# Make phpbrew executable.
chmod +x phpbrew
@ba0f3
ba0f3 / compile-pymssql
Last active December 31, 2015 15:29
compile latest pymssql version on CentOS
yum groupinstall "Development Tools"
yum install freetds-devel.x86_64 python-devel python-pip
pip install cython
wget https://github.com/pymssql/pymssql/archive/master.zip
unzip master
cd pymssql-master/
./setup.py install
ListenAddress 0.0.0.0:22
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
SyslogFacility AUTHPRIV
LogLevel INFO
LoginGraceTime 2m
AllowUsers root
PermitRootLogin without-password
StrictModes yes
MaxAuthTries 3

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@ba0f3
ba0f3 / build-limetext-ubuntu-14.04
Last active August 29, 2015 14:04
Build Limetext on Ubuntu 14.04 64bit
wget http://golang.org/dl/go1.2.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.2.2.linux-amd64.tar.gz
mkdir -p ~/src/gospace
First, grab python3-3
echo 'yes' | sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update -qq
sudo apt-get install python3.3 python3.3-dev
@ba0f3
ba0f3 / designer.html
Created September 26, 2014 04:56
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@ba0f3
ba0f3 / gist:58db1a3642d9260f528b
Last active August 29, 2015 14:07
Compile SparkleShare-1.4 on Ubuntu 14.10
520 apt-fast install mono-complete
523 apt-fast install gtk-sharp3
536 cd ../dbus-sharp-master/
537 ./autogen.sh
538 make
539 sudo make install
540 cd ../dbus-sharp-glib-master/
541 ./autogen.sh
542 make && sudo make install
543 cd ../notify-sharp-master/