Skip to content

Instantly share code, notes, and snippets.

View gist:1878251ba39d9dee17ddb61ff80a2c8f

Replication

  • mysql 5.6
  • Mater IP Address = 192.168.1.1
  • Slave IP Address = 192.168.1.2

Master に repl ユーザーを作成する

以下の例では、repl ユーザーが192.168.1.2 からレプリケーション用の接続をできるようにしている。 レプリケーションなので、ON *.* で全データベース、全テーブルに対して許可している。

@javasboy
javasboy / ovpn-writer.sh
Created Apr 13, 2016 — forked from renatolfc/ovpn-writer.sh
Script to generate an OpenVPN client configuration file in the unified format
View ovpn-writer.sh
#!/bin/sh
##
## Usage: ./ovpn-writer.sh SERVER CA_CERT CLIENT_CERT CLIENT_KEY SHARED_SECRET > client.ovpn
##
server=${1?"The server address is required"}
cacert=${2?"The path to the ca certificate file is required"}
client_cert=${3?"The path to the client certificate file is required"}
client_key=${4?"The path to the client private key file is required"}
@javasboy
javasboy / android-client.ovpn
Created Apr 13, 2016 — forked from renatolfc/android-client.ovpn
A sample OpenVPN client configuration file in the unified format
View android-client.ovpn
client
dev tun
remote example.com
resolv-retry infinite
nobind
persist-key
persist-tun
ca [inline]
cert [inline]
key [inline]
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
View linux上用strongswan搭建ikev2协议vpn.md

平台:DigitalOcean VPS ubuntu14.04 x64, strongswan5.2.2 运行以下命令请使用root权限

一:安装strongswan

由于ubuntu软件仓库中strongswan版本较低,因此从官网源码编译安装

apt-get install build-essential     #编译环境
aptitude install libgmp10 libgmp3-dev libssl-dev pkg-config libpcsclite-dev libpam0g-dev     #编译所需要的软件
View db.py
#!/usr/ali/bin/python
# coding=utf-8
'''Implements a simple database interface
Example 0: Create connection:
# Set auto commit to false
db = DB(False, host = 'x', user = 'x', passwd = 'x', db = 'x')
View decrypt
#!/bin/bash
openssl aes-256-cbc -d -a -in $1 -out $1.clear
echo "clear file is in $1.clear"
You can’t perform that action at this time.