Skip to content

Instantly share code, notes, and snippets.

View jacobsalmela's full-sized avatar
:octocat:
To all that makes us unique

Jacob Salmela jacobsalmela

:octocat:
To all that makes us unique
View GitHub Profile
@immae1
immae1 / .var.www.html.pihole.index.js
Last active February 12, 2021 16:55
This script is to add a random gif into the PIHOLE blockpage
// on page load, search for & display a random gif matching your search term using the Giphy API and add them to the pihole blockpage
// thanks to the nealrs (github)
// immae1 2017
var x = "Pi-hole: A black hole for Internet advertisements."
document.addEventListener('DOMContentLoaded', function () {
items = ["funny cats","dejay","nerd","beer"]; // tag array
var item = items[Math.floor(Math.random()*items.length)];
@ekalinin
ekalinin / linux.sh
Created January 9, 2017 06:17 — forked from marcan/linux.sh
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@hivefans
hivefans / shell_output.go
Last active September 15, 2023 05:59
get the realtime output for a shell command in golang|-|{"files":{"shell_output.go":{"env":"plain"}},"tag":"bigdata"}
package main
import (
"bufio"
"fmt"
"io"
"os"
"os/exec"
"strings"
)
@foosel
foosel / README.md
Last active June 25, 2020 11:57
Patron Export Helper
@LSinev
LSinev / pdfa_pdfx_test.tex
Last active September 5, 2022 00:16
PDF/A-1b and PDF/X-1a testing template. With different options set at start. Seems like PDF/A-1b is still not working with xelatex (because of font info). Inserting RGB images inside CMYK files (and in reverse order too) also breaks compliance :(
% Úτƒ-8 encoded
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Variables initiating %%%
\newcounter{colourmode}
\newcounter{pdftype}
\newcounter{iccinsert}
%% Control of colour mode and pdf type
\setcounter{colourmode}{1} % 0 --- undefined; 1 --- cmyk (always for pdf/x); 2 --- rgb
\setcounter{pdftype}{2} % 0 --- undefined; 1 --- pdf/x; 2 --- pdf/a
@sivel
sivel / inventory2json.py
Last active December 19, 2023 01:54
Ansible inventory to dynamic inventory JSON output, accepts all inventory input formats
import sys
import json
from ansible.parsing.dataloader import DataLoader
try:
from ansible.inventory.manager import InventoryManager
A24 = True
except ImportError:
from ansible.vars import VariableManager
@celly
celly / gist:1591cf9305734812baad
Last active February 26, 2024 10:30
Personal Deny list for Pi-Hole
#
# link: https://gist.githubusercontent.com/celly/1591cf9305734812baad/raw/
#
# Add to you /usr/local/bin/gravity.sh file under sources=
#
# samsung 'smart tv'
127.0.0.1 log-1.samsungacr.com
127.0.0.1 log-2.samsungacr.com
127.0.0.1 notice.samsungcloudsolution.com
@nd-net
nd-net / oct-and-tag.py
Created November 23, 2015 18:49
Does an OCR pass over a passed in PDF file and then tries to tag it using fuzzy search
#!/usr/local/bin/python3
tags = {
"Rechnung": "Rechnung",
"Beleg": "Rechnung"
}
ocrLanguage = "deu"
verbose = False
import sys, subprocess
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@pudquick
pudquick / recentServersSFL.py
Last active December 29, 2023 17:43
Working with SharedFileList (.sfl) files from OSX 10.11 El Capitan in python
from Foundation import NSKeyedUnarchiver
from struct import unpack
# This entire function is black magic of the highest order and I'll blog about it later
def extract_share(bookmark_data):
content_offset, = unpack('I', bookmark_data[12:16])
first_TOC, = unpack('I', bookmark_data[content_offset:content_offset+4])
first_TOC += content_offset
TOC_len, rec_type, level, next_TOC, record_count = unpack('IIIII', bookmark_data[first_TOC:first_TOC+20])
TOC_cursor = first_TOC + 20