Skip to content

Instantly share code, notes, and snippets.

🚀
Trip to Mars

MachX machsix

🚀
Trip to Mars
  • Mars
View GitHub Profile
View Personal_filter.txt
! Title: Personal_filter by machsix
! Expires: 4 days
! Download link: https://gist.githubusercontent.com/machsix/bc579deb5b8138a0a1ce8b36b152a30c/raw/
https://ws1.sinaimg.cn/large/007704gCgy1fsm25htiulj306y06y0sy.jpg
lovenzb.com##.note
||lovenzb.com/upload/201806/17/201806172318101583.gif$image
lovenzb.com##.duilian_right.duilian
lovenzb.com##.duilian_left.duilian
94lsj.com##.loc-content-right-adv
@machsix
machsix / index.html
Created Dec 9, 2019
parcel_failed_example
View index.html
<html>
<body>
<script src="./index.js"></script>
</body>
</html>
View cloudflare-update-record.sh
#!/bin/bash
# CHANGE THESE
API=1aeb5xxxxxxxxxx9dd194c56d07caf311
EMAIL="example@gmail.com"
DOMAIN="example.net"
LOG_DEV="/var/log/ddns.json"
get_zone_id () {
local zone_id=`curl -fs -X GET "https://api.cloudflare.com/client/v4/zones" \
View promise_in_for.js
// 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 ) {
@machsix
machsix / mount-bitlocker
Last active Jul 12, 2019 — forked from dumbledore/mount-bitlocker
Mount/umount wrapper for dislocker on Linux x64
View mount-bitlocker
#!/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"
}
View 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
View npm-git-log-module.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 / gpg-import-and-export-instructions.md
Created Feb 22, 2019 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

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 Feb 7, 2019 — forked from ihipop/frp systemd.md
FRP systemd 启动脚本
View frp systemd.md

/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
View travis_example.yaml
notifications:
email: false
services:
- postgresql
- docker
addons:
postgresql: "9.4"
language: go
go_import_path: "miniflux.app"
go:
You can’t perform that action at this time.