This file contains hidden or 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 | |
rejected_message() | |
{ | |
echo "COMMIT REJECTED! Please fix your diff.\n\ | |
If you must, run 'git commit --no-verify' to skip this check." && \ | |
exit 1 | |
} | |
#== 1. Check forbidden keywords within modified files, except commented out sections |
This file contains hidden or 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
/* | |
################################################################ | |
# Nhân quả không nợ chúng ta thứ gì, cho nên xin đừng oán giận # | |
# _ # | |
# _ooOoo_ # | |
# o8888888o # | |
# 88" . "88 # | |
# (| -_- |) # | |
# O\ = /O # |
This file contains hidden or 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
cat <<EOF >> /etc/apt/sources.list | |
deb http://archive.ubuntu.com/ubuntu precise main restricted universe | |
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe | |
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse | |
EOF | |
apt-get update | |
apt-get remove \ | |
apache2 \ |
This file contains hidden or 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
require 'base64' | |
require 'digest' | |
require 'openssl' | |
module AESCrypt | |
def AESCrypt.encrypt(password, iv, cleardata) | |
cipher = OpenSSL::Cipher.new('AES-256-CBC') | |
cipher.encrypt # set cipher to be encryption mode | |
cipher.key = password |
This file contains hidden or 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
require 'openssl' | |
require 'Base64' | |
key = "secret-key" | |
data = "some data to be signed" | |
Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha256'), key, data)).strip() |
This file contains hidden or 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 ruby | |
require "openssl" | |
require 'digest/sha2' | |
require 'base64' | |
# We use the AES 256 bit cipher-block chaining symetric encryption | |
alg = "AES-256-CBC" | |
# We want a 256 bit key symetric key based on some passphrase | |
digest = Digest::SHA256.new |
This file contains hidden or 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 | |
# Run as root | |
set -e | |
apt-get update | |
apt-get install -y build-essential | |
apt-get install -y libncurses5-dev | |
useradd mysql |
This file contains hidden or 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 | |
# This script works only on my system, edit it before apply to your system! | |
echo "\n Ghost Upgrader" | |
waiting_sign=" ⌛" | |
okay_sign=" ✓" | |
ng_sign=" ✗" | |
ghost_dir="/var/www/ghost" |
This file contains hidden or 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
Listen 8080 | |
<VirtualHost *:8080> | |
ServerAdmin webmaster@localhost | |
ServerName 192.168.xxx.xxx | |
ProxyRequests Off | |
<Proxy balancer://mycluster> | |
BalancerMember http://192.168.xxx.yyy:8080 route=lb1 | |
BalancerMember http://192.168.xxx.zzz:8080 route=lb2 | |
ProxySet lbmethod=byrequests |
This file contains hidden or 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
# initializers/devise.rb | |
config.omniauth :facebook, [APP_ID], [APP_SECRET] | |
config.omniauth :facebook_app1, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email' | |
config.omniauth :facebook_app2, [APP_ID], [APP_SECRET], :iframe => true, :scope => 'publish_stream,offline_access,email' |
NewerOlder