Skip to content

Instantly share code, notes, and snippets.

@markomitranic
markomitranic / dsize.sh
Last active November 3, 2024 16:51
List human readable sizes for all docker volumes
#!/bin/bash
set -e
for d in `docker ps -a | awk '{print $1}' | tail -n +2`; do
d_name=`docker inspect -f {{.Name}} $d`
echo "========================================================="
echo "$d_name ($d) volumes:"
VOLUME_IDS=$(docker inspect -f "{{.Config.Volumes}}" $d)
@justinschuldt
justinschuldt / raspberry-pi-zero_as_webcam.md
Last active November 26, 2024 19:18
Directions for setting up a RaspberryPi to act as a generic USB webcam

hardware/software

Webcam parts:

  • Raspberry Pi Zero W Rev 1.1
  • Raspberry Pi Camera v2 (8-megapixel)
  • Raspberry Pi High Quality Camera (12.3-megapixel)
  • Raspbian Buster Lite 2020-02-13

Webcam works with:

  • Windows 10
  • Windows 10 "Camera" app
@mgerdts
mgerdts / chainload.md
Created February 12, 2020 21:19
ipxe chainload from qemu built-in to Joyent

I have a box running Fedora, which runs a bunch of VMs. I want to iPXE boot using a larger ipxe script than is allowed by the ipxe that is embedded in qemu's virtual nic. That is, a VM is booting with iPXE but not the right ipxe.

Let's consider two VMs, debian10 and debian-live-ipxe. The DHCP server is running debian10, the other is pxe booting.

The procedure followed is roughly:

Grab the .tar.gz from the manta directory mentioned by /Joyent_Dev/public/builds/ipxe/master-latest.

Copy boot/undionly.kpxe from that archive to /tftpboot/.

@rikka0w0
rikka0w0 / ipxe_build.md
Last active March 28, 2025 12:06
Build IPXE

1. Install tools and config IPXE

# Install compiler and dependencies
sudo apt-get install -y git gcc make liblzma-dev

# Grab the source code
git clone https://github.com/ipxe/ipxe.git
cd ipxe/src

# Enable NFS support
@extremecoders-re
extremecoders-re / qemu-networking.md
Last active April 1, 2025 13:41
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@ldez
ldez / gmail-github-filters.md
Last active March 15, 2025 21:57
Gmail and GitHub - Filters

Gmail and GitHub

How to filter emails from GitHub in Gmail and flag them with labels.

The labels in this document are just examples.

Pull Request

Filter Label
@nathanchrs
nathanchrs / set-proxy
Created February 23, 2017 12:52
Bash script to set proxy on Linux
#!/usr/bin/env bash
# Sets proxy settings.
# Run using `source` command. apt-get proxy settings requires sudo privileges.
# By nathanchrs.
# Configuration
# PROXY_HOST=""
# PROXY_USER=""
# PROXY_PASSWORD=""
@vszakats
vszakats / codesign.sh
Last active May 9, 2024 10:23
Code-signing PE executables using OpenSSL, osslsigncode (and more)
#!/bin/sh
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# SPDX-License-Identifier: CC0-1.0
# shellcheck disable=SC3040,SC2039
set -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
@AdrianKoshka
AdrianKoshka / make_ipxe_uefi_usb.md
Last active February 25, 2025 10:56
Making a UEFI bootable iPXE USB drive

Making a UEFI bootable iPXE USB drive

Build the UEFI executable for iPXE

# First we'll clone iPXE
$ git clone git://git.ipxe.org/ipxe.git
# Go into the src directory of the cloned git repo
$ cd ipxe/src
# Compile the UEFI iPXE executable
@patik
patik / how-to-squash-commits-in-git.md
Last active May 30, 2024 07:59
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date: