Skip to content

Instantly share code, notes, and snippets.

View joinemm's full-sized avatar
🏠
Working from home

Joonas Rautiola joinemm

🏠
Working from home
View GitHub Profile
@joinemm
joinemm / download.py
Created April 27, 2023 12:23
Loonacord commands Imgur conversion
import json
from time import sleep
import requests
with open("loonacord_imgur_commands.json", "rb") as f:
commands_raw = json.load(f)
for command in commands_raw:
sleep(1)
@joinemm
joinemm / backup.sh
Last active September 10, 2022 14:39
Backup and restore data from a running mysql docker container
# 1. start the db container and map it to local port 3306
# 2. dump it (remove --no-create-info to also migrate schema)
$ mysqldump --port 3306 -h 0.0.0.0 -prootpw --no-create-info database > mydb.sql
# 3. move to another host
$ scp source:~/mydb.sql dest:~/
# 4. start db on destination
# 5. create schema if not created automatically
# 6. restore data
$ mysql --port 3306 -h 0.0.0.0 -prootpw database < mydb.sql
@joinemm
joinemm / brightness.sh
Last active June 26, 2023 13:18
Brightness control script for arch linux
#!/bin/bash
# Brightness adjuster script by Joinemm
#
# Why?
# My brightness adjustments werent working through xbacklight so i made this as a replacement.
# Just bind this to your brightness keys
#
# To remove sudo requirement, add this to /etc/udev/rules.d/backlight.rules
#