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 / 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.)
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, &
[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 / 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);
notifications:
email: false
services:
- postgresql
- docker
addons:
postgresql: "9.4"
language: go
go_import_path: "miniflux.app"
go:
@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 / npm-git-log-module.js
Last active April 1, 2019 01:00
npm-git-log.js
const {spawnSync} = require("child_process");
const path = require("path");
const gitLog = function(cwd, obj, magicKey) {
magicKey = "^^" || magicKey;
cwd = cwd || ".";
const args = ["log"];
let logFormat = {
commit: "%H",
@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 / 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"
}
// https://stackoverflow.com/questions/48014050/wait-promise-inside-for-loop
// let each promise in for to finish
function test(n) {
let promiseChain = Promise.resolve();
for (let i = 0; i < n; i++) {
const makePromise = (j) => () => new Promise((resolve,reject)=> {
setTimeout(resolve, j*1000);
}).then(()=>{
console.log(j);
if (j < 5 ) {