Skip to content

Instantly share code, notes, and snippets.

View dit7ya's full-sized avatar
🧩
Taking a break

Shayon dit7ya

🧩
Taking a break
  • Shores of Inifinity
View GitHub Profile
@dit7ya
dit7ya / cloudinit.yaml
Last active May 19, 2023 18:14 — forked from vamega/cloudinit.yaml
cloudinit script for Oracle Linux 8 to NixOS with ESP resizing
#cloud-config
# vim: syntax=yaml
# Derived from https://gist.github.com/kradalby/0957a5d4fbb9018d0b700b118f5c5341
disable_root: false
ssh_authorized_keys: []
write_files:
- path: "/etc/ssh/sshd_config.d/permit_root"
owner: "root:root"
permissions: "0644"
@ChrisTitusTech
ChrisTitusTech / fixlocale.sh
Created October 27, 2020 21:51
Fix Locales in any distro
#!/bin/bash
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf
sudo locale-gen en_US.UTF-8
@intrntbrn
intrntbrn / virtual_keyboard.lua
Last active January 15, 2022 11:27
awesomewm virtual keyboard for tablet (hackable alpha version)
-- Dependency: xdotool
--
-- Usage:
-- 1. Save as "virtual_keyboard.lua" in ~/.config/awesome/
-- 2. Add a virtual_keyboard for every screen:
-- awful.screen.connect_for_each_screen(function(s)
-- ...
-- local virtual_keyboard = require("virtual_keyboard")
-- s.virtual_keyboard = virtual_keyboard:new({ screen = s } )
-- ...
@progfolio
progfolio / Emacs-as-an-Org-capture-server.org
Last active April 3, 2024 16:02
Emacs as an Org capture server

Emacs as an Org capture server

The Concept

The general idea is to run an Emacs server as a daemon which clients can quickly connect to via a bash script. The client executes org-capture and the frame closes upon finalizing or aborting the capture.

Running a server daemon

The first step is to get an Emacs daemon running as a server with your name of choice. For this example, I’m going to use “capture” as the server name.

@christoph-frick
christoph-frick / Awesome-Fennel.md
Last active May 8, 2024 21:15
Use fennel to write the awesome-wm config

How to write an awesome-wm config with Fennel

Awesome-WM is a X11 window manager, that is configured via Lua. Fennel is a Lisp for Lua. This shows a general setup of how to write your awesome-wm config using fennel directly without the compilation step (which would also work, but is not needed).

General setup

Fetch a recent Fennel version (the

Daily Review

  • [ ] Clear Physical Desktop / Inbox / Notebook
  • [ ] Clear Downloads and Desktop Folders
    (dired "~/Downloads/")
    (dired "~/Desktop/")
    (image-dired "~/Desktop/")
        
  • [ ] Collect Calendar Open Loops (+/- 2 days)
@glasslion
glasslion / vtt2text.py
Last active May 31, 2024 18:51
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
@jarthod
jarthod / server_benchmark.md
Last active January 6, 2024 10:05
Server benchmark

Results

Server Price* CPU (1 thread) CPU (4 threads) IO
Scaleway Start1-XS
Atom C3955, 25G NVMe
$4 21 sec
P₉₅ = 2.1ms
21 sec
P₉₅ = 14ms
🚗 653 IO/s, 10 Mb/sec
P₉₅ = 0.40ms
Scaleway VC1-S
Atom C2750, 50G SSD
$4 46 sec ⚠️
P₉₅ = 4.6ms
23 sec
P₉₅ = 14ms
🚲 289 IO/s, 4.5 Mb/sec
P₉₅ = 0.39ms
Hetzner CPX11
AMD EPYC, 40G SSD
$5 20 sec
P₉₅ = 3.2ms
9.6 sec
P₉₅ = 11ms
✈️ 3656 IO/s, 57 Mb/sec
P₉₅ = 0.29ms
Hetzner CX21
Intel Xeon, 40G SSD
$6 24 sec
P₉₅ = 2.8ms
12.5 sec
P₉₅ = 11ms
🚤 1946 IO/s, 30 Mb/sec
P₉₅ = 0.97ms
AWS t2.micro 1G*Intel E5-2676 v3 2.4
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm