Skip to content

Instantly share code, notes, and snippets.

View bydmm's full-sized avatar
🦆
Gu Gu Gu

ChengKa bydmm

🦆
Gu Gu Gu
View GitHub Profile
@bydmm
bydmm / install_rails_on_ec2.md
Last active August 29, 2015 14:12
Install Rails with passenger4 on EC2 UBUNTU 14.04 TLS

首先设置语言

cd /usr/share/locales
sudo ./install-language-pack zh_CN

安装RUBY必要的环境依赖

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libpq-dev imagemagick libmagickwand-dev
@bydmm
bydmm / gist:8678134e69e4b80cc3de
Last active August 29, 2015 14:13
Shadowsocks + cow + Nginx 实现中小企业翻墙.md
@bydmm
bydmm / gist:4fd60abe8a5720c845ef
Created February 4, 2015 10:19
Video JS, RTMP and &

较老的RTMP的播放器都是把RTMP服务器和视频的地址作为两个属性分别赋值,但是VideoJS感觉这样过于冗余,于是设定了一个规则就是用&符号把两个属性连接起来。

rtmp://xxx.cloudfront.net/cfx/st/&mp4:abc/bcd.mp4
@bydmm
bydmm / gist:a55569b6f1750b3a3a83
Created February 17, 2015 09:11
Log.io service
https://github.com/NarrativeScience/Log.io/wiki/Daemonizing-log.io-on-Ubuntu-using-upstart-(v0.3.x)
@bydmm
bydmm / gist:bf1cbb8007e2248ba103
Last active August 29, 2015 14:16
Elasticsearch
sudo locale-gen zh_CN.UTF-8
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
cd /tmp
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.7.deb
sudo dpkg -i elasticsearch-1.3.7.deb
sudo update-rc.d elasticsearch defaults 95 10
cd /usr/share/elasticsearch/
sudo bin/plugin -install elasticsearch/elasticsearch-cloud-aws/2.3.0
@bydmm
bydmm / gist:9f5af4a0625bd97ae407
Last active August 29, 2015 14:16
Install log.io
sudo apt-get install nodejs-legacy
sudo apt-get install npm
sudo npm install -g log.io --user "ubuntu"
sudo vim ~/.log.io/harvester.conf
@bydmm
bydmm / gist:015f736ea626eb6a5ae3
Last active August 29, 2015 14:17
Authentication with nginx auth_basic
sudo apt-get install apache2-utils
sudo htpasswd -c /home/ubuntu/user.pwd username
sudo vim /etc/nginx/sites-available/logio
var request = require('request');
var j = request.jar();
var cookie = request.cookie('cs=Robot/"%"3FEOQGVVASONNSNSYFZIBVFYRLROMNOOEXCJRFVIPI; TQQSMQHGYNRQSDTXJELM=XUDADZWMWFFQHNKGNWAQIMPDAYRIILZJQTPCLAOV');
var url = 'http://www.apple-vese.com/Save3.asp';
j.setCookie(cookie, url, function(error, cookie) {});

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@bydmm
bydmm / gist:fdec21ea9ead3257aae4783204bbd863
Last active September 21, 2016 08:35
排查Ubuntu硬盘文件大小的一些工具
简单的查看硬盘占用
```bash
df -h
```
有界面的查询每个文件夹的大小
```bash
sudo apt-get install ncdu
ncdu
```