Skip to content

Instantly share code, notes, and snippets.

View liuyigh's full-sized avatar

Yi Liu liuyigh

View GitHub Profile
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@cunnie
cunnie / f1-micro-vs-g1-small.txt
Created August 31, 2016 22:13
g1-small is 2x faster than f1-micro
Compiling package 's3cli/1c5a91f02feff8a0e3a506ac51c4a3140e86f049'... Finished (00:00:04)
Compiling package 'ruby/589d4b05b422ac6c92ee7094fc2a402db1f2d731'... Finished (00:08:39)
Compiling package 'mysql/b7e73acc0bfe05f1c6cbfd97bf92d39b0d3155d5'... Finished (00:02:11)
Compiling package 'libpq/09c8f60b87c9bd41b37b0f62159c9d77163f52b8'... Finished (00:01:18)
Compiling package 'golang/1ad977ce1c6fdbf21485a79567ef3d8d4d280110'... Finished (00:03:05)
Compiling package 'powerdns/256336d00b1689138490c385c03ad3a8f54b4a9e'... Finished (00:00:10)
Compiling package 'director/0f1b09ec6bb28ea13d2e919e71dd7ccd8ab49313'... Finished (00:06:14)
Compiling package 'nats/0155cf6be0305c9f98ba2e9e2503cd72da7c05c3'... Finished (00:01:04)
Compiling package 'registry/3aa0993cb8739fd4f5c6fc1e0da8e1cfdf6df247'... Finished (00:06:20)
Compiling package 'bosh-google-cpi/22b47cafcd455cb8f94e164e2049a4976f4dce1c'... Finished (00:02:48)
@BuhtigithuB
BuhtigithuB / update_web2py_specific_files_inside_your_app.sh
Last active January 17, 2018 23:15
Update web2py specific files inside your app
# When you upgrade web2py your should update app files that are important to web2py for properly functioning
#
# views/
# appadmin.html
# generic.ics
# generic.load
# generic.rss
# layout.html
# generic.json
# generic.map
@aenain
aenain / export-wunderlist-indexeddb.js
Created June 18, 2019 20:16
Wunderlist to Dynalist export. Go to Wunderlist web interface, backup data (JSON file), folders, list positions (from IndexedDB), use this script and import the output into Dynalist. Heavily inspired by https://gist.github.com/bryanph/fcddf602d60d7c6ecdaf6584f2db55a5
var download = (filename, text) => {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
@dvf
dvf / change-codec.md
Last active August 3, 2025 04:13
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<!-- Default system-ui fonts -->
<match target="pattern">
<test name="family">
<string>system-ui</string>
</test>
<edit name="family" mode="prepend" binding="strong">