Skip to content

Instantly share code, notes, and snippets.

@zhiguangwang
zhiguangwang / README.md
Last active July 17, 2024 00:43
Installing and running shadowsocks on Ubuntu Server

Installing and running shadowsocks on Ubuntu Server

16.10 yakkety and above

  1. Install the the shadowsocks-libev package from apt repository.

     sudo apt update
     sudo apt install shadowsocks-libev
    
  2. Save ss.json as /etc/shadowsocks-libev/config.json.

@larryli
larryli / install-shadowsocks-local-service.sh
Last active September 7, 2020 05:57
Debian/Ubuntu systemd shadowsocks-local service
#!/bin/sh
# sudo ./install-shadowsocks-local-service.sh
cp shadowsocks-local.default /etc/default/shadowsocks-local
cp shadowsocks-local.init /etc/init.d/shadowsocks-local
chmod +x /etc/init.d/shadowsocks-local
ln -s ../init.d/shadowsocks-local /etc/rc0.d/K01shadowsocks-local
ln -s ../init.d/shadowsocks-local /etc/rc1.d/K01shadowsocks-local
ln -s ../init.d/shadowsocks-local /etc/rc2.d/K01shadowsocks-local
ln -s ../init.d/shadowsocks-local /etc/rc3.d/K01shadowsocks-local
@bingxie
bingxie / gist:a0039781a52ad908b0a2
Last active August 29, 2015 14:11
Nginx的配置
# nginx.conf
http {
client_max_body_size 20M; #上传文件的大小
}
------------------------------------------------------------------------------------
#Nginx应用配置
upstream app-name {
# 配置unicorn服务器器
server unix:/opt/app-name/tmp/sockets/unicorn.sock
@bingxie
bingxie / unicorn.rb
Last active August 29, 2015 14:11
Unicorn的配置
# unicorn通过master进程管理worker进程,这里初始化工作进程的数量,默认为3个
# 举例: AWS EC2 m3.2xlarge 设置30个worker
worker_processes Integer(ENV["UNICORN_CONCURRENCY"] || 3)
preload_app true
# 工作进程的响应超时时间(秒)
timeout 120
listen "/tmp/sockets/unicorn.sock"
pid "/tmp/pids/unicorn.pid"
if ENV['RAILS_ENV'] == 'development' # 开发环境用于测试和验证一些配置
@UnaNancyOwen
UnaNancyOwen / Boost1.55.0.md
Last active June 8, 2024 09:12
Building Boost with Visual Studio
@luw2007
luw2007 / 词性标记.md
Last active June 29, 2024 14:17
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@timgremore
timgremore / index.html.haml
Created January 3, 2012 21:13
Ember.js, document collection and polling...written in CoffeeScript
- title "#{@game.name}"
%h1= yield(:title)
#documents
= form_tag(assessment_game_documents_path(@game)) do
%ul
%script{ type: "text/x-handlebars" }
{{#collection Game.DocumentsCollectionView contentBinding="Game.documentsController"}}
%li {{content.name}}
{{/collection}}
@chrisbloom7
chrisbloom7 / README.md
Created June 6, 2011 07:16
A cheap knock off of the default validates_length_of validator, but checks the filesize of a Carrierwave attachment

Note that this validation runs both after the file is uploaded and after CarrierWave has processed the image. If your base uploader includes a filter to resize the image then the validation will be run against the resized image, not the original one that was uploaded. If this causes a problem for you, then you should avoid using a resizing filter on the base uploader and put any specific size requirements in a version instead.

So instead of this:

require 'carrierwave/processing/mini_magick'

class default_node {
package { 'apache2':
ensure => installed
}
service { 'apache2':
ensure => true,
enable => true,
require => Package['apache2'],
}
}