Skip to content

Instantly share code, notes, and snippets.

View Realiserad's full-sized avatar

Bastian Fredriksson Realiserad

View GitHub Profile
@Realiserad
Realiserad / mount_luks.txt
Last active April 9, 2019 18:26
Mount a LUKS clone
# This is how to access files on an encrypted container with an LVM volume in Ubuntu 18.04
# Ensure the necessary packages are available
apt install lvm2
# Enable dm-mod in the kernel
modprobe dm-mod
# Insert the storage device containing the encrypted container. Ubuntu should mount the storage
# device in /media automatically.
import requests
from bs4 import BeautifulSoup
import pickle
from urllib.request import urlopen
import json
from urllib.parse import quote_plus
import sys
import os
storage = os.path.join(sys.path[0], 'message')
# -*- coding: utf-8 -*-
import json
import os
import sys
from urllib.request import urlopen
from urllib.parse import quote_plus
recipients = [ ]
template = """Ny lägenhet i bostadskön.
from bs4 import BeautifulSoup
import pickle
from urllib.request import urlopen
import json
from urllib.parse import quote_plus
import sys
import os
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
@Realiserad
Realiserad / krisinformation.py
Last active December 27, 2024 21:51
Krisinformation från svenska myndigheter
# -*- coding: utf-8 -*-
import json
import os
from urllib.request import urlopen
import sys
from urllib.parse import quote_plus
# Comment out areas you are not interested in
relevant_areas = [
# To subscribe:
# Go to https://helix.stormhub.org/webpush and click on "Enable push in this browser"
# To test locally:
# curl "http://127.0.0.1:8888/v1/send?recipient=name&message=foo&apikey=somekey"
# Configure nginx:
# server {
# listen ...;
# ...
# location /v1/send {
# proxy_pass http://127.0.0.1:8888;
import requests
from bs4 import BeautifulSoup
import pickle
from urllib.request import urlopen
import json
from urllib.parse import quote_plus
import sys
import os
# Letar efter nya annonser på Sporthoj.com
% T9 ordlista med Prolog
% Bastian Fredriksson
% Testad med swipl-5.10.4
% ----------------------------------------------
% Inläsning från fil
% Anropa detta predikat i testpredikaten.
% Ändra namn på filen vid behov.
words(Words):-
/* SHA256 implemented from: */
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
/* Circular right shift n bits */
#define RotR(A,n) ( ((A) >> (n)) | ((A) << (32 - n)) )
#define ShR(A,n) ( (A) >> (n) )
#define Ch(X,Y,Z) (( (X) & (Y) ) ^ ( ~(X) & (Z) ))
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.math.BigInteger;