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
| Samsung Galaxy A7(2016) (a7xelte), Android 5.1 | |
| java.lang.OutOfMemoryError: | |
| at java.util.Collections.sort (Collections.java:1882) | |
| at androidx.recyclerview.widget.GapWorker.buildTaskList (GapWorker.java:259) | |
| at androidx.recyclerview.widget.GapWorker.prefetch (GapWorker.java:365) | |
| at androidx.recyclerview.widget.GapWorker.run (GapWorker.java:397) | |
| at android.os.Handler.handleCallback (Handler.java:739) | |
| at android.os.Handler.dispatchMessage (Handler.java:95) | |
| at android.os.Looper.loop (Looper.java:145) | |
| at android.app.ActivityThread.main (ActivityThread.java:6917) |
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
| public abstract class BackStackFragment extends Fragment { | |
| public static boolean handleBackPressed(FragmentManager fm) { | |
| if (fm.getFragments() != null) { | |
| for (Fragment frag : fm.getFragments()) { | |
| if (frag != null && frag.isVisible() && frag instanceof BackStackFragment) { | |
| if (((BackStackFragment) frag).onBackPressed()) { | |
| return true; | |
| } | |
| } |
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; |