Skip to content

Instantly share code, notes, and snippets.

View yolabingo's full-sized avatar

Todd Jacobsen yolabingo

  • New Mexico, USA
View GitHub Profile
@yolabingo
yolabingo / gist:f5e08e6a6d14940b82597a0dd98cb65c
Last active July 7, 2023 21:01
CentOS 9 docker rootless prereqs

Save the following as docker-prereqs.sh and run as root or with sudo:

#!/bin/bash
DOCKER_USER=dotcms-docker

dnf install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
dnf update -y
dnf install -y iptables tar fuse-overlayfs jq
DO $$ DECLARE
r RECORD;
BEGIN
-- if the schema you operate on is not "current", you will want to
-- replace current_schema() in query with 'schematodeletetablesfrom'
-- *and* update the generate 'DROP...' accordingly.
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;
@yolabingo
yolabingo / macports.sh
Created March 15, 2023 02:26
macports housekeeping
port selfupdate && port upgrade outdated && port uninstall inactive && port uninstall leaves
@yolabingo
yolabingo / gist:afaf95b6ec24d1ecc2bc4efdb9c8adc5
Created October 18, 2022 02:24
quick and dirty react graphql
'use strict';
var query = `query PageRender { page(url: "/index") { url friendlyName } }`;
const e = React.createElement;
class EmptyElement extends React.Component {
constructor(props) {
super(props);
}
render() {
fetch('https://demo.dotcms.com/api/v1/graphql', {
method: 'POST',
@yolabingo
yolabingo / xcode.md
Created October 13, 2022 17:48
xcode bullshit
@yolabingo
yolabingo / python_links.md
Last active April 11, 2024 20:20
python ftw
@yolabingo
yolabingo / urljoin.py
Created September 1, 2022 01:52
python - join url fragments
def urljoin(*args):
""" Joins given arguments into an url, removing extra slashes """
return "/".join(map(lambda x: x.rstrip('/') if x.startswith('//') else x.strip('/'), args))
@yolabingo
yolabingo / osx_limits.md
Created June 24, 2022 20:42
OS X increase max files procs Monterey 12.4

/Library/LaunchDaemons/limit.maxfiles.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>limit.maxfiles</string>
    <key>ProgramArguments</key>
@yolabingo
yolabingo / how-to-build-debian-kernel.md
Last active March 5, 2022 17:24
Build debian kernel from source

Want a cool new kernel feature but it won't show up in Debian for years?

make deb-pkg makes it easy to install a custom Linux kernel from source.

as root/sudo:

apt install build-essential libncurses5-dev gcc libssl-dev bc bison flex rsync libelf-dev
mkdir /usr/local/src/kernel
chown nonrootuser /usr/local/src/kernel
su - nonrootuser
update_config:
delay: 3m
parallelism: 1
failure_action: rollback