Skip to content

Instantly share code, notes, and snippets.

Avatar

Logan Lindquist llbbl

View GitHub Profile
@llbbl
llbbl / recent_month.sh
Created Jun 15, 2022
get recent directories from last month
View recent_month.sh
find . -type d -mtime -30 -maxdepth 1 -mindepth 1
View python - mysql example.py
sql = "INSERT INTO likes ( user_id, post_id ) VALUES ( %s, %s )"
val = [(4, 5), (3, 4)]
cursor = connection.cursor()
cursor.executemany(sql, val)
connection.commit()
print("query executed")
@llbbl
llbbl / install_ghost.j2
Created May 2, 2022
install ghost, so easy, they said
View install_ghost.j2
#!/bin/zsh
if [ ! -d "{{ghost_install_dir}}" ]
then
echo "creating {{ghost_install_dir}}"
mkdir {{ghost_install_dir}}
fi
cd {{ghost_install_dir}}
@llbbl
llbbl / sync_5etools_latest.sh
Created Apr 24, 2022
sync 5etools content script
View sync_5etools_latest.sh
#!bin/bash
# sync_5etools_latest.sh
# sync 5etools content script
SERVER_USER=
SERVER_HOST=
SERVER_PATH=
LOCAL_DIR=5etools-mirror-1
@llbbl
llbbl / fix_openssl_catalina.sh
Last active Apr 23, 2022
fix missing openssl files in catalina
View fix_openssl_catalina.sh
#!/bin/bash
echo 'update brew'
brew update
echo 'upgrade brew'
brew upgrade
@llbbl
llbbl / Safari Needs WebP Support
Created Aug 16, 2019
Safari Needs WebP Support
View Safari Needs WebP Support
It has been brought up before, but creating a new post to start the conversation again.
* 80% of the current global web traffic supports WebP
* All the other current browsers support WebP
* If Safari on iOS and Mac were to support it, we would see an additional 12-14% of the entire web traffic that supports WebP [bringing total to ~94%]
* Apple is the only/last of the major browser vendors to not support WebP
* Chrome has had at least partial support of WebP since 2011 almost 2 years before Blink was forked from Webkit
* WebP was released 8 (almost 9) years ago
View Meetup-past-events.py
#!/usr/bin/env python3
import collections
import datetime
import pprint
import click
import jinja2
import requests
@llbbl
llbbl / cloudflare.conf
Last active Jun 1, 2019
nginx conf file for setting actual IPs behind cloudflare
View cloudflare.conf
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.31.0.0/18;
set_real_ip_from 172.64.0.0/13;
@llbbl
llbbl / .screenrc
Last active Feb 24, 2018 — forked from joaopizani/.screenrc
A killer GNU Screen Config
View .screenrc
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
View bash-ssh-to-instance-id.sh
function ec2-ssh () {
ssh -i ~/.ssh/$2 -l ubuntu $(aws ec2 describe-instances --filter Name=instance-id,Values=$1 | jq '.Reservations[0].Instances[0].PublicIpAddress' | tr -d '"')
}