Skip to content

Instantly share code, notes, and snippets.

View kj54321's full-sized avatar
🤠

Donny Jie kj54321

🤠
View GitHub Profile
@kj54321
kj54321 / ovpn_easyrsa_pki.md
Created January 21, 2017 12:13 — forked from epcim/ovpn_easyrsa_pki.md
openvpn easy-rsa certs (+revoke)
@kj54321
kj54321 / copy_remotely
Created January 9, 2017 13:38 — forked from aseigneurin/copy_remotely
Ansible module to copy a file if the MD5 sum of the target is different
#!/usr/bin/python
DOCUMENTATION = '''
---
module: copy_remotely
short_description: Copies a file from the remote server to the remote server.
description:
- Copies a file but, unlike the M(file) module, the copy is performed on the
remote server.
The copy is only performed if the source and destination files are different
(different MD5 sums) or if the destination file does not exist.
@kj54321
kj54321 / nginx.conf
Created December 6, 2016 13:21 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
{
"kind": "Template",
"apiVersion": "v1",
"metadata": {
"name": "a-quickstart-keyvalue-application",
"creationTimestamp": null,
"annotations": {
"description": "This is an example of a Ruby and MySQL application on OpenShift 3",
"iconClass": "icon-ruby",
"tags": "instant-app,ruby,mysql"
@kj54321
kj54321 / osev3-common-cli.md
Created October 7, 2016 11:39 — forked from rafaeltuelho/openshift-cheatsheet.md
OpenShift v3 common/useful CLI commands
  • to pull an image directly from red hat offcial docker registry
docker pull registry.access.redhat.com/jboss-eap-6/eap64-openshift
  • to get ther current user Barear Auth Token
oc whoami -t
@kj54321
kj54321 / openvpn
Created September 21, 2016 01:50 — forked from GavinFoo/openvpn
OpenVPN
======= 参考教程 =======
http://docs.ucloud.cn/software/vpn/OpenVPN4CentOS.html
http://nmshuishui.blog.51cto.com/1850554/1544212
http://www.cnblogs.com/electron/p/3488033.html
http://www.vpndp.com/ios-openvpn-settings-tutorial/ iPhone
1、安装openvpn
首先安装依赖库
#/usr/bin/env bash
# Install some pacakages we'll need to compile the driver below.
sudo dnf install gcc kernel-devel -y
# Create working dir for Broadcom driver files and patches.
mkdir hybrid_wl_f23
# Change to working dir.
cd hybrid_wl_f23
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
git config --global --unset http.proxy
git config --global --unset https.proxy
npm config delete proxy
@kj54321
kj54321 / cheatsheet.py
Created August 27, 2016 16:15 — forked from fuyufjh/cheatsheet.py
My Python Cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)
@kj54321
kj54321 / ss-redir 透明代理.md
Created August 21, 2016 13:47 — forked from wen-long/ss-redir 透明代理.md
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个