Skip to content

Instantly share code, notes, and snippets.

View echoes341's full-sized avatar
🌀

G. Rossin echoes341

🌀
  • 23:29 (UTC +01:00)
View GitHub Profile
@echoes341
echoes341 / Decode secret.sh
Last active December 15, 2023 11:34
Read Github actions secrets
# save secret to file, for example /tmp/secret.b64
# enc_key: they key used in the action
enc_key=
cat /tmp/secret.b64 | base64 -d | openssl aes-256-cbc -d -pbkdf2 -k "$enc_key"
@echoes341
echoes341 / 99-usbip.rules
Last active October 25, 2024 13:16
USB/IP Auto bind all usb devices (except one) and auto attach them on a windows client every 5 seconds
ACTION=="add", SUBSYSTEMS=="usb", ATTR{idProduct}!="XXXX", ATTR{idVendor}!="YYYY", RUN{program}+="/usr/sbin/usbip bind -b %k"
@echoes341
echoes341 / new_user.sql
Created March 30, 2023 09:24
PostgreSQL: create new user and give full access to all tables and all new future tables
-- https://phoenixnap.com/kb/postgres-create-user
-- from the user that will create new tables
CREATE USER userb WITH PASSWORD 'sosecure';
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO "userb";
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL PRIVILEGES ON TABLES TO "userb";
@echoes341
echoes341 / hexToRgb.awk
Last active March 23, 2023 09:08
RGB color notation to HEX and reverse using Awk
#!/bin/awk -f
# Convert awk hex colors to rgb values using awk.
# input line: #000000
# output line: rgb(0,0,0)
{
number = substr($1, 2)
for (i = 1; i <= 3; i++) {
idx = (i - 1)*2 + 1
@echoes341
echoes341 / tmux-cheatsheet.markdown
Created April 4, 2018 18:52 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname