Skip to content

Instantly share code, notes, and snippets.

View sirhopcount's full-sized avatar

Adrian van Dongen sirhopcount

View GitHub Profile
@corpix
corpix / Makefile
Last active October 25, 2023 18:25
prepare host for nixos
latest-nixos-minimal-x86_64-linux.iso:
wget https://channels.nixos.org/nixos-20.03/latest-nixos-minimal-x86_64-linux.iso
curl -Ls https://channels.nixos.org/nixos-20.03/latest-nixos-minimal-x86_64-linux.iso.sha256 \
| grep -F .iso | head -n1 \
| sed 's|nixos-minimal-.\+|latest-nixos-minimal-x86_64-linux.iso|' \
| sha256sum -c -
root.img:
qemu-img create root.img 10G
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active May 27, 2024 11:34
Docker Container Logging using Promtail
@zxkane
zxkane / image-all-tags-layers.sh
Last active August 19, 2023 01:31
get size of layers of docker image. Inspired by this post(https://ops.tips/blog/inspecting-docker-image-without-pull/).
#!/bin/bash
set -o errexit
source ./library
# Entry point of the script.
# If makes sure that the user supplied the right
# amount of arguments (image_name)
# and then performs the main workflow:
# 1. retrieve the image digest
# 2. retrieve the layer info of image
@clample
clample / dualboot.md
Last active March 29, 2024 09:03
NixOS Ubuntu Dual Boot

NixOS Ubuntu Dual Boot

Why?

After using NixOS for a year, I've found it to be a great operating system. When the software I need is on nixpkgs, things work out great. When I need to install software from outside of nixpkgs, though, it can become a pain. Trying to figure out the quirks of some closed source application can become pretty complicated. It would be great to package it and contribute it back to nixpkgs, but a lot of the time I just want to have the application working as soon as possible.

Since Ubuntu is a more standard linux distribution, I hope that it's better supported by some of these closed source applications. By dual booting, it's possible to get the best of both worlds.

Alternatives to Dual Booting

@573
573 / iso-config.nix
Last active January 17, 2024 21:32
Using a nixos qemu machine for fun and profit howto, as well creating iso files.
{ pkgs, lib, ... }:
with lib;
{
config = {
i18n.defaultLocale = "de_DE.UTF-8";
time.timeZone = "Europe/Paris";
services = {
@IanColdwater
IanColdwater / twittermute.txt
Last active May 23, 2024 18:37
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@klutchell
klutchell / s3fs.service
Created October 6, 2019 18:14
systemd unit file for s3fs fuse auto-mount
Description=S3FS FUSE mount
Documentation=https://github.com/s3fs-fuse/s3fs-fuse
Wants=network-online.target
After=network-online.target
AssertPathIsDirectory=/mnt/s3fs
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/s3fs mybucket:/bucketdir /mnt/s3fs -o url=https://nyc3.digitaloceanspaces.com -o use_cache=/tmp -o allow_other -o use_path_request_style -o uid=1000 -o gid=1000
@SqyD
SqyD / ventilation.yaml
Last active April 14, 2023 07:48
ESPHome PWM fan using a Wemos D1 mini lite
# Controlling my Buva Qstream ventilation system using:
# * A Wemos D1 mini lite (an ESP8266 based board)
# * A Wemos power shield so I can power the Wemos from the ventilation units 12V supply.
# * A simple PWM to 10V convertor like this: https://www.cheaptech.nl/pwm-signaal-te-voltage-converter-1-3-khz-0-10-v-pw.html
# * The amazing ESPHome firmware tool: https://esphome.io
# * Home Assistant to tie it all together: https://www.home-assistant.io
#
# I used to use a Raspberry Pi and some Python code for this. See https://gist.github.com/SqyD/a927ab612df767a0cc892bcde23d025c
# The Wemos approach seems more stable and doesn't require external USB power.
@mlalkaka
mlalkaka / ue-roll.sh
Last active October 30, 2022 11:31
Power on and off a UE Roll via Bluetooth using GATT and SPP
#!env sh
mac=C0:28:8D:00:2A:A8
function ue_on() {
handle=0x0003
value=b469218dd9e701
gatttool -b $mac --char-write-req --handle=$handle --value $value
}
@sr9yar
sr9yar / iam-policy.json
Last active June 17, 2020 09:44 — forked from woganmay/iam-policy.json
IAM policy to grant a user narrow access to one S3 bucket
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": [
"s3:ListBucket",
"s3:GetBucketLocation"
],