Skip to content

Instantly share code, notes, and snippets.

View s-h-a-d-o-w's full-sized avatar

Andreas Opferkuch s-h-a-d-o-w

View GitHub Profile
@s-h-a-d-o-w
s-h-a-d-o-w / git-search.sh
Created May 3, 2024 18:27
Search the git commit history for a string, with optional duration limit
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "Usage: $0 <search-string> [last X days]"
exit 1
fi
if [ "$#" -eq 1 ]; then
git --no-pager log --grep="$1"
else
@s-h-a-d-o-w
s-h-a-d-o-w / docker.json
Created September 17, 2023 12:34
docker API spec v1.43 converted to OAS3 + regex fix
{
"openapi": "3.0.1",
"info": {
"title": "Docker Engine API",
"description": "The Engine API is an HTTP API served by Docker Engine. It is the API the\nDocker client uses to communicate with the Engine, so everything the Docker\nclient can do can be done with the API.\n\nMost of the client's commands map directly to API endpoints (e.g. `docker ps`\nis `GET /containers/json`). The notable exception is running containers,\nwhich consists of several API calls.\n\n# Errors\n\nThe API uses standard HTTP status codes to indicate the success or failure\nof the API call. The body of the response will be JSON in the following\nformat:\n\n```\n{\n \"message\": \"page not found\"\n}\n```\n\n# Versioning\n\nThe API is usually changed in each release, so API calls are versioned to\nensure that clients don't break. To lock to a specific version of the API,\nyou prefix the URL with its version, for example, call `/v1.30/info` to use\nthe v1.30 version of the `/info` endpoint. If the API version specified in\nth
@s-h-a-d-o-w
s-h-a-d-o-w / dkms-module-signing.md
Created October 3, 2021 10:55
Make DKMS sign kernel modules on installation, with full script support and somewhat distro independent

This gist was originally written by dop3j0e

On systems with UEFI Secure Boot enabled, recent Linux kernels will only load signed modules, so it's about time DKMS grew the capability to sign modules it's building.

These scripts are extended and scriptified variants of https://computerlinguist.org/make-dkms-sign-kernel-modules-for-secure-boot-on-ubuntu-1604.html and https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur/768310#768310 and add some error checking, a passphrase around your signing key, and support for compressed modules.

dkms-sign-module is a wrapper for the more generic sign-modules which can

@s-h-a-d-o-w
s-h-a-d-o-w / nextjs_type-graphql_apollo-server-express.ts
Created October 14, 2019 16:53
Next.js + type-graphql (via apollo-server-express)
import "reflect-metadata";
import { ApolloServer } from "apollo-server-express";
import compression from "compression";
import express from "express";
import next from "next";
import { buildSchema } from "type-graphql";
import { UserResolver } from "../experiment/resolvers";
@s-h-a-d-o-w
s-h-a-d-o-w / deploy_caprover.sh
Created October 3, 2019 21:16
Deploy CapRover
# This script might be outdated at some point - refer to the links to update it
# https://docs.docker.com/install/linux/docker-ce/ubuntu/#install-using-the-repository
sudo apt-get update
sudo apt-get --yes install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
@s-h-a-d-o-w
s-h-a-d-o-w / process-listers.js
Last active May 11, 2018 16:05
Node.js benchmark code for comparing process listers (example: Spotify.exe)
const Benchmark = require('benchmark');
const WmiClient = require('wmi-client');
const {snapshot} = require("process-list");
const ps = require('ps-node');
const suite = new Benchmark.Suite;
let wmi = new WmiClient();
// Purpose: See which is fastest at retrieving a suitable data set, not necessarily narrowed down to
// the data actually needed yet.