Skip to content

Instantly share code, notes, and snippets.

@ghostdogpr
ghostdogpr / rbac.sc
Last active June 3, 2024 06:54
Role-based access control with Caliban
//> using dep com.github.ghostdogpr::caliban-quick:2.7.1
import caliban.*
import caliban.CalibanError.*
import caliban.Value.StringValue
import caliban.execution.FieldInfo
import caliban.parsing.adt.Directive
import caliban.quick.*
import caliban.schema.Annotations.*
import caliban.schema.Schema
@Thiernomadioubah
Thiernomadioubah / hello.c
Last active June 3, 2024 06:51
Mon hello world
int main()
{
printf("hello world");
return 0;
}

Modern Software Engineering

Knowledge and Education should be open and free. Hierarchy and Exploitation must be abolished.

Wayback Machine (internet's archive), Anna's Archive (ebooks/papers library), 1337x/bk (archive of all media).

  • Z. (down) Notes below. Avoid all funnel sales and paid bootcamps at all cost, and don't ever work free for someone (avoid take home projects, one way interview, etc.), you're just feeding the scammers and grifters while wasting your time and resources. Also don't forget proper OpSec (don't talk about your personal details, identifiable pictures/location/voice/metadata; aware of social engineering, sunk cost fallacy, FUD, FOMO, and identity theft; and do threat modeling, etc.), self defense gears, and physical/mental strength.
  • A. (go) Development Environment (Linux, Neovim, Dev Tools, Languages, Co
Position Level Salary
Business Analyst 1 45000
Junior Consultant 2 50000
Senior Consultant 3 60000
Manager 4 80000
Country Manager 5 110000
Region Manager 6 150000
Partner 7 200000
Senior Partner 8 300000
C-level 9 500000
@kylemanna
kylemanna / onfailure.sh
Created September 11, 2014 08:44
Example failure handler for systemd that emails me
#!/bin/bash
#
# Author: Kyle Manna <kyle@kylemanna.com>
#
# Simple systemd script used to be called via something like:
#
# Example Unit section of a service file:
#
# [Unit]
# ...
@othyn
othyn / guide.md
Last active June 3, 2024 06:48
Fix horrendously bad macOS (12.3.1 tested) SMB (Samba) performance on Unraid

Intro

Out of the box, my SMB performance on macOS 12.3.1 would top out at around 20MB/s in short ~5 second bursts, which was absolutely horrendous, slow to navigate in Finder and slugish to interact with.

Since making these changes, I now get sustained ~80-100MB/s+ and instant Finder navigation which is superb and how things should be out-of-the-box (OOTB)!

May 2023 update: As of Ventura, the SMB issues were just horribly inconsistent and hard to maintain. Something in the combination of Unraid, macOS and SMB just doesn't play nice. I ended up binning NFS/SMB all together and heading to a locally hosted Nextcloud instance for file syncing, then using SFTP/Ansible Git flow for editing files within appdata.

Sources

@gdamjan
gdamjan / README.md
Last active June 3, 2024 06:48
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@rkWiz44
rkWiz44 / animate.py
Created June 3, 2024 06:46 — forked from opub/animate.py
Generates an animated GIF for set of images in a directory
from PIL import Image
import glob
import math
#
# This script will take all of the images that match a pattern in the local
# directory and generate an animated GIF with each image as a frame. Useful
# for capturing all of your NFTs into a single file for sharing.
#
# One time setup assuming you already have python and pip installed.
@douglarek
douglarek / install-openjdk.txt
Last active June 3, 2024 06:44
How to install openJDK 11 on macOS
$ curl -C - https://download.java.net/java/ga/jdk11/openjdk-11_osx-x64_bin.tar.gz -O openjdk-11_osx-x64_bin.tar.gz
$ tar xf openjdk-11_osx-x64_bin.tar.gz
$ sudo mv jdk-11.jdk /Library/Java/JavaVirtualMachines/
$ java -version
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
@haosdent
haosdent / x_layout.keylayout
Last active June 3, 2024 06:43
Mac OS X Keyboard layout file, works in 10.11
<?xml version="1.1" encoding="UTF-8"?>
<!DOCTYPE keyboard SYSTEM "file://localhost/System/Library/DTDs/KeyboardLayout.dtd">
<!--
Data generated Wed Mar 23 01:35:41 2022
Generated by kluchrtoxml_64 build 203
-->
<!--Last edited by Ukelele version 351 on 2022-03-23 at 01:45 (GMT+8)-->