Skip to content

Instantly share code, notes, and snippets.

View siutin's full-sized avatar
🐴

martin chan siutin

🐴
View GitHub Profile
@olekenneth
olekenneth / deploy.rb
Last active October 25, 2015 21:14
Capistrano 2 deploy, forever and npm
set :application, "application name"
set :repository, "[email protected]:olekenneth/repo.git"
set :deploy_to, "/var/www/#{application}"
set :log_to, "/var/log/node"
set :use_sudo, false
set :public_children, %w{}
role :web, "do"
/**
* Get Google Page Speed Screenshot
*
* Uses Google's Page Speed API to generate a screenshot of a website.
* Returns the image as a base64 jpeg image tag
*
* Usage Example:
* echo getGooglePageSpeedScreenshot("http://ghost.org", 'class="thumbnail"');
*
*
@josephabrahams
josephabrahams / lfs-trusty-install.sh
Last active March 9, 2023 12:15
Linux From Scratch Ubuntu 14.04 Host System Requirements Install Script
#!/usr/bin/env bash
# Install missing Linux From Scratch Host System Requirements for Ubuntu 14.04
if [ ! $(whoami) == "root" ]; then
echo "Please run as root!"
exit 1
fi
# symlink sh to bash
ln -fsv /bin/bash /bin/sh
@hbin
hbin / benchmark_escape_html.rb
Last active June 11, 2018 05:10
Benchmark escape html methods
require 'benchmark/ips'
require 'open-uri'
require 'cgi'
require 'erb'
require 'rack'
puts "===== Short String =====\n\n"
Benchmark.ips do |x|
@teddevaal
teddevaal / gist:8575858
Last active March 22, 2017 09:05
Rotatelogs
Okay, spend way too much time on this one.
But however, use the following command to install rotatelogs
sudo apt-get install apache2-utils
By default the binary file is only accessible with superuser priviliges. Move the file to /usr/sbin/.
sudo mv /usr/bin/rotatelogs /usr/sbin/
Now you can gracefully start apache2 with custom logs ;)
@kevin-smets
kevin-smets / iterm2-solarized.md
Last active July 5, 2025 01:39
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@jerrypnz
jerrypnz / poll.rkt
Last active November 20, 2018 22:10
Play with Racket stateful servlet. This demo is a polling program.
#lang racket
(require web-server/http
web-server/managers/none
web-server/servlet
web-server/servlet-env)
(provide interface-version manager star-polling-app)
(define interface-version 'v2)
@robcowie
robcowie / django-uwsgi.ini
Last active March 10, 2023 20:29
Supervisord config examples
[program:uwsgi]
user=robdev
command=uwsgi --ini /path/to/config.uwsgi
autostart=false
@b1nary
b1nary / post_tor_ruby.rb
Created February 8, 2012 17:35
[Ruby] Post form data trough socks
require 'rubygems'
require 'rest-client'
# Socksify is amazing handling Proxys, also Socks like tor
# The proxy is simply aviable in the whole script
require 'socksify'
TCPSocket::socks_server = "127.0.0.1"
TCPSocket::socks_port = 9070
# Create a cookie
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000