This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#easy openvpn server setup for ubuntu | |
read -p "port (1-65535): " PORT | |
read -p "protocol (udp or tcp): " PROTOCOL | |
read -p "encrypt (y or n): " ENCRYPT | |
read -p "hmac (y or n): " HMAC | |
read -p "xor scramble (y or n): " SCRAMBLE | |
read -p "compress (y or n): " COMPRESS_YN | |
read -p "network number (0-255): " NETWORK_NUM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow.Kind | |
import arrow.data.fix | |
import arrow.effects.* | |
import arrow.mtl.instances.KleisliMtlContext | |
import arrow.mtl.typeclasses.MonadReader | |
import arrow.typeclasses.Monad | |
import arrow.typeclasses.binding | |
import arrow.typeclasses.bindingCatch | |
import kotlinx.coroutines.experimental.runBlocking |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/yum.repos.d | |
curl -O https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo | |
yum -y install shadowsocks-libev | |
setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/ss-server | |
cat > /etc/shadowsocks-libev/config.json << 'EOF' | |
{ | |
"server": "0.0.0.0", | |
"server_port": 443, | |
"password": "p@$$w0rd", | |
"method": "aes-128-gcm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class HttpInterceptor implements Interceptor { | |
@Override | |
public Response intercept(Chain chain) throws IOException { | |
Request request = chain.request(); | |
//Build new request | |
Request.Builder builder = request.newBuilder(); | |
builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ... | |
sealed class LocalizedString | |
data class ResourceString( | |
val id: Int, | |
val quantity: Int? = null, | |
val prefix: String = "", | |
val suffix: String = "", | |
val args: List<Any> = emptyList(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.indicee.api.examples; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.InputStream; | |
import java.io.OutputStream; | |
import java.security.NoSuchAlgorithmException; | |
import javax.net.ssl.SSLContext; | |
import javax.xml.parsers.DocumentBuilderFactory; |