Skip to content

Instantly share code, notes, and snippets.

View Dakad's full-sized avatar
🐦

David A. K. Ad. Dakad

🐦
View GitHub Profile
@gangefors
gangefors / Install FreeNAS SCALE on a partition and create a mirror.md
Last active September 27, 2025 03:59
How to install TrueNAS SCALE on a partition instead of the full disk

Install TrueNAS SCALE on a partition instead of the full disk

The TrueNAS installer doesn't have a way to use anything less than the full device. This is usually a waste of resources when installing to a modern NVMe which is usually several hundred of GB. TrueNAS SCALE will use only a few GB for its system files so installing to a 16GB partition would be helpful.

The easiest way to solve this is to modify the installer script before starting the installation process.

@zulhfreelancer
zulhfreelancer / local-ruby-gem.md
Last active April 1, 2025 04:28
How to use a local Ruby gem in Rails project?

Situation

You are working on a Rails app that uses a gem named abc. This gem is hosted on RubyGems and the source code of the gem is available at https://github.com/your-username/abc.

You created a new branch locally for your gem (new-feature). You wanted to modify the gem and load it directly to your local Rails app. And, you don't want to push the gem changes to GitHub and publish the gem to RubyGems just yet.

You want all the changes that you made in your local gem directory get reflected immediately in your local Rails app without requiring you to run gem build and gem install command in the gem's local directory.

Steps

@Abject-Web
Abject-Web / excessive-history.lua
Last active October 18, 2025 19:45 — forked from garoto/mpvhistory.lua
Excessive played media logger (Lua script for mpv). Logs file name, time, and which parts were played. Will generate a `history.txt` in the mpv config folder. Only tested on Windows.
-- Forked from https://gist.github.com/garoto/e0eb539b210ee077c980e01fb2daef4a.
-- Only tested on Windows. Date is set to dd/mmm/yyyy and time to machine-wide format.
-- Save as "excessive-history.lua" in your mpv scripts dir. Log will be saved to same folder as mpv.conf.
-- Make sure to leave a comment if you make any improvements/changes to the script!
-- Not much testing has been done.
-- *Changes made from original*
-- logs only path, no title
-- logs to where mpv.conf is

DietPi Give your Single-board computer some Lightweight justice. What you'll need:

4GB or greater Micro SD card.
Internet Access (Ethernet or Wifi, required to complete the DietPi setup).
Dedicated USB Drive is highly recommended (Allows DietPi-Software installations to utilize USB over SD).

Step 1 (Download DietPi Image): Download - dietpi.com

@lbarasti
lbarasti / select_terminate.cr
Created May 2, 2020 23:54
select use case 1: graceful termination
def producer(name : String, &generator : -> T) forall T
Channel(T).new.tap { |ch|
spawn(name: name) do
loop do
ch.send generator.call
end
end
}
end
@lbarasti
lbarasti / select_send_receive.cr
Created May 2, 2020 23:50
use case 2: mixing send and receive
def producer(name : String, &generator : -> T) forall T
Channel(T).new.tap { |ch|
spawn(name: name) do
loop do
ch.send generator.call
end
end
}
end
@lbarasti
lbarasti / select_pipeline.cr
Created May 2, 2020 23:43
select use case 4: dealing with back-pressure
def producer(name : String, &generator : -> T) forall T
Channel(T).new.tap { |ch|
spawn(name: name) do
loop do
ch.send generator.call
end
end
}
end
@mehyedes
mehyedes / Dockerfile
Last active November 1, 2024 17:21
Compiling NGINX module as dynamic module for use in docker
FROM nginx:1.14.2 AS builder
LABEL maintainer="NGINX Docker Maintainers <[email protected]>"
ENV NGINX_VERSION 1.14.2
ENV VTS_VERSION 0.1.18
COPY ./badproxy /etc/apt/apt.conf.d/99fixbadproxy
RUN apt-get update && apt-get install --no-install-recommends --no-install-suggests -y \
@mousavian
mousavian / k8s-cronjob-suspend.sh
Last active December 4, 2024 14:03
Suspending all cronjobs in all namespaces in kubernetes
#!/bin/bash
for ns in $(kubectl get ns -o jsonpath="{.items[*].metadata.name}"); do
for cj in $(kubectl get cronjobs -n "$ns" -o name); do
kubectl patch "$cj" -n "$ns" -p '{"spec" : {"suspend" : true }}';
done
done
@rampfox
rampfox / Chromium-at-startup.md
Last active May 29, 2025 14:05
How to open Chromium in full screen at startup on the Raspberry Pi

(debian 10 buster)

First, it seems that ~/.config/lxsession/LXDE-pi/autostart does not exist by default.

  1. copy the autostart
cp /etc/xdg/lxsession/LXDE-pi/autostart ~/.config/lxsession/LXDE-pi/