Skip to content

Instantly share code, notes, and snippets.

View machsix's full-sized avatar
🚀
Trip to Mars

MachX machsix

🚀
Trip to Mars
  • Mars
View GitHub Profile
@machsix
machsix / gpg-import-and-export-instructions.md
Created February 22, 2019 11:54 — 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...

@machsix
machsix / frp systemd.md
Created February 7, 2019 22:27 — forked from ihipop/frp systemd.md
FRP systemd 启动脚本

/etc/systemd/system/frps.service

[Unit]
Description=FRP Server Daemon

[Service]
Type=simple
ExecStartPre=-/usr/sbin/setcap cap_net_bind_service=+ep /opt/bin/frps
ExecStart=/opt/bin/frps -c /opt/etc/frps.ini
Restart=always
notifications:
email: false
services:
- postgresql
- docker
addons:
postgresql: "9.4"
language: go
go_import_path: "miniflux.app"
go:
@machsix
machsix / stringify.js
Created July 18, 2018 03:43 — forked from cowboy/stringify.js
JavaScript: like JSON.stringify but handles functions, good for creating arbitrary .js objects?
var stringify = function(obj, prop) {
var placeholder = '____PLACEHOLDER____';
var fns = [];
var json = JSON.stringify(obj, function(key, value) {
if (typeof value === 'function') {
fns.push(value);
return placeholder;
}
return value;
}, 2);
@machsix
machsix / [email protected]
Created July 3, 2018 15:01 — forked from reallyimeric/[email protected]
extra shadowsocks-libev/simple-obfs systemd unit files
[Unit]
Description=Shadowsocks-Libev Server Service With Standalone Simple Obfusacting Service
After=network.target
BindsTo=simple-obfs-server@%i.service
After=simple-obfs-server@%i.service
[Service]
Type=simple
User=nobody
CapabilityBoundingSet=CAP_NET_BIND_SERVICE
subroutine readin
!
use param, only: mnmol, mnat, mnsurf, mngauss, mntmod, mntor, &
mnfrag, mnmol, mntraj, mnfrag, mnoutcome, &
mnbond, pi, amutoau, autoatm, autofs, autoev, kb, &
autoang
use c_output, only: idebug, minprinticon, minprinttrapz, maxprint, &
lwrite, nprint
use c_dd, only: lreadin
use c_struct, only: cell, nvibmods, bdfmthr, rijco, nattype, xx0, &
@machsix
machsix / WDMyCloud_crosstool.text
Last active March 11, 2018 16:35 — forked from sled/guide.text
Guid to cross compile transmission 2.82 for Western Digital MyCloud
########################################################
## CROSS COMPILING TRANSMISSION 2.82 FOR WD MY CLOUD ##
########################################################
This is a guide to compile transmission 2.82 for the WD MyCloud 2/3/4 TB.
Because I didn't want to install the build tools and dependencies on my NAS I chose to
setup a cross-compiler toolchain on my x86_64 Ubuntu 12.04 machine and create a .deb package
that can be installed on the NAS. Furthermore the cross compiler can be used to compile anything for the My Cloud (printer drivers, etc.)