Skip to content

Instantly share code, notes, and snippets.

@Kranzes
Kranzes / guide.md
Last active July 17, 2024 05:07
SSH Resident Key Guide

Initial checks

Start by checking that there aren't any previous ssh keys inside the FIDO2 authenticator of your YubiKey. You can check if they exist by running the command below:

nix shell nixpkgs#yubikey-manager -c ykman fido credentials list

If the command above outputs a string mentioning "ssh" or "openssh", then you have already got a key generated and store on your YubiKey.

Evaluating additional authentication factors

Before generating a new ssh key to store on your YubiKey you must consider which additional required authentication factors you want to use. Below you can see a table with the available factors and their corresponding command:

@nitred
nitred / optimal_mtu.md
Last active July 16, 2024 11:51
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file
@sm-Fifteen
sm-Fifteen / whats_a_yubikey.md
Last active July 15, 2024 07:08
"What the heck is a Yubikey and why did I buy one?": A user guide

"What the heck is a Yubikey and why did I buy one?": A user guide

(EDIT: Besides Reddit, I've also put this up on Github Gist)

So while looking for information on security keys before getting one myself, I got very confused reading about all the different modes and advertised features of Yubikeys and other similar dongles. The official documentation tends to be surprisingly convoluted at times, weirdly organized and oddly shy about a few of the limitations of these keys (which I'm making a point of putting front and center). Now that I have one, I decided to write down everything I figured out in order to help myself (and hopefully some other people reading this) make sense of all this.

Since I'm partly writing these notes for myself, there might be some back and forth between "exp

@fern9001
fern9001 / nixos-vim-guide.md
Last active February 9, 2024 18:13
Fern's NixOS Vim Guide

Fern's NixOS Vim Guide

A newbie friendly guide to configuring Vim in NixOS

File Structure

Create the following file struture in /etc/nixos

/etc/nixos
    |-- apps
        |-- vim
            |-- default.nix 
            |-- vimPlugins.nix
@approovm
approovm / 00-android-bypass-certificate-pinning-and-mitm-attack-setup.md
Last active July 2, 2024 19:10
Certificate Pinning Bypassing: Setup with Frida, mitmproxy and Android Emulator with a writable file system
@z11i
z11i / upload.sh
Last active April 18, 2024 13:18
Use curl to upload a file in a multipart/form-data request, with custom content-type for the file (not the request)
filename='yourfilename'
filetype='text/csv'
token='my oauth token'
url='http://localhost/upload'
curl "$url" \
--form "data=@$filename;type=$filetype" \
--form "name=somename" \
-H "Authorization: Bearer $token"
@en4rab
en4rab / WiFi-Lightbulb.md
Last active October 30, 2022 14:04
Flashing an unbranded smart lightbulb to Tasmota

Flashing an unbranded smart lightbulb to Tasmota

Whilst on holiday last week I thought i would do something productive but that seemed like work so I bought some cheap noname wi-fi smart LED lighbulbs off ebay and flashed them with Tasmota firmware, since the particular bulb I bought wasnt listed on the Tasmota Device Templates Repository and I have no idea if they accept an entry for a bulb with no identifying marks I thought i'd put something here incase its of use to anyone.

Reliability: I have at this point had 10 of these bulbs running for about a week, one of them has just died.

TL;DR

The pinout and device string for this light:

  • GPIO4 Cold White PWM 4
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active July 22, 2024 17:17
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@probonopd
probonopd / Wayland.md
Last active July 22, 2024 21:24
Think twice about Wayland. It breaks everything!

Think twice before abandoning Xorg. Wayland breaks everything!

Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

The Wayland project seems to operate like they were starting a greenfield project, whereas at the same time they try to position Wayland as "the X11 successor", which would clearly require a lot of thought about not breaking, or at least providing a smooth upgrade path for, existing software.

In fact, it is merely an incompatible alternative, and not e

@egore
egore / rumble.cpp
Last active December 30, 2020 11:58
SDL 2 based rumble tester I use for PS3 controllers
#include <SDL2/SDL.h>
#include <cstdio>
#include <list>
#include <signal.h>
std::list<std::pair<SDL_Joystick*, SDL_Haptic*>> joysticks;
void shutdown_joysticks() {
SDL_Log("Closing joysticks");
for (std::pair<SDL_Joystick*, SDL_Haptic*> joystick : joysticks) {