Skip to content

Instantly share code, notes, and snippets.

arkty /
Created September 9, 2020 10:09 — forked from amkisko/
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.


This should fit most setups (not mine though 😉)

So, you want to be able to work from anywhere. You want to be on a mountain somewhere, two bars of 3G signal, and you forward that to your laptop with a WiFi hotspot. Open your laptop and your shell on remote is already open and as responsive as possible. Work/life balance? With power like this, who cares?

Problem Scenario

Often, in academic institutions at least, you have the following situation:

class BooleanPreference(
private val name: String,
private val default: Boolean = false
) {
operator fun getValue(thisRef: LocalStorage, property: KProperty<*>): Boolean =
thisRef.prefs.getBoolean(name, default)
operator fun setValue(thisRef: LocalStorage, property: KProperty<*>, value: Boolean) =
thisRef.prefs.edit().putBoolean(name, value).apply()
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 136 columns, instead of 105. in line 3.
arkty / .gitlab_ci.yml
Created December 24, 2017 22:46 — forked from Qurus/.gitlab_ci.yml
Deploy from Gitlab CI to Dokku
PROJECT_NAME: 'project_name'
- deploy_to_dokku
arkty / Exceptions.kt
Last active September 5, 2017 10:14
Android Retrofit
// Сам эксепшн
class ApiException(val error: ApiError) : Exception() {
override val message: String?
get() = error.messages.getOrNull(0)
// тут можно добавить метод getOrDefault(fallbackMessage: String)
companion object {
fun from(body: ResponseBody) = ApiException(ApiError.from(body))
arkty / genymotionwithplay.txt
Created October 27, 2016 07:53 — forked from wbroek/genymotionwithplay.txt
Genymotion with Google Play Services
Download the following ZIPs:
ARM Translation Installer v1.1 (
Download the correct GApps for your Android version:
Google Apps for Android 6.0 ( -
Google Apps for Android 5.1 ( -
Google Apps for Android 5.0 ( -
Google Apps for Android 4.4.4 ( -
Google Apps for Android 4.3 ( -
package com.example.beginner1;
import android.os.Handler;
import android.os.Bundle;
import android.widget.TextView;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
arkty / HClust_Dendogram.R
Created June 10, 2016 18:11 — forked from jamesthomson/HClust_Dendogram.R
R HClust to d3.js Dendogram
#convert output from hclust into a nested JSON file
for (i in (1:nrow(merge))) {
package me.arkty.views;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.Checkable;
import android.widget.FrameLayout;
* Author: Andrey Khitryy
* Email: