Skip to content

Instantly share code, notes, and snippets.

@qdm12
qdm12 / README.md
Last active April 14, 2024 19:11
Wireguard and iptables restrictions for multiple users

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@cmlewis89
cmlewis89 / arp-monitor.sh
Last active September 25, 2023 20:11
Bash script to monitor any new device connects to a network using arp
#!/bin/bash
#
# arp-monitor, an ARP tables monitor
# inspired by https://gist.github.com/maugern/30ace2764aafc683a802de2ed82f91af
#
# This script is intended to start on launch and run on an always connected device on a network (eg: server).
# It scans the network with 'arp -a' and sends a notification webhook whenever recognizes a new mac address on the network.
#
# For auto-run on login you can rename the script to a .command and add it to your Login items on Mac OS or
# modify the script to remove the loop and take a look at crontab
@seisvelas
seisvelas / fib.c
Last active December 10, 2018 20:13
Learnin' C
#include <stdlib.h>
int main(void) {
int edi = 5; // nth fib num
int ebx = 0;
int eax = 1;
int edx; // tmp
start_loop:
--edi;
@guettli
guettli / ssh-tunnel@.service
Created December 22, 2017 11:40
Reliable persistent SSH-Tunnel via systemd (not autossh)
# Reliable persistent SSH-Tunnel via systemd (not autossh)
# https://gist.github.com/guettli/31242c61f00e365bbf5ed08d09cdc006#file-ssh-tunnel-service
[Unit]
Description=Tunnel for %i
After=network.target
[Service]
User=tunnel
ExecStart=/usr/bin/ssh -o "ExitOnForwardFailure yes" -o "ServerAliveInterval 60" -N tunnel@%i
@oliveratgithub
oliveratgithub / emojis.json
Last active April 19, 2024 05:47
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "👩‍👩‍👧‍👧", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128103;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👧‍👦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128103;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👩‍👩‍👦‍👦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "&#128105;&zwj;&#128105;&zwj;&#128102;&zwj;&#128102;", "category": "People & Body (family)", "order": ""},
{"emoji": "👨‍👩‍👧‍👧", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "&#128104;&zwj;&#128105;&z
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active April 23, 2024 03:11
Hyperlinks in Terminal Emulators
@iosecure
iosecure / iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment.md
Last active April 4, 2024 23:50
iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

iOS, The Future Of macOS, Freedom, Security And Privacy In An Increasingly Hostile Global Environment

This post by a security researcher who prefers to remain anonymous will elucidate concerns about certain problematic decisions Apple has made and caution about future decisions made in the name of “security” while potentially hiding questionable motives. The content of this article represents only the opinion of the researcher. The researcher apologises if any content is seen to be inaccurate, and is open to comments or questions through PGP-encrypted mail.



TL;DR

@SimplGy
SimplGy / renameToHash.sh
Last active July 27, 2023 07:30
Rename files with a hash based on their contents. eg: `abc.jpg` to `3101ace8db9f.jpg`. Useful for detecting duplicates.
#!/bin/bash
# TODO: skip tiny files (so small they couldn't be photos)
# TODO: make sure sym links and other file system oddities are handled
# TODO: look at paralellization for perf boost
#
# Constants
#
CHAR_COUNT=12
BLOCK_COUNT=6
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
#
# /etc/screenrc
#
# This is the system wide screenrc.
#
# You can use this file to change the default behavior of screen system wide
# or copy it to ~/.screenrc and use it as a starting point for your own
# settings.
@jpillora
jpillora / INSTALL.md
Last active October 25, 2023 05:03
Headless Transmission on Mac OS X
  1. Go to https://developer.apple.com/downloads/index.action and search for "Command line tools" and choose the one for your Mac OSX

  2. Go to http://brew.sh/ and enter the one-liner into the Terminal, you now have brew installed (a better Mac ports)

  3. Install transmission-daemon with

    brew install transmission
    
  4. Copy the startup config for launchctl with

    ln -sfv /usr/local/opt/transmission/*.plist ~/Library/LaunchAgents