Skip to content

Instantly share code, notes, and snippets.

@mattvonrocketstein
mattvonrocketstein / viscosity-to-ios-connect.rb
Created June 29, 2018 14:32 — forked from iMerica/viscosity-to-ios-connect.rb
Quickly convert all of your Viscosity connections into OVPN configuration files for OpenVPN for iOS (bundles certificates and keys in the files too)
Dir.glob("#{ENV['HOME']}/Library/Application Support/Viscosity/OpenVPN/*/config.conf").each do |file|
certificate_files = ['ca', 'cert', 'key', 'tls-auth']
config_dir = File.dirname(file)
connection_name = nil
new_config = []
File.read(file).lines.each do |line|
line.strip!
if line.start_with?('#viscosity name')
@import url(https://fonts.googleapis.com/css?family=Roboto:400,700,500,300);@import url(https://fonts.googleapis.com/css?family=Roboto+Mono:400,700,500,300);@keyframes a{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes b{0%{opacity:1}50%{opacity:0}to{opacity:1}}[src$="blue.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDA5Njg4IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptLTIgMTVsLTUtNSAxLjQxLTEuNDFMMTAgMTQuMTdsNy41OS03LjU5TDE5IDhsLTkgOXoiLz48L3N2Zz4=)}[src$="red.png"]{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIxOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjRjQ0MzM2IiBkPSJNMTIgMkM2LjQ4IDIgMiA2LjQ4IDIgMTJzNC40OCAxMCAxMCAxMCAxMC00LjQ4IDEwLTEwUzE3LjUyIDIgMTIgMnptMSAxNWgtMnYtMmgydjJ6bTAtNGgtMlY3aDJ2NnoiLz48L3N2Zz4=)}[src$="yellow.png
@mattvonrocketstein
mattvonrocketstein / keybase.md
Created December 10, 2017 04:28
keybase.md

Keybase proof

I hereby claim:

  • I am mattvonrocketstein on github.
  • I am mvonrocketstein (https://keybase.io/mvonrocketstein) on keybase.
  • I have a public key whose fingerprint is 8192 24B1 F383 9FF8 9723 BCD0 A9F8 A569 41AF 1012

To claim this, I am signing this object:

@mattvonrocketstein
mattvonrocketstein / Makefile
Last active March 14, 2022 20:29
Various reusable make boilerplate and targets
# A placeholder to name the Gist
#
# Running this file:
#
# Download txnlog.dat:
# curl -L -o txnlog.dat https://github.com/adhocteam/homework/blob/6d5d1c71069758/proto/txnlog.dat?raw=true
#
# Run this file with your own elixir stack:
# elixir proto.exs
#
# Or, use the official elixir stack for docker:
//
// This is a Jenkinsfile that backs up (parts of) Jenkins.
//
// So why not use the SCM-sync plugin? I've found it's just not configurable
// enough, and if something goes wrong it's a lot more opaque than this technique
// which uses standard shell and git commands.
//
// By default this approach covers users, credentials, and job and plugin configs,
// but not full builds/workspaces. Obviously you want to send this stuff only to
// a private repository! If you want to change the files that are included to
defmodule Extension do
defmacro extends(module) do
# As above...
end
defmacro implements(module, protocol: protocol) do
quote do
defimpl unquote(protocol), for: unquote(module) do
import Extension

Keybase proof

I hereby claim:

  • I am mattvonrocketstein on github.
  • I am rocketstein (https://keybase.io/rocketstein) on keybase.
  • I have a public key ASCwRSBAv87XpgIbAM88Y_ItJf6aXQ4VgwMU7ZlsBsZ-Ugo

To claim this, I am signing this object:

@mattvonrocketstein
mattvonrocketstein / discover.ex
Last active October 1, 2016 03:48
Demo usage of ex_slp lib
#
# Demo usage of ex_slp_tk for OpenSLP based Elixir node clustering
# see the library at: https://github.com/icanhazbroccoli/ex_slp_tk
#
# To use the code below, add something like this for your application's supervisor:
#
# children = children ++ [supervisor(Discovery.Supervisor, [])]
# supervise(children, opts)
#
require Logger
@mattvonrocketstein
mattvonrocketstein / mix.exs
Created September 7, 2016 15:27
elixir and python
#