Skip to content

Instantly share code, notes, and snippets.

View perfectfoolish's full-sized avatar
🎯
Focusing

Fulei Li perfectfoolish

🎯
Focusing
View GitHub Profile
@perfectfoolish
perfectfoolish / execOnChange.sh
Created December 1, 2012 13:02 — forked from derekwyatt/execOnChange.sh
Executes an arbitrary command when files change.
#!/bin/bash
command="$1"
shift
fileSpec="$@"
sentinel=/tmp/t.$$
touch -t197001010000 $sentinel
while :
do
#!/bin/bash
sync_dryrun()
{
echo
echo -e "\033[1m ...dryrun...\033[0m"
rsync -vr --delete ~/happycasts/episodes/ peter@linode:~/media/assets/episodes/ --dry-run
echo -e "\033[1m ...dryrun...\033[0m"
echo
}
-module(server).
-export([server/0]).
server() ->
start(hackney),
{ok, Socket} = gen_tcp:listen(0, [binary,{active, true},
{packet, http}]),
{ok, Port} = inet:port(Socket),
spawn(fun() ->

Most active GitHub users (git.io/top)

The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Sun, 18 Mar 2012 19:23:53 GMT till Mon, 18 Mar 2013 19:23:53 GMT.

Only first 1000 GitHub users according to the count of followers are taken. Sorting algo in pseudocode:

githubUsers
  .filter((user) -> user.followers > 165)
 .sortBy('contributions')
#!/bin/sh
ssh -t haoqicat.com "
. .profile
cd /home/peter/apps/onestep/
git pull
bundle
rake db:migrate RAILS_ENV=production
rake assets:precompile
sudo apachectl graceful
#################################
#
# 本清单基于 ubuntu 12.04,
# 下个 ubuntu 的 LTS
# 发出来后,会相应更新这里的内容。我的目标是按步执行可以零错误完成安装。
# 注意,本文件只是一个清单,不是一个可以安全执行的脚本
#
#################################
# create a linode,login as root, and create a common user for all the tasks
#!/usr/bin/env bash
ssh -t [email protected] '
source ~/.bash_login && cd ~/happycasts && \
git pull && \
bundle exec rake db:migrate RAILS_ENV=production; \
bundle && bundle exec rake assets:precompile &&\
touch tmp/restart.txt
'
#!/usr/bin/env bash
ssh -t [email protected] '
source ~/.bash_login && cd ~/happycasts && \
git pull && \
bundle exec rake db:migrate RAILS_ENV=production; \
bundle && bundle exec rake assets:precompile &&\
touch tmp/restart.txt
'
#!/user/bin/env bash
on_die() {
echo
echo byebye proxy
echo
networksetup -setsocksfirewallproxystate "Ethernet 2" off #close the proxy
# the name can be "wifi" or "Ethernet 1", just see what is listed in "network preference"
}
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;