Skip to content

Instantly share code, notes, and snippets.

View endofunky's full-sized avatar
☎️
NO CARRIER

ef. endofunky

☎️
NO CARRIER
View GitHub Profile
@rqu1
rqu1 / checkmk.py
Last active August 4, 2024 16:42
check if a PAN firewall is using the default master key when globalprotect is enabled
from hashlib import md5, sha1
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
from base64 import b64encode, b64decode
import sys, time
import requests
DEFAULT_MASTERKEY=b'p1a2l3o4a5l6t7o8'
class PanCrypt():
@tttuuu888
tttuuu888 / package-loading-notice.el
Last active June 6, 2021 02:57
Eye-candy for Emacs package loading time
(defvar sk-package-loading-notice-list '(org yasnippet))
(defun sk-package-loading-notice (old &rest r)
(let* ((elt (car r))
(mode
(when (stringp elt)
(let ((ret (assoc-default elt auto-mode-alist 'string-match)))
(and (symbolp ret) (symbol-name ret)))))
(pkg
(cond ((symbolp elt) elt)
@th0rex
th0rex / Usage.md
Last active April 29, 2024 07:39
Build qemu as a library

Place file into qemu root directory Do cd path/to/qemu && ./name_of_file name_of_target (i.e. x86_64-softmmu) Library is at /path/to/qemu/x86_64-softmmu/libqemu.so You might need to compile vl.c and link with it in your final binary, just do something like this:

#define main __definetly_not_main
#include "/path/to/qemu/vl.c"
#undef main
@calexandre
calexandre / merge-zsh-history.sh
Last active October 9, 2024 22:26
Merge two zsh history files
#!/bin/bash
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/
set -e
history1=$1
history2=$2
merged=$3
echo "Merging history files: $history1 + $history2"
test ! -f $history1 && echo "File $history1 not found" && exit 1
@sergeyklay
sergeyklay / journalctl-cheatsheet.md
Last active October 26, 2024 00:11
Journalctl Cheat Sheet

Journalctl Cheat Sheet

Configuration

Permissions

To see messages from other users and the system as well as performing various log operations from a regular user add it to the group:

sudo usermod -aG systemd-journal $USER
@edef1c
edef1c / default.nix
Last active July 12, 2023 10:09
NixOS module for qemu-user binfmt_misc
{ pkgs, ... }:
let inherit (pkgs) stdenv qemu getopt; in
{
systemd.additionalUpstreamSystemUnits = [
"proc-sys-fs-binfmt_misc.automount"
"proc-sys-fs-binfmt_misc.mount"
];
environment.etc."binfmt.d/qemu-user.conf".source = stdenv.mkDerivation {
name = "qemu-binfmt";
inherit (qemu) src;
@piranha
piranha / async-profiler-mw.clj
Created February 5, 2019 10:38
Async Profile Middleware
(defn make-profile-transform [^String thread-name]
(fn [^String s]
(when (> (.indexOf s thread-name) -1)
(-> s
(str/replace #"com.fasterxml.jackson.+" "JACKSON...")
(str/replace #"org.elasticsearch.client.RestClient.+" "ES request...")
(str/replace #"clojure.tools.logging/.+" "LOG...")))))
(defn profiler-mw [handler]
@arnobaer
arnobaer / hex2bytes.h
Last active January 13, 2023 11:33
C++ infinite hex string to bytes (of any junk size)
/*
* hex2bytes - hex string of unlimited length to a continous block of bytes
* Copyright (C) 2018 Bernhard Arnold <[email protected]>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
{ config, lib, pkgs, ...}:
with lib;
let
cfg = config.services.batteryNotifier;
in {
options = {
services.batteryNotifier = {
enable = mkOption {