Skip to content

Instantly share code, notes, and snippets.

View julienma's full-sized avatar

Julien Ma julienma

View GitHub Profile
@julienma
julienma / README.md
Last active February 20, 2019 20:47
CLI script to parse PayPal's NVP to JSON

Usage

Let's say you saved the output of a PayPal NVP API request to output.txt.

To parse it to JSON:

yarn start output.txt
@julienma
julienma / alias.zsh
Created May 23, 2019 15:56
App status report for Dokku
alias report="dokku ps:report | grep -e '=====>' -e 'Status'"
@julienma
julienma / dokku-pg-backup.sh
Last active September 4, 2019 14:40 — forked from dommmel/dokku-pg-backup.sh
dokku postgres (and volume folders) backup cronjob (using https://github.com/dokku/dokku-postgres)
#! /bin/bash
MAILTO=$(whoami)
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# directory to save backups in, must be rwx by dokku user
BASE_DIR="/var/lib/dokku/data/storage/backups/postgres"
YMD=$(date "+%Y-%m-%d")
DIR="$BASE_DIR/$YMD"
@julienma
julienma / README.md
Created November 2, 2019 21:50
Reset macOS security permissions

To get bundle identifier of an app:

osascript -e 'id of app "Logi Options Daemon"'

Then to reset all permissions of app:

tccutil reset All com.logitech.manager.daemon
@julienma
julienma / DefaultKeyBinding.dict
Created February 18, 2020 13:41
Enable Home/End keys on macOS to behave like Windows
{
"\UF729" = moveToBeginningOfLine:; // home
"\UF72B" = moveToEndOfLine:; // end
"$\UF729" = moveToBeginningOfLineAndModifySelection:; // shift-home
"$\UF72B" = moveToEndOfLineAndModifySelection:; // shift-end
"^\UF729" = moveToBeginningOfDocument:; // ctrl-home
"^\UF72B" = moveToEndOfDocument:; // ctrl-end
"^$\UF729" = moveToBeginningOfDocumentAndModifySelection:; // ctrl-shift-home
"^$\UF72B" = moveToEndOfDocumentAndModifySelection:; // ctrl-shift-end
}
@julienma
julienma / keybase.md
Created April 20, 2020 09:39
keybase.md

Keybase proof

I hereby claim:

  • I am julienma on github.
  • I am julienma (https://keybase.io/julienma) on keybase.
  • I have a public key ASB9qE0CDqzh7nOmhYyf9jxnGSQK8Ih9YBF5xq0uP_HdBwo

To claim this, I am signing this object:

@julienma
julienma / README.md
Last active November 10, 2021 13:04
How to install Discourse 2.4+ on Dokku (2019)
@julienma
julienma / typora-like-source-mode.css
Created February 2, 2022 10:19
CSS snippet for Obsidian to make the Source Mode more like Typora's
/*
Tested on Obsidian 0.13.23 with theme Minimal 5.0
https://github.com/kepano/obsidian-minimal
*/
/* LIVE PREVIEW Editor */
/* Use text font (serif) */
.markdown-source-view.mod-cm6.is-live-preview .cm-scroller {
font-family: var(--text);
@julienma
julienma / readme.md
Created April 8, 2023 09:53
Install chatbot-ui on dokku

How to install https://github.com/mckaywrigley/chatbot-ui on dokku

dokku git:from-image chatbot.domain.com ghcr.io/mckaywrigley/chatbot-ui:main
dokku proxy:ports-set chatbot.domain.com http:80:3000
dokku config:set chatbot.domain.com OPENAI_API_KEY="sk-..." DOKKU_LETSENCRYPT_EMAIL=mail@domain.com
dokku letsencrypt:enable chatbot.domain.com
dokku http-auth:enable chatbot.domain.com <MYUSER> <MYPASSWORD>
@julienma
julienma / README.md
Last active April 10, 2023 21:59
Pi-Hole docker setup with DNSCrypt-Proxy 2

This will setup Pi-Hole with DNS-Over-HTTPS (DoH) enabled, using dnscrypt-proxy as a DoH proxy — which is an alternative to cloudflared, as explained in the Cloudflare docs. Inspired from https://github.com/losuler/pihole-dnscrypt-docker.

Install Pi-Hole on Docker

Create docker-compose.yml and etc-dnscrypt-proxy/dnscrypt-proxy.toml, then to install/update: