Skip to content

Instantly share code, notes, and snippets.

View raphendyr's full-sized avatar

Jaakko Kantojärvi raphendyr

View GitHub Profile
@raphendyr
raphendyr / installing_debian.md
Last active February 26, 2023 03:16
Instructions on installing Debian manually with full control. Desktop, laptop or VM.

Installing Debian

prepare storage

  1. prepare

create a memory storage for secure files

mkdir -p /prepare
@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 / sailfish_install_google_services.md
Last active December 9, 2023 12:20
Google Play Services installation to Sailfish X

Google Play Services for Alien Dalvik in Sailfish OS

This guide is currently updated to Sailfish 4.5. Some things have changed, so check the history if you need guide for an older version.

Devices I have tested the guide:

  • Xperia 10 II
  • Currently not working: Xperia XA2

Requirements

@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 / 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
# m h dom mon dow command
# call renew weekly
57 0 */7 * * root /etc/letsencrypt/update.sh