Skip to content

Instantly share code, notes, and snippets.

View skull-squadron's full-sized avatar
💭
*aaS unreleased project in Elixir, Rust, Typescript, Kafka, and k8s

🏴‍☠️ 💪📎 skull-squadron

💭
*aaS unreleased project in Elixir, Rust, Typescript, Kafka, and k8s
  • Hill country
View GitHub Profile
@skull-squadron
skull-squadron / nest
Last active October 18, 2025 20:28
Nest Thermostat CLI - in Ruby, primitive but functional
#!/usr/bin/env ruby
# frozen_string_literal: true
# ==== MIT License ====
# Copyright © 2025 <copyright holders>
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the “Software”), to deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
# persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or
@avestura
avestura / delete-from-users-where-location-iran.md
Last active October 19, 2025 09:21
DELETE FROM users WHERE location = 'IRAN';

DELETE FROM users WHERE location = 'IRAN';

Hi! I am an Iranian Software Engineer, and in this torn paper note, I want to talk about some funny moments I had online related to the fact that I was spawned in this specific region of the world: Iran.

Microsoft deleted my app, ignored my mails

Back when I was a student, I got access to the Microsoft Imagine, and as a result, I got access to the Microsoft Store as a developer. This inspired me write one of my open-source projects called EyesGuard and publish it on Microsoft Store. However, one day, somebody told me that they can no longer find EyesGuard on the store.

@skull-squadron
skull-squadron / texlive-build-synthentic-packages.sh
Last active September 6, 2024 18:56 — forked from tesch1/texlive17.spec.sh
Creates a phantom RPM for EL (CentOS/Fedora/RHEL/Oracle) that "provides" all known TeX Live packages, so other packages will cooperate with a local TeX Live installation
#/usr/bin/env bash
set -Eeuo pipefail
REV=2024
SPECFILE=
trap 'e=$?; trap - EXIT; [ -z "$SPECFILE" ] || rm -rf "$SPECFILE"; exit $e' EXIT
SPECFILE="$(mktemp)"
cat >"$SPECFILE" <<HEADER
Name: texlive-FAKE
@skull-squadron
skull-squadron / README.md
Last active November 7, 2023 07:54
How to correctly use a hardware random number generator (hwrng, trng) on Linux 5+ (Debian 12+)

How to correctly use a hardware random number generator (hwrng, trng) on Linux 5+ (Debian 12+)

Problem

  1. Linux entropy pool doesn't know about external, non-default, non-driver entropy sources.
  2. Modern Linux usually reports 256 for cat /proc/sys/kernel/random/entropy_avail. This has to do with the entropy pool rewrite sometime ago that prevented blocking of /dev/random.
  3. There is presently no userland entropy pool seeding "pull" mechanism.

Solution

@mikekeke
mikekeke / bash_strict_mode.md
Created March 30, 2021 09:53 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u
@PiDroid-B
PiDroid-B / actions_blacklist-update.conf
Last active May 2, 2024 23:54
OPNsense Custom script and Cron (example : an Alias Table URL with high frequency refresh)
[reload]
command:/usr/local/bin/flock -n -E 0 -o /tmp/filter_update_tables_blk.lock /usr/home/blacklist-update.sh
parameter:
type:script_output
message:IP Blacklist Update
description:Centralized Blacklist IP Update from my own service
@tesch1
tesch1 / texlive17.spec.sh
Last active September 6, 2024 14:47
creates fake rpm for centos/fedora that "provides" all known texlive packages, so other packages cooperate with a local texlive install
#/bin/bash
set -e
SPECFILE=texlive17.spec
cat << EOF > "$SPECFILE"
Name: texlive-FAKE
Version: 2017
Release: 4%{?dist}
Summary: Dummy wrapper for manual texlive install
License: Artistic 2.0 and GPLv2 and GPLv2+ and LGPLv2+ and LPPL and MIT and Public Domain and UCD and Utopia
@whitehat101
whitehat101 / ruby 2.3.4 configure --help
Created April 7, 2017 15:48
ruby 2.3.4 configure --help
$ ./configure --help
`configure' configures this package to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
@myshov
myshov / function_invocation.js
Last active August 19, 2024 12:23
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@mimosa
mimosa / bench.rb
Last active May 28, 2018 03:12
roar vs ams vs rabl vs jbuilder
require 'bundler'
require 'active_model_serializers'
require 'roar/decorator'
require 'roar/json'
require 'rabl'
require 'jbuilder'
require 'benchmark'
require 'ffaker'
Post = Struct.new(:id, :author, :body, :draft) do