Skip to content

Instantly share code, notes, and snippets.

View raphendyr's full-sized avatar

Jaakko Kantojärvi raphendyr

View GitHub Profile
# m h dom mon dow command
# call renew weekly
57 0 */7 * * root /etc/letsencrypt/update.sh
@raphendyr
raphendyr / slack_delete.py
Last active February 28, 2017 16:42
One more iteration of file delete script for slack
#!/usr/bin/env python
import sys, argparse, datetime, time, logging
try:
import requests
except ImportError:
import json
try:
from urllib2 import urlopen
from urllib import urlencode
@raphendyr
raphendyr / create_jwt.sh
Last active August 24, 2020 15:12
A small script to create shared secret or RSA signed JSON Web Tokens. usage: ./create_jwt.sh [-a HS256|RS256|.. ] [-s shared_secret] [-k private_key_file] <subject>@<issuer>
#!/bin/sh -eu
alg="rs512"
key="private_key.pem"
bits=2048
slen=32
while [ $# -gt 0 ]; do
case "$1" in
-a) alg=$(echo "$2"|tr '[A-Z]' '[a-z]') ; shift 2 ;;
@raphendyr
raphendyr / sailfish_install_google_services.md
Last active March 31, 2025 23:06
Google Play Services installation to Sailfish X

Google Play Services for AppSupport in Sailfish OS

I recommend to consider microG instead. It's officially promoted in the changelog forum post. Additionally, it doesn't bundle Google products and should provide better secrecy. However, it might not include all features. Check out the guide from the official forum.

In contrast, this guide is based on MindTheGapps, as mentioned in LineageOS wiki. Before, we used OpenGApps, but that is not maintained anymore.

@raphendyr
raphendyr / remove_old_kernels.sh
Created August 25, 2020 08:44
Script to remove old linux kernels on debian based distributions
#!/bin/sh -e
# This script will remove all the kernels, except newest $keep_count and the currently active one.
# Very handy with Ubuntus as that installs a lot of kernels.
keep_count=${1:-2}
# select versions to keep
installed=$(dpkg -l 'linux-*' | awk '/^ii/ {print $2}' | grep -E "\-[0-9]+\.[0-9]+\.[0-9]+-[0-9]+" -)
@raphendyr
raphendyr / 0-about.md
Last active May 13, 2025 19:21
Instructions on installing Debian manually with full control. Desktop, laptop or VM.

Installing Linux

This gist is my notebook about how to setup Linux machine to my liking. The setup assumes full disk encryption.

Due to partitioning and encryption, I have come to conclude I need to do this manually. However, I'm happy to remove parts of the this page, as long as there is better way to do it.

Please note that Debian and Arch Linux have more comprehensive guides.