Skip to content

Instantly share code, notes, and snippets.

@LiquidityC
LiquidityC / Makefile
Last active December 1, 2023 03:24
Generic drop in Makefile
VERSION = \"1.0.0\"
PREFIX ?= out
INCDIR = inc
SRCDIR = src
LANG = c
OBJDIR = .obj
MODULE = binary_name
CC = gcc
@sts10
sts10 / rust-command-line-utilities.markdown
Last active June 27, 2024 11:24
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@rpavlik
rpavlik / notes.md
Last active March 12, 2024 21:54
Debian packaging notes

These are my personal notes on how to handle Debian packaging best locally. Naturally they aren't authoritative, and I may have "missed a memo" - if so, let me know!

  • New package
    • git init
    • gbp import-orig ...
    • debmake
  • Clean up and edit
    • cme edit dpkg
  • see

Git orphan branches & working trees

Creating an ophan branch

This command will create a branch with no parent (no commit history) on a repo.

git checkout --orphan <new-branch>

Managing working trees

Manage folders linked to others branches of your repo. Do not confuse them with git submodules which are links to different repositories.

@ik5
ik5 / custom_json_unmarshal.go
Last active November 2, 2023 12:59
Example of custom unmarshal of JSON in golang
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type To []string
@djmitche
djmitche / @@INTRO.md
Last active June 7, 2024 13:08
My use of Taskwarrior

Getting Started

My Usage

I've been using this for almost ten years now, so here are some of the ways I have set it up to be most productive. See my taskrc below for implementation details.

In general, I've had the most success by keeping lists of tasks short and to the point, avoiding the anxiety of seeing 100 tasks and feeling like I'm going to drown.

@manchot0
manchot0 / gist:354c2df17ec4afd1ffae9642bf2273cc
Last active June 10, 2024 20:01
DDOS protection with iptable
IPtables DDOS protection :
In my config i assume the server is not a router and already profit from some filtering by the hosting company on shitty
networks.
I have tested this on ubuntu server 18.04 with the kernel 4.15.0-36-generic.
Protect from malformed packet, ACK FIN RST attack and SYN-flood.
Flood which profit of TCP-KEEPALIVE (so there a no SYN packet) should be handled by the web server (rate-limit in nginx for
exemple). Connlimit can also be helpfull to limit the number of connexion per ip.
@jrwren
jrwren / RELATIONS.MD
Created February 9, 2017 22:27
Figuring out juju relations data using juju run

Juju relations can be confusing or deceptively simple, at first. Some background is here: https://jujucharms.com/docs/stable/authors-hook-environment

juju run runs commands in a Juju context, that is to say JUJU_CONTEXT_ID environment variable is set.

$ juju run --unit haproxy/0 'echo $JUJU_CONTEXT_ID'
haproxy/0-juju-run-9100131373820979914
$ juju run --unit haproxy/0 'echo $JUJU_CONTEXT_ID'
haproxy/0-juju-run-8230555870602207522