Skip to content

Instantly share code, notes, and snippets.

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

MachX machsix

🚀
Trip to Mars
View GitHub Profile
@machsix
machsix / mount-bitlocker
Last active July 12, 2019 22:17 — forked from dumbledore/mount-bitlocker
Mount/umount wrapper for dislocker on Linux x64
#!/bin/bash
BITLOCKER_PARTITION="${1}"
BITLOCKER_PASSWORD="${2}"
function usage() {
echo "$(basename ${0}) <partition> <password>"
echo "Unlocks and mounts a bitlocker partition as read-only"
echo "Get by lsblk -f"
}
@machsix
machsix / owo.whats-th.is.user.js
Created April 6, 2019 09:32 — forked from cking/owo.whats-th.is.user.js
owo.whats-th.is.user.js
// ==UserScript==
// @name OwO, whats this :D
// @namespace http://tampermonkey.net/
// @version 0.2
// @description try to take over the world!
// @author Christopher König
// @include *
// @connect api.awau.moe
// @grant GM_registerMenuCommand
// @grant GM_setValue
@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
@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);
[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
@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.)