Skip to content

Instantly share code, notes, and snippets.

View julienma's full-sized avatar

Julien Ma julienma

View GitHub Profile
@julienma
julienma / update-wordpress.sh
Created July 7, 2018 12:53
Script to update Wordpress FR and deploy via git push (like Heroku/Dokku)
#!/bin/bash
#
# Don't forget to `chmod +x update-wordpress.sh`
#
# Updates WordPress to a new version.
#
# The MIT License (MIT)
# Copyright (c) 2016 Sander Venema <sander@sandervenema.ch>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@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 / DT3 - Add OCR to PDF.scpt
Last active April 2, 2024 08:43
OCR PDFs in DEVONthink 3 with jbarlow83/OCRmyPDF
-- Script for DEVONthink 3
-- Run OCRmyPDF on PDFs without OCR
-- Requires https://github.com/jbarlow83/OCRmyPDF to be installed e.g. with brew
on performSmartRule(theRecords)
tell application id "DNtp"
set strExportPath to "PATH=/opt/homebrew/bin:$PATH "
set intRecordsCount to count of theRecords
show progress indicator "Adding OCR to PDF..." steps intRecordsCount
repeat with theRecord in theRecords
@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 / README.md
Last active November 10, 2021 13:04
How to install Discourse 2.4+ on Dokku (2019)
@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 / 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:

@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 May 14, 2024 16:12
GitHub Actions: using SSH keys to auto-deploy with dokku-push

The dokku-push action requires an SSH key with push access to the Dokku instance. Here's how to do that.

Replace APPNAME with the name of the app (e.g. this is a good idea to use the same name used on Dokku's).

Generate a new SSH keypair

We want each repo to have its own SSH key, so it's easier to rotate/invalidate them if required, without affecting all the repos. Let's generate a new key on your computer (see GitHub help):