Skip to content

Instantly share code, notes, and snippets.

# https://cloud.google.com/compute/docs/disks/add-persistent-disk#resize_partitions
sudo growpart /dev/sda 1
sudo resize2fs /dev/sda
sudo resize2fs /dev/sdb
@mattes
mattes / redis.lua
Created January 21, 2020 19:37
delete redis keys in bulk with pattern
eval "for i, name in ipairs(redis.call('KEYS', 'pattern-*')) do redis.call('DEL', name); end" 0
ws = new WebSocket("ws://localhost:8080");
ws.onopen = function(evt) {
console.log("OPEN");
}
ws.onclose = function(evt) {
console.log("CLOSE");
ws = null;
}
Flashing binaries to serial port /dev/ttyUSB0 (app at offset 0x10000)...
esptool.py v2.5.1
Serial port /dev/ttyUSB0
Connecting........_
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, Embedded Flash
MAC: d8:a0:1d:40:89:c4
Uploading stub...
Running stub...
Stub running...
@mattes
mattes / README.md
Created September 29, 2018 05:31
ESP32 installation
This file has been truncated, but you can view the full file.
{"name":"github","url":"https://github.com/walmartlabs","timestamp":"2018-03-23T21:58:13.542Z","data":{"description":"Example source code for the Lacinia tutorial","forked from":"","forks":"4","language":"Clojure","name":"clojure-game-geek","stars":"6","updated at":"2018-03-23T17:10:33Z","url":"https://github.com/walmartlabs/clojure-game-geek"}}
{"name":"github","url":"https://github.com/walmartlabs","timestamp":"2018-03-23T21:58:13.542Z","data":{"description":"GraphQL implementation in pure Clojure","forked from":"","forks":"59","language":"Clojure","name":"lacinia","stars":"841","updated at":"2018-03-23T00:48:51Z","url":"https://github.com/walmartlabs/lacinia"}}
{"name":"github","url":"https://github.com/walmartlabs","timestamp":"2018-03-23T21:58:13.542Z","data":{"description":"","forked from":"","forks":"","language":"Clojure","name":"schematic","stars":"2","updated at":"2018-03-22T21:29:36Z","url":"https://github.com/walmartlabs/schematic"}}
{"name":"github","url":"https://github.com/walmartlabs","timesta
alert(1337);
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA PUBLIC TO XXX;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA PUBLIC TO XXX;
ALTER DEFAULT PRIVILEGES IN SCHEMA PUBLIC GRANT ALL PRIVILEGES ON TABLES TO XXX;
ALTER DEFAULT PRIVILEGES IN SCHEMA PUBLIC GRANT ALL PRIVILEGES ON SEQUENCES TO XXX;
\du
\dp
@mattes
mattes / main.go
Last active October 10, 2021 09:34
package test
import (
"regexp"
guuid "github.com/google/uuid"
suuid "github.com/satori/go.uuid"
)
var re = regexp.MustCompile("^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[8|9|aA|bB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$")
iptables -A OUTPUT -d 127.0.0.0/8 -j ACCEPT
iptables -A OUTPUT --dst redis -j ACCEPT
iptables -A OUTPUT --dst postgres -j ACCEPT
iptables -P OUTPUT DROP
iptables -L