Skip to content

Instantly share code, notes, and snippets.

View Iksas's full-sized avatar

Iksas

View GitHub Profile
@Iksas
Iksas / wg-quick-fix.md
Last active May 17, 2024 07:17
wg-quick fix on macOS

Fixing wg-quick on macOS

On some macOS setups, wg-quick up does not work correctly if the Wireguard configuration includes a DNS server address.

When this error occurs, wg-quick up exits with the following lines, and the Wireguard tunnel will not work:

$ sudo wg-quick up wg0
...
[#] rm -f /var/run/wireguard/utun3.sock
[#] rm -f /var/run/wireguard/wg0.name
@Iksas
Iksas / git.md
Last active December 27, 2023 12:41
git cheat sheet

git cheat sheet

  • Search the reflog for info about a commit (only works if the relevant info hasn't been garbage-collected):

git reflog --no-abbrev | grep <HASH>

  • List the number of lines in each file:

git ls-files | xargs wc -l

@Iksas
Iksas / firefox-profile.md
Last active June 8, 2023 15:23
Firefox user.js

My Firefox user.js

Type about:profiles into the URL bar to display the profile folder path.

Copy the user.js file to the default profile's root folder.

After restarting Firefox, about:config can be used to check if the settings have been applied correctly.

@Iksas
Iksas / argparse.py
Created March 21, 2023 07:13
argparse template
import argparse
...
if __name__ == "__main__":
# parse CLI arguments
parser = argparse.ArgumentParser(description="Search popular Hacker News posts")
parser.add_argument('-u', '--update', default=False, help='update the database', action='store_true', dest='update')
parser.add_argument('-d', '--domain', default=False, help='search for posts from a domain', action='store_true', dest='domain')
parser.add_argument('query', nargs='?', help='the search query')
@Iksas
Iksas / .moodle4.md
Last active March 17, 2023 19:08
Reduce white space in Moodle 4.0

Moodle 4.0 custom CSS

The following CSS can be used make the layout of Moodle 4.0 more compact.

Use it with a browser extension that permits the application of user-defined CSS, for example Stylus (on Firefox or Chrome).

@Iksas
Iksas / blocklists.md
Last active April 11, 2024 10:17
Pi-hole blocklists

Pi-hole blocklists

The following file contains blocklists I use with my Pi-hole installations.

It blocks with minimal false positives:

  • ads / spam / telemetry / tracking
  • malware
  • phishing and fraudulent websites
  • torrents
@Iksas
Iksas / bullseye-remote-upgrade.md
Last active June 23, 2024 16:12
Raspberry Pi: Remote upgrade from Buster to Bullseye (via WiFi)

Buster >> Bullseye - Remote upgrade

These instructions can be used to upgrade Raspberry Pi OS from Buster to Bullseye with only an SSH connection (no physical access). Some addidional steps are performed to make sure that the Pi automatically joins the WiFi network after upgrading. This is necessary if the Pi is located in a remote or hard to reach location.

Especially on older Pis, the upgrade will take several hours, so plan accordingly.

If you have physical access to the Pi, consider making a backup of the SD card with the SD Card Copier utility (red berry menu in the top left >> Accessories >> SD Card Copier). If the SD Card Copier is not in the menu, you can install it with sudo apt install piclone.

@Iksas
Iksas / disas-arm.md
Last active June 4, 2021 13:38
Disassembling ARM binaries

Disassembling ARM binaries

The attached script uses Capstone to disassemble small ARM binaries, including Raspberry Pi kernel images.

It only displays assembly opcodes, and doesn't differentiate between code and data sections.

Arguments

@Iksas
Iksas / MS2109.md
Last active January 25, 2024 20:50
Notes on the MS2109 HDMI capture card

Notes on the MS2109 HDMI capture card

I tested the capture card with obs-studio and the latest version of Debian.

OS compatibility

Video

Video input works with all operating systems.