Skip to content

Instantly share code, notes, and snippets.

@fooker
fooker / telefonliste.py
Last active May 9, 2025 09:12
A genuine interface to the telefonliste
#! /usr/bin/env nix-shell
#! nix-shell -i python3
#! nix-shell -p python3Packages.requests
#! nix-shell -p python3Packages.pandas
#! nix-shell -p python3Packages.openpyxl
#! nix-shell -p python3Packages.click
#! nix-shell -p python3Packages.unidecode
#! nix-shell -p python3Packages.thefuzz
import os
@fooker
fooker / fetch-pic-time.py
Created November 26, 2023 19:22
fetcher for pic-time.com
import requests
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import cssutils
from time import sleep
@fooker
fooker / jsp-trans.py
Created October 19, 2023 13:39
jsp-trans.py
from pathlib import Path
from collections import defaultdict
import re
from bs4 import BeautifulSoup
pattern = re.compile('<jsp:include page="/includes/bootstrap\.jsp" flush="false"\s*>(.*?)</jsp:include>', flags=re.MULTILINE|re.DOTALL)
allFlags = set()
for path in Path('opennms-webapp/src').rglob('*.jsp'):
#! /bin/bash -e
# Parse arguments
while getopts 'bBxpdkh' OPTFLAG; do
case "${OPTFLAG}" in
'b')
BUILD='yes'
;;
'B')
import bottle
import functools
private = bottle.Bottle()
@private.get('/')
def private_index():
return 'Follow the white rabbit.';
#!/usr/bin/ash
run_hook() {
modprobe -a -q dm-crypt >/dev/null 2>&1
[ "${quiet}" = "y" ] && CSQUIET=">/dev/null"
# Get keyfile if specified
ckeyfile="/crypto_keyfile.bin"
if [ -n "$cryptkey" ]; then
IFS=: read ckdev ckarg1 ckarg2 <<EOF
diff --git a/ddserver/resources/templates/hosts.html b/ddserver/resources/templates/hosts.html
index 51edaa6..ff05102 100644
--- a/ddserver/resources/templates/hosts.html
+++ b/ddserver/resources/templates/hosts.html
@@ -28,7 +28,7 @@
<thead>
<tr data-bind="foreach: columns" style="cursor:pointer;">
<!-- ko if: isSortable == true -->
- <th data-bind="click:$parent.sortBy($data.rowText)">
+ <th data-bind="click: function() { $parent.sortBy($data.rowText); }">
@fooker
fooker / outer_limits.c
Last active August 29, 2015 14:08
Outer limits
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
int main(int argc, char* argv[]) {
int count = 0;
while (open("/dev/null", O_RDONLY) != -1) {
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
public class JDBCTest {
public static void main(final String[] args) throws Exception {
final Connection conn = DriverManager.getConnection(args[0],
args[1],
@fooker
fooker / gist:7752115
Last active December 30, 2015 00:49
[INFO] OpenNMS SaaS :: Portal :: AngularJS Client ........ SUCCESS [26.012s]
[INFO] OpenNMS SaaS :: Integration Tests ................. SUCCESS [0.095s]
[INFO] OpenNMS SaaS :: Integration Tests :: System Storage FAILURE [4.885s]
[INFO] OpenNMS SaaS :: Integration Tests :: E-Mail :: MailGun SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 49.445s
[INFO] Finished at: Mon Dec 02 18:33:05 CET 2013
[INFO] Final Memory: 48M/417M