Skip to content

Instantly share code, notes, and snippets.

@monnoval
monnoval / raspberry-pi4-wordpress-dev-server.md
Last active November 3, 2021 01:34
Raspberry Pi 4 as Wordpress Development Server
@monnoval
monnoval / ubuntu-linux-firefox-1password.md
Created October 13, 2021 04:35
Firefox Developer Edition - 1password desktop app integration
@monnoval
monnoval / xkeysnail-config.py
Last active July 13, 2021 10:50
xkeysnail-config
# -*- coding: utf-8 -*-
# Run in startup using
# /usr/local/bin/xkeysnail /home/msnoval/.xkeysnail-config.py --devices /dev/input/event4 /dev/input/event7 --quiet
#
# Run xkeysnail without sudo, https://github.com/mooz/xkeysnail/issues/64#issuecomment-600380800
# $ sudo groupadd -f uinput
# $ sudo gpasswd -a $USER uinput
# $ cat <<EOF | sudo tee /etc/udev/rules.d/70-xkeysnail.rules
# KERNEL=="uinput", GROUP="uinput", MODE="0660", OPTIONS+="static_node=uinput"
@monnoval
monnoval / passive-heatsink-with-external-mini-fan.png
Last active April 13, 2021 04:11
Raspberry Pi4 thermal data with passive heatsink
passive-heatsink-with-external-mini-fan.png
@monnoval
monnoval / openwrt-raspberry-pi4-nginx-php7-sqlite-wordpress.md
Last active October 9, 2024 12:31
Running OpenWrt + NGINX + PHP7 + SQLite + Wordpress in Raspberry Pi4

Run OpenWrt + Nginx + PHP7 + SQLite + Wordpress in Raspberry Pi4

* 13 May 2021
Broke my initial build due to a sys upgrade then re did all of below. Not sure what caused the problem. The main blockage I experienced is the expanding of the second partion, see here for the update.
* 18 April 2021
More or less complete by now, any updates or workarounds I will just keep on adding here
* 13-16 April 2021
Content for this post is still in progress as I'm compiling all the workarounds, fixes and commands for all this to work


@monnoval
monnoval / .htaccess
Created February 6, 2020 09:18
.htaccess for custom wp-content
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
git remote remove origin
git remote add origin [BASE-GIT-REPO]
git remote set-url --add --push origin [BASE-GIT-REPO]
git remote set-url --add --push origin [SECONDARY-GIT-REPO]
$ git remote -v
origin [BASE-GIT-REPO] (fetch)
@monnoval
monnoval / monnoval_rules.json
Last active December 3, 2019 07:57
Personal rules for karabiner
{
"title": "Personal rules (@monnoval)",
"rules": [
{
"description": "Right shift + a: Activity Monitor",
"manipulators": [
{
"type": "basic",
"description": "",
"from": {
#!/usr/bin/env bash
find . -type f \( -name "*.jpg" -o -name "*.jpeg" \) -print0 | xargs -0 mogrify -density 72 -set colorspace Gray -separate -average -strip -interlace Plane -gaussian-blur 10 -quality 1%
find . -name "*.png" -print0 | xargs -0 mogrify -density 72 -colors 4
#!/usr/bin/env bash
LOCAL=/Users/you/your/build-prod
REMOTE=/wp-content/themes/your-theme
WPE_HOST=sample.sftp.wpengine.com
WPE_USERNAME=sample-uname
WPE_PASSWORD=sample-pw
LFTP_CO="connect sftp://$WPE_USERNAME:$WPE_PASSWORD@$WPE_HOST:2222"
lftp << EOF