Skip to content

Instantly share code, notes, and snippets.


James Loh jloh

View GitHub Profile
chrisbrownie / electric-blanket-prompt.yaml
Created April 27, 2023 07:50
Prompt to turn the electric blanket on on a cool evening
View electric-blanket-prompt.yaml
alias: Bedroom - Electric Blanket Question 2130
description: "Prompts to turn the electric blanket on if the temperature is below 13 deg C at 2130 and I'm home."
- platform: time
at: "21:30:00"
- condition: zone
zone: zone.home
- condition: template
View tfthacker-folder-decorations.css
/* See Tweet thread for info on the use of this file: */
/* I am not a CSS dude, so no promises this is well written CSS */
.nav-folder-title {
font-weight: 600 !important;
[data-path="Teaching"] > .nav-folder-title-content::before {
View ffmpeg-ios.txt
# Convert from H264 to H265
ffmpeg -i -c:v libx265 -an -x265-params crf=20 output.mp4
# Tag as HVC instead of HEV1 so iOS can play it
ffmpeg -i output.mp4 -vcodec copy -acodec copy -tag:v hvc1 output2.mp4
# Bonus: it can take a second to play (no more than H264) so here's how to generate
# a thumbnail of the first frame to embed in your view as a placeholder.
ffmpeg -i output2.mp4 -vf "select=eq(n\,34)" -vframes 1 thumbnail.png
ScottHelme / lists.txt
Created January 13, 2021 10:57
My Pi-hole blocklist list.
View lists.txt https://www.malwaredomainlist.c
Engr-AllanG /
Last active May 29, 2023 08:43
Firefly-III Ubuntu 20.04 Proxmox Installation Guide

This is a summarized guide I created while installing Firefly-III in a Proxmox (6.2-15) container running Ubuntu 20.04.

I followed this tutorial. It has a link to this other tutorial for installing mariaDB. Furthermore, the official Firefly-iii documentation is Here

This guide has everything I did in one concise summary. Not much is explained. This will take about 1.5 hrs.

Note: I initially followed the official instructions and used a LAMP stack. I had issues with apache and getting the webserver to work (likely because I am not familiar with apache and am more comfortable with nginx).

To begin, first read through the two tutorials and official documentation so that you hav an idea of whats going on

andyrbell /
Last active May 25, 2023 13:00
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
View ansible-bootstrap-ubuntu-16.04.yml
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
- hosts: all
gather_facts: False
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
marianposaceanu /
Last active March 26, 2023 15:50
Linux simple performance tweaks

Linux simple performance tweaks

Change the I/O Scheduler

Open $ vim /etc/default/grub then add elevator=noop next to GRUB_CMDLINE_LINUX_DEFAULT. Run $ update-grub and $ cat /sys/block/sda/queue/scheduler to be sure that noop is being used:

$ vim /etc/default/grub
$ update-grub
$ cat /sys/block/sda/queue/scheduler

[noop] deadline cfq