Skip to content

Instantly share code, notes, and snippets.

View Wyntuition's full-sized avatar

Wyn Van Devanter Wyntuition

View GitHub Profile
@jslay88
jslay88 / k8s-etcd-backup.yaml
Created March 16, 2020 17:42
k8s cronjob for doing daily backups of etcd from a master.
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: etcd-backup
namespace: kube-system
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
@junjizhi
junjizhi / find-sqlite-db-ios-simulator.bash
Created October 10, 2019 00:31
Find the sqlite file location of your iOS / Flutter app
# Returns all db files sorted by modified time. Usually the last one is your sqlite db file.
gfind /Users/<username>/Library/Developer/CoreSimulator/Devices/ -name "*.db" -printf "%T+\t%p\n" | sort
@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@bonzanini
bonzanini / config.py
Last active April 18, 2024 11:57
Twitter Stream Downloader
consumer_key = 'your-consumer-key'
consumer_secret = 'your-consumer-secret'
access_token = 'your-access-token'
access_secret = 'your-access-secret'
@Kartones
Kartones / postgres-cheatsheet.md
Last active May 27, 2024 08:12
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 22, 2024 05:53
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'