Skip to content

Instantly share code, notes, and snippets.

View wongsyrone's full-sized avatar
😂
Babysitting

Syrone Wong wongsyrone

😂
Babysitting
View GitHub Profile
@wongsyrone
wongsyrone / gist:e40db1d5377873cc6fa5058be9c3ea4a
Created April 7, 2016 09:04
Quick'n easy gpg cheatsheet
Quick'n easy gpg cheatsheet
If you found this page, hopefully it's what you were looking for. It's just a brief explanation of some of the command line functionality from gnu privacy guard (gpg). Please email me if you find any errors ( [email protected] ).
Filenames are italicized (loosely, some aren't, sorry), so if you see something italicized, think "put my filename there."
I've used User Name as being the name associated with the key. Sorry that isn't very imaginative. I *think* gpg is pretty wide in it's user assignments, ie. the name for my private key is Charles Lockhart, but I can reference that by just putting in Lockhart. That doesn't make any sense, sorry.
to create a key:
gpg --gen-key
@wongsyrone
wongsyrone / GNUPG Cheatsheet.md
Last active April 7, 2016 09:15 — forked from turingbirds/GNUPG Cheatsheet.md
GPG (GNUPG) Cheatsheet

GNUPG CHEATSHEET

Setting up: key generation

This generates a public/private keypair.

$ gpg --gen-key

$ gpg --list-secret-keys

@wongsyrone
wongsyrone / gpgmutt.md
Created April 7, 2016 08:57 — forked from bnagy/gpgmutt.md
Mutt, Gmail and GPG

GPG / Mutt / Gmail

About

This is a collection of snippets, not a comprehensive guide. I suggest you start with Operational PGP.

Here is an incomplete list of things that are different from other approaches:

  • I don't use keyservers. Ever.
  • Yes, I use Gmail instead of some bespoke hipster freedom service
@wongsyrone
wongsyrone / gpg-import-and-export-instructions.md
Created April 7, 2016 08:55 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@wongsyrone
wongsyrone / gist:ed5f5a8326edb288ebac
Created March 29, 2016 09:13 — forked from paulirish/gist:4158604
Learn JavaScript concepts with recent DevTools features

Learn JavaScript concepts with the Chrome DevTools

Authored by Peter Rybin , Chrome DevTools team

In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.

Closures

Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:

@wongsyrone
wongsyrone / gist:49b5b21f4a7d0d59ba7e
Created March 20, 2016 07:57
openwrt projects cross ref
http://lxr.mein.io/
@wongsyrone
wongsyrone / fix.bat
Last active August 8, 2016 00:12
Windows 10 File sharing solution
@echo off
net session >nul 2>nul
if ERRORLEVEL 1 (
color 4F
echo Run as Administrator
pause & break
exit
)
@wongsyrone
wongsyrone / Naive-VPN.md
Created January 11, 2016 00:39 — forked from klzgrad/Naive-VPN.md
朴素VPN:一个纯内核级静态隧道

朴素VPN:一个纯内核级静态隧道

由于路由管控系统的建立,实时动态黑洞路由已成为最有效的封锁手段,TCP连接重置和DNS污染成为次要手段,利用漏洞的穿墙方法已不再具有普遍意义。对此应对方法是多样化协议的VPN来抵抗识别。这里介绍一种太简单、有时很朴素的“穷人VPN”。

朴素VPN只需要一次内核配置(Linux内核),即可永久稳定运行,不需要任何用户态守护进程。所有流量转换和加密全部由内核完成,原生性能,开销几乎没有。静态配置,避免动态握手和参数协商产生指纹特征导致被识别。并且支持NAT,移动的内网用户可以使用此方法。支持广泛,基于L2TPv3标准,Linux内核3.2+都有支持,其他操作系统原则上也能支持。但有两个局限:需要root权限;一个隧道只支持一个用户。

朴素VPN利用UDP封装的静态L2TP隧道实现VPN,内核XFRM实现静态IPsec。实际上IP-in-IP隧道即可实现VPN,但是这种协议无法穿越NAT,因此必须利用UDP封装。内核3.18将支持Foo-over-UDP,在UDP里面直接封装IP,与静态的L2TP-over-UDP很类似。

创建一个朴素VPN

@wongsyrone
wongsyrone / 010-c301-complete-support.patch
Created November 20, 2015 01:20
Qihoo C301 OP patch
From 7f0f570213b7056a28d7d352ac1666e0937ffa4b Mon Sep 17 00:00:00 2001
From: Weijie Gao <[email protected]>
Date: Wed, 24 Sep 2014 01:13:34 +0800
Subject: [PATCH] complete c301 support
---
package/boot/uboot-envtools/files/ar71xx | 6 +++
package/network/utils/iwinfo/src/iwinfo_lua.c | 3 ++
target/linux/ar71xx/base-files/etc/diag.sh | 8 ++++
.../lib/preinit/81_load_ath10k_board_bin | 7 +++-
adb shell "settings put global captive_portal_server g.cn"
v2ex 不好用了
by lkebin: liukebin.avosapps.com 架设于LeanCloud服务器,据lkebin称是永久有效
by Zohar: www.iwch.me 热心网友的个人站点