Skip to content

Instantly share code, notes, and snippets.

View qianjigui's full-sized avatar
🎯
Focusing

WPC qianjigui

🎯
Focusing
View GitHub Profile
@qianjigui
qianjigui / ruby_chinese_to_unicode8_java_format.rb
Created May 7, 2015 07:26
ruby_chinese_to_unicode8_java_format
#!/usr/bin/env ruby
#encoding: utf-8
#
'你好'.unpack('U*').each do |i|
print "\\u%s" % [i.to_s(16)]
end
puts ''
@qianjigui
qianjigui / aws-vpn-shell.sh
Created December 5, 2020 14:54
aws-vpn-shell
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN server
# on a Ubuntu or Debian instance. Tested with Ubuntu 14.04 & 12.04 and Debian 8.
# With minor modifications, this script *can also be used* on dedicated servers
# or any KVM- or XEN-based Virtual Private Server (VPS) from other providers.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#