Skip to content

Instantly share code, notes, and snippets.

@yglodt
yglodt / ProY.terminal
Created October 27, 2023 07:31
Translucent macOS Terminal profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.5</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO
@yglodt
yglodt / clock.py
Last active August 26, 2020 09:15
#!/usr/bin/env python3
# This is a digital clock for the unicorn hat mini from Pimoroni
# There is an updated version available here: https://github.com/yglodt/unicornhatmini-clock
import time, datetime
from unicornhatmini import UnicornHATMini
from random import randrange
unicornhatmini = UnicornHATMini()
#!/bin/bash
if [[ "$1" == "" ]]; then
echo "Dump file to restore not specified, please give it as parameter."
exit 1
fi
echo "Stopping apache2"
sudo service apache2 stop
#!/bin/sh
pg_dump --verbose --host db.host.name --username myuser --file ~/mydatabase-`date +%Y%m%d-%H%M%S`.dump -F c mydatabase
#!/bin/bash
# 54321_xxxxxx_yyyyy.pdf
# 54321_xxxxxx_yyyyy.pdf
# 54321_xxxxxx_yyyyy.pdf
# will become 54321.pdf
# 54322_xxxxxx_yyyyy.pdf
# 54322_xxxxxx_yyyyy.pdf
# will become 54322.pdf
@yglodt
yglodt / resize_jpegs.sh
Created June 8, 2018 09:26
Resize jpegs with fixed width
#!/bin/bash
mkdir -p small
for f in *.jpg; do
echo $f;
convert "$f" -quality 75 -resize 1000x "small/$f";
done
#!/usr/bin/python
# -*- coding: utf-8 -*-
import psycopg2
import sys
con = None
conn_string = "host='localhost' dbname='mydb' user='myuser' password='mypass'"