Skip to content

Instantly share code, notes, and snippets.

View vmzhivetyev's full-sized avatar

Viacheslav Zhivetyev vmzhivetyev

View GitHub Profile
@vmzhivetyev
vmzhivetyev / shadowsocks_server_guide.md
Created August 11, 2023 22:21
Shadowsocks server setup guide for Ubuntu VPS

Shadowsocks server installation guide on Ubuntu VPS

Install

Go sudo

sudo su

OVPN selective routing

Create OVPN Client

name ovpn-client

profile default-encrypted

use peer dns NO

@vmzhivetyev
vmzhivetyev / swiftformat.sh
Last active March 17, 2020 16:40
swiftformat pre-commit hook
#!/bin/bash
# Put here and make executable: chmod +x .git/hooks/pre-commit
git diff --diff-filter=d --staged --name-only | grep -e '\(.*\).swift$' | while read line; do
swiftformat "${line}";
git add "$line";
done
import Foundation
struct ThreadSafeVar<T> {
private let _lock = NSRecursiveLock()
private var _value: T
var value: T {
get {
_lock.lock()
let value = _value
Mac Network Commands Cheat Sheet
After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty.
Get an ip address for en0:
ipconfig getifaddr en0
Same thing, but setting and echoing a variable: