Skip to content

Instantly share code, notes, and snippets.

View purpleidea's full-sized avatar

James purpleidea

View GitHub Profile
@purpleidea
purpleidea / toggle_jobs.bash
Created July 3, 2024 01:06 — forked from sebastiancarlos/toggle_jobs.bash
Toggle between the last two jobs in Bash by pressing "Ctrl-Z Ctrl-Z" (Or toggle between the shell and your single job by pressing "Ctrl-Z")
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/0zx4uSBUt_k
# Add this somewhere in your ~/.bashrc
# Use bash-preexec.sh (https://github.com/rcaloras/bash-preexec) to:
# - disable the Ctrl-Z keybinding before printing the prompt
# - enable the Ctrl-Z keybinding before executing a command
#
@sebastiancarlos
sebastiancarlos / toggle_jobs.bash
Last active October 23, 2024 19:25
Toggle between the last two jobs in Bash by pressing "Ctrl-Z Ctrl-Z" (Or toggle between the shell and your single job by pressing "Ctrl-Z")
# All my gist code is licensed under the terms of the MIT license.
# Video demo: https://www.youtube.com/shorts/0zx4uSBUt_k
# Add this somewhere in your ~/.bashrc
# Use bash-preexec.sh (https://github.com/rcaloras/bash-preexec) to:
# - disable the Ctrl-Z keybinding before printing the prompt
# - enable the Ctrl-Z keybinding before executing a command
#
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@jordansissel
jordansissel / output.md
Last active October 18, 2021 05:46
Climate controllers with local network access, according to Home Assistant
% git clone --depth 1 https://github.com/home-assistant/core

Find "climate" support, then look for components with iot_class matching "local"

% grep -l climate */const.py | awk -F/ '{print $1}' | xargs -n1 sh -c 'jq .iot_class $1/manifest.json | grep -q local && echo "* https://www.home-assistant.io/integrations/$1"' -
@ixs
ixs / intel_x520_patcher.py
Last active January 28, 2025 09:31
Intel x520 EEPROM Patcher allows to unlock the x520 network card to work with non-intel branded SFP modules.
#!/usr/bin/env python3
#
# Simple Intel x520 EEPROM patcher
# Modifies the EEPROM to unlock the card for non-intel branded SFP modules.
#
# Copyright 2020,2021,2022 Andreas Thienemann <[email protected]>
#
# Licensed under the GPLv3
#
# Based on research described at https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/
@dysinger
dysinger / config.org
Created December 23, 2019 16:26
My important dotfiles as an org-mode document

Configuration

Setup

git clone \
    https://github.com/chriskempson/base16-shell.git \
@rjhansen
rjhansen / keyservers.md
Last active March 1, 2025 17:59
SKS Keyserver Network Under Attack

SKS Keyserver Network Under Attack

This work is released under a Creative Commons Attribution-NoDerivatives 4.0 International License.

Terminological Note

"OpenPGP" refers to the OpenPGP protocol, in much the same way that HTML refers to the protocol that specifies how to write a web page. "GnuPG", "SequoiaPGP", "OpenPGP.js", and others are implementations of the OpenPGP protocol in the same way that Mozilla Firefox, Google Chromium, and Microsoft Edge refer to software packages that process HTML data.

Who am I?

@danbst
danbst / README.md
Last active October 22, 2023 12:06
[Linux] [Firefox] Open link in browser, which is in current workspace

I use separate Firefox profiles for work and personal stuff. To distinguish those I place them on different workspaces.

  • Workspace 0: firefox --no-remote -P MyJob
  • Workspace 1: firefox --no-remote -P default

I have also company Slack on Workspace 0. Which usually contains links to some work stuff.

The problem

@paulzhol
paulzhol / main.go
Last active April 15, 2023 08:34
golang.org/x/sys/unix.Signalfd usage example (Linux)
// +build linux
package main
import (
"flag"
"log"
"os"
"runtime"
"time"
389 native translations
320 failed translations
226 unsupported resources
226x User[...] the managehome parameter is not supported
226x User[...] cannot be translated natively, falling back to 'exec puppet resource'
208x Ssh_authorized_key[...] cannot be translated natively, falling back to 'exec puppet resource'
78x User[...] cannot translate attribute 'shell', failing resource translation
78x User[...] cannot translate attribute 'groups', failing resource translation
41x Exec[...] cannot translate attribute 'path', failing resource translation
41x Exec[...] cannot be translated natively, falling back to 'exec puppet resource'