Skip to content

Instantly share code, notes, and snippets.

@JimmieD
JimmieD / pivpn_with_stunnel.md
Last active September 30, 2023 20:10
PiVPN with stunnel

Using PiVPN with Stunnel

Intro

The following are steps to setting up PiVPN with stunnel. Why would you want to do this? OpenVPN is subject to blocking by several methods of deep packet inspection since OpenVPN traffic, though encrypted, looks slightly different than normal web traffic. If your OpenVPN works, you probably don't need this. But if it is being blocked, you will probably have to wrap your OpenVPN connection in an SSL tunnel to make it look like normal web traffic. For an explation see here: https://proprivacy.com/guides/how-to-hide-openvpn-traffic-an-introduction

The following are steps needed to wrap your OpenVPN in an SSL connection wtih a Linux server (I got it working in ubuntu 18.04; looks to only work with amd64 architecture, not armhf). So far I've only used with a Windows client, so I don't know the exact config for an Android, iOS, Mac, or Linux client.

@lukepighetti
lukepighetti / extents_page_view.dart
Last active January 3, 2023 13:48
Flutter PageView that loads the next/previous page off-screen
import 'package:flutter/gestures.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart' hide PageView;
/// This is copy-pasted from the Flutter framework with a support added for building
/// pages off screen using [Viewport.cacheExtents] and a [LayoutBuilder]
///
/// Based on commit 3932ffb1cd5dfa0c3891c60977ee4f9cd70ade66 on channel dev
// Having this global (mutable) page controller is a bit of a hack. We need it
@stinger
stinger / CombineFetcherAndDecoder.swift
Last active February 17, 2024 02:07
Combine - fetching and decoding JSON data
import Foundation
import Combine
enum APIError: Error, LocalizedError {
case unknown, apiError(reason: String), parserError(reason: String)
var errorDescription: String? {
switch self {
case .unknown:
return "Unknown error"
@felangel
felangel / main.dart
Last active May 11, 2021 13:36
showDialog sample
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:bloc/bloc.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@fearblackcat
fearblackcat / proxy_for_terminal.md
Last active April 13, 2024 18:53
Set proxy for terminal on mac

Shadowsocks Proxy

apt-get install python-pip
pip install shadowsocks

sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start
@SheldonWangRJT
SheldonWangRJT / iOS Dynamic vs. Static Library & Framework.md
Last active November 14, 2022 04:07
iOS Dynamic vs. Static Library / Framework

iOS Dynamic vs. Static Library / Framework

Find me on Github, Facebook, Youtube, etc by #iOSBySheldon.

Concept

Library and Framework are not same but close. Frameworks are just libraries with linking (binding). In other words, frameworks are just libraries that are bundled into targets. Therefore, their file extensions are different.

File Format

  • Static Library - xxxx.a
  • Dynamic Library - xxxx.dylib
@bnickel
bnickel / Queue Playground.swift
Last active June 23, 2020 16:33
Swift retry operation playground
import Foundation
protocol Completable {
func addCompletionOperation(on queue: OperationQueue, complete: @escaping (Self) -> Void) -> Operation
}
extension Completable where Self: Operation {
func addCompletionOperation(on queue: OperationQueue, complete: @escaping (Self) -> Void) -> Operation {
let completionOperation = BlockOperation {
@kciter
kciter / RxAlamofire+ObjectMapper.swift
Created August 11, 2016 02:52
RxAlamofire+ObjectMapper
import UIKit
import RxSwift
import RxAlamofire
import ObjectMapper
class Post: Mappable {
var id: Int = 0
var title: String = ""
required init?(_ map: Map) {
@nickbutcher
nickbutcher / avd_bundle.xml
Last active December 31, 2021 01:03
An example of the Android xml bundle format for creating an AnimatedVectorDrawable. See https://plus.google.com/+NickButcher/posts/A8KKxnJdg4r
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
@davidlondono
davidlondono / VideoMerge.swift
Created May 17, 2016 21:50
this is the inspiration original gist https://github.com/jai/VideoMerge
//
// VideoMerge.swift
// David Alejandro
//
// Created by David Alejandro on 5/12/16.
// Copyright © 2016 David Alejandro. All rights reserved.
//
// inpired by https://github.com/jai/VideoMerge