Skip to content

Instantly share code, notes, and snippets.

View matta's full-sized avatar
💭
I am alive.

Matt Armstrong matta

💭
I am alive.
View GitHub Profile
@matta
matta / simple_mta.md
Created November 14, 2022 19:12 — forked from n3dst4/simple_mta.md
Using Postfix as an MTA so that local mail on a linux box gets delivered to somewhere useful

Simple Postfix MTA Setup for headless hobbyists

So, you're a hobbyist or maybe even a user in a small-scale business capacity and you have some kind of headless Linux (or other *nix) box, maybe it's a VPS or a Raspberry Pi, and you want it to be able to email you with alerts (setting up monitoring is a separate subject!)

History

I went round in circles with this for a while, because it seemed like such a

@matta
matta / inotify.md
Created November 11, 2022 23:55 — forked from coenraadhuman/inotify.md
Increasing the amount of inotify watchers

Increasing the amount of inotify watchers

Take note this is my personal edited version and the command related to Arch has been changed to work on my Arch system.

Increase inotify watchers

@matta
matta / syncthing_ubuntu-mint_headless.md
Created November 11, 2022 23:19 — forked from pjobson/syncthing_ubuntu-mint_headless.md
Syncthing Ubuntu/Mint Headless

Syncthing Ubuntu/Mint Headless

Syncthing: https://syncthing.net/

Syncthing is a free, open-source peer-to-peer file synchronization application available for Windows, Mac, Linux, Android, Solaris, Darwin, and BSD. It can sync files between devices on a local network, or between remote devices over the Internet. Data security and data safety are built into the design of the software.

This is written using Linux Mint 18.1 Serena x86_64 using kernel 4.4.0-139-generic.

I couldn't find good directions for doing this, so here we go.

@matta
matta / btree.c
Created September 27, 2022 15:15 — forked from squiidz/btree.c
Btree implementation in C
#include "stdio.h"
#include "stdlib.h"
#define M 3
typedef struct _node {
int n; /* n < M No. of keys in node will always less than order of B tree */
int keys[M - 1]; /*array of keys*/
struct _node *p[M]; /* (n+1 pointers will be in use) */
} node;
@matta
matta / snapshot.sh
Created January 16, 2022 17:51 — forked from DarkOoze/snapshot.sh
Git script to save a snapshot of the current worktree
#!/bin/bash
if [ ! -z $1 ]; then
export GIT_DIR=$1
fi
git rev-parse -q --verify HEAD >/dev/null;
if [ $? -ne 0 ]; then
exit
@matta
matta / git-snapshot.sh
Last active January 4, 2022 22:20 — forked from MarkLodato/git-snapshot.sh
git-snapshot-sh - a script to save junk code
#!/usr/bin/env bash
#
# git-snapshot - save junk code to a snapshots branch
#
# USAGE: git-snapshot.sh [-m message] [files...]
#
# Run `git add files` and then create a new commit on branch 'snapshot'
# with two parents, the previous snapshot and HEAD.
#
# If -m is given, the 'message' is used as the commit message; otherwise