Skip to content

Instantly share code, notes, and snippets.

@so0k
so0k / README.md
Last active March 29, 2024 13:00 — forked from jpsilvashy/README.md
Post Google Sheets form entries to Slack

Post Google Sheets form entries to Slack

By using Google Form's script editor, you can call Slack webhooks when form submissions are made. You can use this script to do things like creating a live feedback form for taking questions from an audience or notifying your team when someone signs up for an event.

Setup

First, be sure you're collecting the email address in the form:

'img'

@so0k
so0k / postgres-cheatsheet.md
Last active February 5, 2019 21:06 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@so0k
so0k / gist:cdd24d0a4ad92014a1bc
Last active March 4, 2024 14:17
droplet discovery over digitalocean private networks

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu
@so0k
so0k / swapon.service
Last active August 4, 2016 09:39 — forked from romaninsh/swapon.service
Set up swap on CoreOS
[Unit]
Description=Turn on swap
[Service]
Type=oneshot
Environment="SWAPFILE=/4GiB.swap"
RemainAfterExit=true
ExecStartPre=/usr/bin/touch ${SWAPFILE}
ExecStartPre=/usr/bin/chattr -C ${SWAPFILE}
ExecStartPre=/usr/bin/fallocate -l 4096m ${SWAPFILE}