Skip to content

Instantly share code, notes, and snippets.

View s-n-g's full-sized avatar
😯
Always amazed!

Spiros Georgaras s-n-g

😯
Always amazed!
View GitHub Profile
@s-n-g
s-n-g / README.md
Last active June 26, 2022 09:57
Convert old PyRadio themes to new format

This is a simple script to convert an old PyRadio theme to the new format!

Usage:

python pyradio_convert_theme.py [FILE | THEME NAME]

Note: Please make sure you are using the same pallette as the one used when the original theme was created

@s-n-g
s-n-g / pyradio_themes.py
Last active June 26, 2022 06:28
python script to check pyradio themes
# -*- coding: utf-8 -*-
import curses
import sys
from os import environ, getenv, remove
import glob
from os.path import join, basename, getmtime, getsize, exists
LOG_FILE = join(getenv('HOME', '~'), 'pyradio_themes.log')
def hex_to_rgb(h):
@s-n-g
s-n-g / README.md
Last active July 17, 2021 17:26
PDF manipulation (2x1 to 1x1 with offset correction)

This is my recipe to manipulate a downloaded pdf file in a way that I finally get a 1 book page per pdf page file.

The file I downloaded and will use for this, is a 2x1 pdf file (2 book pages per pdf page).

Furthermore, each left page of the book (the first half of each pdf page) is off-centered.

I will use the following commands:

  • mutool (package mupdf-tools on Arch Linux)
  • pdfunite, pdrseparate (package poppler on Arch Linux)
@s-n-g
s-n-g / fix-openbox-rc-xml
Last active July 7, 2021 08:21
A script to help you preserve config files customization from being overwritten by system updates.
#!/bin/bash
#
# (C) S. Georgaras <sng@hellug.gr>, 2021
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free SoftwareFoundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@s-n-g
s-n-g / init_8_colors.py
Created May 6, 2021 13:00
A python curses script to demonstrate changing color values (based on https://stackoverflow.com/questions/44621718/curses-init-color-wont-take-effect)
# -*- coding: utf-8 -*-
# https://stackoverflow.com/questions/44621718/curses-init-color-wont-take-effect
import sys
import curses
def demo(screen):
arg = sys.argv[1:]
cont = True
curses.curs_set(0)
@s-n-g
s-n-g / whereismyip
Last active May 29, 2020 14:50
whereismyip - A utility to display your public IP and its location
#!/bin/bash
#
# A utility to show your public IP and its location
# (C) S. Georgaras <sng@hellug.gr>, May 2020
#
# If executed without a terminal, a notification is sent
# otherwise output goes to terminal
#
# Requirements:
# 1. notify-send
@s-n-g
s-n-g / tunejack.sh
Created October 20, 2019 17:22 — forked from xndc/tunejack.sh
Instant radio streaming script using the TuneIn API
#!/bin/bash
# tunejack.sh uses the TuneIn public API (at opml.radiotime.com) to search for
# a radio station, print out its details and try to play it somehow.
if [ "$#" -eq 0 ]; then
echo "$0: search for a radio station using the TuneIn API"
echo "Usage: $0 PATTERN"
exit 1
fi