A shell script to install VPN using SoftEther and Transmission CLI Torrent Client on Ubuntu 14.04 for use on Digital Ocean
- Execution for installation and setup
sudo su
version: '2' | |
services: | |
db-bootstrap: | |
image: dayreiner/centos7-mariadb-10.1-galera:latest | |
container_name: db1 | |
restart: never | |
expose: | |
- "3306" | |
- "4567" | |
- "4568" |
- What do Etcd, Consul, and Zookeeper do? | |
- Service Registration: | |
- Host, port number, and sometimes authentication credentials, protocols, versions | |
numbers, and/or environment details. | |
- Service Discovery: | |
- Ability for client application to query the central registry to learn of service location. | |
- Consistent and durable general-purpose K/V store across distributed system. | |
- Some solutions support this better than others. | |
- Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state. | |
- Centralized locking can be based on this K/V store. |
# installs to /opt/gradle | |
# existing versions are not overwritten/deleted | |
# seamless upgrades/downgrades | |
# $GRADLE_HOME points to latest *installed* (not released) | |
gradle_version=2.9 | |
wget -N https://services.gradle.org/distributions/gradle-${gradle_version}-all.zip | |
sudo unzip -foq gradle-${gradle_version}-all.zip -d /opt/gradle | |
sudo ln -sfn gradle-${gradle_version} /opt/gradle/latest | |
sudo printf "export GRADLE_HOME=/opt/gradle/latest\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle.sh | |
. /etc/profile.d/gradle.sh |
package main | |
import ( | |
"bytes" | |
"crypto/des" | |
"errors" | |
) | |
func PKCS5Padding(ciphertext []byte, blockSize int) []byte { | |
padding := blockSize - len(ciphertext)%blockSize |
<div id="css3book"> | |
<div class="book-host"> | |
<div class="book"> | |
<div class="dummy"> | |
<div class="book-cover"></div> | |
<div class="dummy-page" id="dummy-page0"></div> | |
<div class="dummy-page" id="dummy-page1"></div> | |
<div class="dummy-page" id="dummy-page2"></div> | |
<div class="dummy-page" id="dummy-page3"></div> | |
<div class="dummy-page" id="dummy-page4"></div> |
package main | |
import ( | |
"bytes" | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
) |
#!/bin/bash | |
# | |
## redis backup script | |
## usage | |
## redis-backup.sh port backup.dir | |
port=${1:-6379} | |
backup_dir=${2:-"/data/backup/redis"} | |
cli="/usr/local/bin/redis-cli -p $port" |
package nettimeout | |
import ( | |
"net" | |
"time" | |
) | |
// Listener wraps a net.Listener, and gives a place to store the timeout | |
// parameters. On Accept, it will wrap the net.Conn with our own Conn for us. | |
type Listener struct { |
/* Tiny web server in Golang for sharing a folder | |
Copyright (c) 2010 Alexis ROBERT <[email protected]> | |
Contains some code from Golang's http.ServeFile method, and | |
uses lighttpd's directory listing HTML template. */ | |
package main | |
import "http" | |
import "io" |