Skip to content

Instantly share code, notes, and snippets.

@1Conan
1Conan / snowflake-id.sql
Created June 13, 2020 12:35 — forked from beginor/snowflake-id.sql
Twitter Snowflake ID for PostgreSQL
CREATE SEQUENCE public.global_id_seq;
ALTER SEQUENCE public.global_id_seq OWNER TO postgres;
CREATE OR REPLACE FUNCTION public.id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
@1Conan
1Conan / pallas.sh
Created July 8, 2020 14:28 — forked from Siguza/pallas.sh
newstyle OTA
#!/bin/zsh
set -e;
dir="$(mktemp -d)";
echo "$dir" >&2;
iOS_device=();
iOS_model=();
@1Conan
1Conan / libirecovery.patch
Created November 23, 2020 01:10
Patch to disable tools build and fix --with-dummy
diff --git a/Makefile.am b/Makefile.am
index 4a61e83..48c4811 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = src include tools udev
+SUBDIRS = src include udev
typedef struct { /*!< (@ 0x4001C000) SN_SPIn Structure */
union { /*!< (@ 0x00000000) Offset:0x00 SPIn Control register 0 */
__IOM uint32_t raw; /* raw access to CTRL0 register */
struct {
__IOM uint32_t SPIEN : 1; /* SPI enable bit */
__IOM uint32_t LOOPBACK : 1; /* Loopback mode enable bit */
__IOM uint32_t SDODIS : 1; /* Slave data output disable bit */
__IOM uint32_t MS : 1; /* Master/Slave selection bit */
__IOM uint32_t FORMAT : 1; /* Interface format */
__IM uint32_t : 1; /* Reserved */
@1Conan
1Conan / mt7612u-q1p.sh
Last active March 22, 2025 18:54
Disable internal wifi and replace with a 5ghz capable dongle based on MT7612u.
#!/bin/sh
# Use a lan connection to set this up!
# ssh mks@<ip>
# Default password: makerbase
# Download firmware from mt76 repo
sudo wget -P /lib/firmware/mediatek https://github.com/openwrt/mt76/raw/refs/heads/master/firmware/mt7662_firmware_e3_v2.3.bin
sudo wget -P /lib/firmware/mediatek https://github.com/openwrt/mt76/raw/refs/heads/master/firmware/mt7662_patch_e3_hdr_v0.0.2_P69.bin
# Link the firmware files to where the drivers expect it