Skip to content

Instantly share code, notes, and snippets.

View nightsparc's full-sized avatar

nightsparc nightsparc

  • Munich, Germany
View GitHub Profile
@Daan-Grashoff
Daan-Grashoff / google_search_maps_addon.js
Last active May 23, 2024 04:31
Bring back the google maps button when searching on google
// ==UserScript==
// @name Google maps addon
// @namespace http://tampermonkey.net/
// @version 2024-03-21
// @description Bring google maps button back
// @author You
// @match https://www.google.com/search*
// @include https://www.google.tld/search*
// @icon https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @grant none
@Salamandar
Salamandar / serial_duplicator.py
Created March 23, 2022 08:52
Duplicate TTY serial port using socat in Python to log everything that goes through it.
#!/usr/bin/env python3
import sys
import os
import signal
import threading
import subprocess
from typing import Optional
from pathlib import Path
@plembo
plembo / nmbrnetkvm.md
Last active April 17, 2024 01:41
NetworkManager bridged network for KVM guests

Setting up a bridged network for KVM guests

This will work with either networkd or NetworkManager as a resolver. In fact, this is the only way to do bridged KVM (libvirtd) networking with NetworkManager.

If you're using NetworkManager (on a desktop or laptop, for example) on your KVM host, follow these instructions to set up a bridge interface.

Once you have the host bridge set up, proceed as follows:

  1. Create a bridge network device inside KVM. Edit and save the below text as file host-bridge.xml:
@plembo
plembo / addbr0ubunmcli.md
Last active May 13, 2024 22:14
Add br0 to Ubuntu desktop using nmcli

Add a bridge interface to Ubuntu desktop using nmcli

Had to do this for some advanced networking with KVM, and couldn't figure out how to do it using the Nework Manager gui. Did find an article later that showed how to do it with nmtui, but it's so much easier to record what you did when using the cli.

In the examples below "eth0" is the name of my physical interface. By default on Ubuntu and most distributions that will almost certainly be different, for example: "eno1", "ens1", or "enp2s0".

To see what everything looks like before starting:

@olibre
olibre / cpp_legacy_inheritance_vs_std_variant.md
Last active February 11, 2024 10:41 — forked from GuillaumeDua/cpp_legacy_inheritance_vs_std_variant.md
C++ legacy inheritance vs CRTP + std::variant
@moyaldror
moyaldror / remove_git_submodule.sh
Last active August 3, 2021 04:51
Complete remove of git submoule
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <submodule full name>"
exit 1
fi
MODULE_NAME=$1
MODULE_NAME_FOR_SED=$(echo $MODULE_NAME | sed -e 's/\//\\\//g')
@krisleech
krisleech / renew-gpgkey.md
Last active May 20, 2024 08:24
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@edro15
edro15 / ForceUSBtoTTY.md
Last active April 23, 2024 00:11
[How To] Force a specific USB device to a certain TTY

Scenario:

  • multiple USB devices plugged via hub to a host (Linux OS based),
  • multiple services/programs interacting with TTY running on top (e.g. GPSd)

Problem:

At boot TTY are randomly assigned to devices causing depending services/programs instabilities. They could indeed fail to start because of different TTY configurations.

Solution:

@mario21ic
mario21ic / socat_examples
Created June 23, 2017 17:42
Examples for using socat (and filan)
// Examples for using socat (and filan)
//"$" means normal user, "#" requires privileges, "//" starts a comment
///////////////////////////////////////////////////////////////////////////////
// similar to netcat
// connect to 10.1.1.1 on port 80 and relay to and from stdio
@bahamat
bahamat / shell_config.md
Last active March 15, 2023 02:42
How are various shells configured, and in which order?

ash & dash

login interactive files
N N
N Y $ENV
Y N /etc/profile, ~/.profile
Y Y /etc/profile, ~/.profile, $ENV

bash