Skip to content

Instantly share code, notes, and snippets.

var CryptoJS = require('crypto-js')
var request = require('request-promise')
/*
* npm install crypto-js request-promise request
* node wx_t1t_hack.js
*/
// export function testEncription(msg, fullKey) {
// var fullKey = fullKey.slice(0, 16)
@zwf
zwf / nomad_server.sh
Created July 30, 2018 09:34 — forked from pengchujin/nomad_server.sh
nomad_server
#!/bin/bash
# server install
export IP_ADDRESS=$(hostname -i)
echo $IP_ADDRESS
apt-get update
apt-get install -y unzip dnsmasq wget
# install Nomad
wget https://releases.hashicorp.com/nomad/0.8.4/nomad_0.8.4_linux_amd64.zip
unzip nomad_0.8.4_linux_amd64.zip -d /usr/local/bin/

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@zwf
zwf / README.md
Created September 5, 2018 04:39 — forked from jesslilly/README.md
Deluxe Cron Job Wrapper

Cron Job Wrapper Wish List

I want a script that will give me:

  1. Logging
  2. Log purging!
  3. Email errors!
  4. Prevent duplicate processes! (flock)
  5. Source an environment file!
  6. Anything else?
@zwf
zwf / postgresql_jsonb_crud.sql
Created December 5, 2018 01:31 — forked from inindev/postgresql_jsonb_crud.sql
Simple PostgreSQL 9.4 functions to manipulate jsonb objects adapted from Matheus de Oliveira's json_manipulator.sql. https://gist.github.com/matheusoliveira/9488951 (Note: performance is not a concern for those functions)
/*
* derivative work of Matheus de Oliveira's json_manipulator.sql
* https://gist.github.com/matheusoliveira/9488951
*
* adapted to support postgresql 9.4 jsonb type
* no warranties or guarantees of any kind are implied or offered
*
* license is as Matheus conferred it on 4/9/2015:
* matheusoliveira commented on Apr 9
* @hannes-landeholm, I'd like to take credit if you share them
@zwf
zwf / letsencrypt_notes.sh
Created June 16, 2022 13:20 — forked from lachesis/letsencrypt_notes.sh
Set up LetsEncrypt using acme.sh without root
# How to use "acme.sh" to set up Lets Encrypt without root permissions
# See https://github.com/Neilpang/acme.sh for more
# This assumes that your website has a webroot at "/var/www/<domain>"
# I'll use the domain "EXAMPLE.com" as an example
# When this is done, there will be an "acme" user that handles issuing,
# updating, and installing certificates. This account will have the following
# (fairly minimal) permissions:
# - Host files at http://EXAMPLE.com/.well-known/acme-challenge