Skip to content

Instantly share code, notes, and snippets.

@whazor
whazor / .gitignore
Created December 12, 2022 17:26
terraform sops
# .tfstate files
*.tfstate
*.tfstate.*
# do not ignore encrypted tfstate files, with .enc inside
!*.enc.tfstate
!*.enc.tfstate.*
# unless it is decrypted
*.decrypted*tfstate
@yorickdowne
yorickdowne / GethBEHAVE.md
Last active May 23, 2024 03:03
Pruning Geth 1.10.x, 1.11.x, 1.12.x

Note: PBSS in Geth >=1.13.0 removes the need to prune manually.


Old content for reference

Overview

Geth (Go-Ethereum) as of July 2022 takes about 650 GiB of space on a fast/snap sync, and then grows by ~ 14 GiB/week with default cache, ~ 8 GiB/week with more cache.

@jadbaz
jadbaz / compile_zabbix_agent_openssl_static.sh
Created April 30, 2020 10:49
Compile zabbix agent with openssl with static libraries
PCRE_VERSION=8.44
ZABBIX_VERSION=4.4.7
OPENSSL_VERSION=1.1.1g
### gcc ###
test ! `which gcc` && test `which apt-get` && apt-get install g++
test ! `which gcc` && test `which yum` && yum install g++
### PCRE ###
cd /usr/local/src
@GabLeRoux
GabLeRoux / archlinux-virtualbox.sh
Last active November 27, 2023 12:22
Virtualbox archlinux notes
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4
@idlethreat
idlethreat / gelf-listener.py
Last active May 23, 2022 11:26
Gelf Log Listener in Python
#!/usr/bin/env python
############### // gelfListener 0.2 // ###############
#
# Listens on UDP 12201 for Gelf messages
# Extracts the event data and writes the message to disk
# updated to handle both zlib (nxlog) and gzip (graylog server) compressed events
# not perfect, but works okay
#
# Bugs:
@scaryguy
scaryguy / change_primary_key.md
Last active May 13, 2024 18:43
How to change PRIMARY KEY of an existing PostgreSQL table?
-- Firstly, remove PRIMARY KEY attribute of former PRIMARY KEY
ALTER TABLE <table_name> DROP CONSTRAINT <table_name>_pkey;
-- Then change column name of  your PRIMARY KEY and PRIMARY KEY candidates properly.
ALTER TABLE <table_name> RENAME COLUMN <primary_key_candidate> TO id;
@atenni
atenni / README.md
Last active April 24, 2024 01:36
How to permalink to a gist's raw file

Problem: When linking to the raw version of a gist, the link changes with each revision.

Solution:

To return the first file from a gist: https://gist.github.com/[gist_user]/[gist_id]/raw/

To get a file from multi–file gist: https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]