Skip to content

Instantly share code, notes, and snippets.

View jloh's full-sized avatar

James Loh jloh

View GitHub Profile
# Convert from H264 to H265
ffmpeg -i in.mov -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
/* See Tweet thread for info on the use of this file: https://twitter.com/TfTHacker/status/1588781787865808897?s=20&t=iDq6L-u4SHnJ5UfN0r7yzQ */
/* I am not a CSS dude, so no promises this is well written CSS */
.nav-folder-title {
font-weight: 600 !important;
color:steelblue;
}
[data-path="Teaching"] > .nav-folder-title-content::before {
@chrisbrownie
chrisbrownie / electric-blanket-prompt.yaml
Created April 27, 2023 07:50
Prompt to turn the electric blanket on on a cool evening
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."
trigger:
- platform: time
at: "21:30:00"
condition:
- condition: zone
entity_id: person.me
zone: zone.home
- condition: template
@ScottHelme
ScottHelme / lists.txt
Created January 13, 2021 10:57
My Pi-hole blocklist list.
https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts https://mirror1.malwaredomains.com/files/justdomains http://sysctl.org/cameleon/hosts https://zeustracker.abuse.ch/blocklist.php?download=domainblocklist https://s3.amazonaws.com/lists.disconnect.me/simple_tracking.txt https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt https://hosts-file.net/ad_servers.txt https://v.firebog.net/hosts/AdguardDNS.txt https://adaway.org/hosts.txt https://v.firebog.net/hosts/Easyprivacy.txt https://v.firebog.net/hosts/Prigent-Ads.txt https://zerodot1.gitlab.io/CoinBlockerLists/hosts https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/ocsp.txt https://raw.githubusercontent.com/ScottHelme/revocation-endpoints/master/crl.txt https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/gambling/hosts https://www.malwaredomainlist.c
@gwillem
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
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@marianposaceanu
marianposaceanu / linux_performance.md
Last active January 30, 2024 06:47
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

@Engr-AllanG
Engr-AllanG / fireflyguide.md
Last active March 4, 2024 12:42
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
andyrbell / scanner.sh
Last active April 5, 2024 09:01
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