This file contains 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
[H[JIgn http://cn.archive.ubuntu.com natty InRelease | |
Ign http://cn.archive.ubuntu.com natty-updates InRelease | |
Hit http://cn.archive.ubuntu.com natty Release.gpg | |
Hit http://cn.archive.ubuntu.com natty-updates Release.gpg | |
Hit http://cn.archive.ubuntu.com natty Release | |
Hit http://cn.archive.ubuntu.com natty-updates Release | |
Ign http://archive.canonical.com natty InRelease | |
Ign http://extras.ubuntu.com natty InRelease | |
Hit http://cn.archive.ubuntu.com natty/main Sources | |
Hit http://cn.archive.ubuntu.com natty/restricted Sources |
This file contains 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
# 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度 | |
# 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装 | |
# 做这个起什么作用? | |
# rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。 | |
# 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外 | |
proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m | |
inactive=24h max_size=1g; | |
server { | |
listen 80; |
This file contains 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
" The following are commented out as they cause vim to behave a lot | |
" differently from regular Vi. They are highly recommended though. | |
set showcmd " Show (partial) command in status line. | |
set showmatch " Show matching brackets. | |
set ignorecase " Do case insensitive matching | |
set smartcase " Do smart case matching | |
set incsearch " Incremental search | |
set autowrite " Automatically save before commands like :next and :make | |
set hidden " Hide buffers when they are abandoned | |
set expandtab " convert tabs to spaces |
This file contains 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/ruby | |
require 'rss' | |
# Usage | |
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/ | |
# episodes.rss | |
# OR | |
# $ ./railscasts.rb | |
p 'Downloading rss index' |
This file contains 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
SELECT * FROM `post` WHERE `status` != 'inherit' AND `status` != 'auto-draft'; | |
SELECT * FROM `post` WHERE `status` NOT IN ('inherit', 'auto-draft'); |
This file contains 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
# Path to your oh-my-zsh configuration. | |
ZSH=$HOME/.oh-my-zsh | |
# Set name of the theme to load. | |
# Look in ~/.oh-my-zsh/themes/ | |
# Optionally, if you set this to "random", it'll load a random theme each | |
# time that oh-my-zsh is loaded. | |
ZSH_THEME="robbyrussell" | |
# Example aliases |
This file contains 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
http://media.railscasts.com/assets/episodes/videos/001-caching-with-instance-variables.mp4 | |
http://media.railscasts.com/assets/episodes/videos/002-dynamic-find-by-methods.mp4 | |
http://media.railscasts.com/assets/episodes/videos/003-find-through-association.mp4 | |
http://media.railscasts.com/assets/episodes/videos/004-move-find-into-model.mp4 | |
http://media.railscasts.com/assets/episodes/videos/005-using-with-scope.mp4 | |
http://media.railscasts.com/assets/episodes/videos/006-shortcut-blocks-with-symbol-to-proc.mp4 | |
http://media.railscasts.com/assets/episodes/videos/007-all-about-layouts.mp4 | |
http://media.railscasts.com/assets/episodes/videos/008-layouts-and-content-for.mp4 | |
http://media.railscasts.com/assets/episodes/videos/009-filtering-sensitive-logs.mp4 | |
http://media.railscasts.com/assets/episodes/videos/010-refactoring-user-name-part-1.mp4 |
This file contains 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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
This file contains 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 | |
# find-out-what-is-using-your-swap.sh | |
# -- Get current swap usage for all running processes | |
# -- | |
# -- rev.0.3, 2012-09-03, Jan Smid - alignment and intendation, sorting | |
# -- rev.0.2, 2012-08-09, Mikko Rantalainen - pipe the output to "sort -nk3" to get sorted output | |
# -- rev.0.1, 2011-05-27, Erik Ljungstrom - initial version | |
SCRIPT_NAME=`basename $0`; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer