Skip to content

Instantly share code, notes, and snippets.

View lsl's full-sized avatar

Louis Laugesen lsl

  • Automattic
  • Australia
  • 12:36 (UTC +10:00)
View GitHub Profile
@boyter
boyter / guid.py
Created November 8, 2022 05:18
Simply Python3 script to create guids that contain only 1337 speak
import random
def _replace(word):
replacements = {
'l': '1',
'i': '1',
's': '5',
't': '7',
'g': '9',
'q': '9',
@abn
abn / 00-lenovo-x1-5th-gen-thinkfan-setup.md
Last active January 30, 2024 19:31
Fedora thinkfan configuration for Lenovo X1 Carbon (5th Gen)

Thinkfan Configuration Notes

This are notes for configuration thinkfan for Fedora. This configuration procedure was followed on a Lenovo Thinkpad X1 Carbon (5th Gen) running Fedora 25.

Non standard (default) configuration was required for this machine as the default sensors are not available. Eg: /proc/acpi/ibm/thermal does not exist for this model.

An annoted configuration file has been included below. However, there is no guarentee that this will work as-is on every machine.

Installation

dnf -y install thinkfan
@nmaggioni
nmaggioni / ufw_plex.md
Last active April 23, 2024 19:54 — forked from andrey-str/ufw plexmediaserver app profile.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)
@emcmanus
emcmanus / snakeToCamelCase.js
Last active May 17, 2022 02:29 — forked from felixjung/snakeToCamelCase.js
ES6 module to recursively convert snake case keys in an object to camel case using lodash.
'use strict';
/**
* @example
* import keysToCamelCase from './snakeToCamelCase';
* keysToCamelCase({bad_key: 1}); => {badKey: 1}
* keysToCamelCase([{bad_key: 1}]); => [{badKey: 1}]
*/
function keysToCamelCase(object) {
@turneliusz
turneliusz / auto-fpm-setup
Created March 1, 2017 08:43
Automatic setup of PHP-FPM pool max-children
#!/bin/bash -e
FPM_PROCESS_MEMORY_MB=60
RESERVE_INSTANCE_MEMORY=100
FPM_POOL_FILE=/etc/php/7.0/fpm/pool.d/www.conf
MEM_KB=`grep MemTotal /proc/meminfo | awk '{print $2}'`
MEM_FOR_FPM_MB=$(($MEM_KB/1024-$RESERVE_INSTANCE_MEMORY))
FPM_PROCESSES=$(($MEM_FOR_FPM_MB/$FPM_PROCESS_MEMORY_MB))
@davehughes
davehughes / lets-encrypt-nginx.sls
Created October 1, 2016 23:42
Salt state for setting up Let's Encrypt with Nginx
nginx:
pkg.installed: []
service.running:
- reload: true
# SSL setup via letsencrypt, based on the following article:
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04
letsencrypt:
pkg.installed: []
@kristopolous
kristopolous / hn_seach.js
Last active July 24, 2023 04:12
hn job query search
// Usage:
// Copy and paste all of this into a debug console window of the "Who is Hiring?" comment thread
// then use as follows:
//
// query(term | [term, term, ...], term | [term, term, ...], ...)
//
// When arguments are in an array then that means an "or" and when they are seperate that means "and"
//
// Term is of the format:
// ((-)text/RegExp) ( '-' means negation )