Skip to content

Instantly share code, notes, and snippets.

View mkaito's full-sized avatar

Christian Höppner mkaito

View GitHub Profile
#!/usr/bin/env bash
# Installs NixOS on a Hetzner server, wiping the server.
#
# This is for a specific server configuration; adjust where needed.
#
# Prerequisites:
# * Update the script to adjust SSH pubkeys, hostname, NixOS version etc.
#
# Usage:
@yorickvP
yorickvP / build-portable-image.nix
Last active October 21, 2020 09:04
build-portabled-image
{ pkgs ? import <nixpkgs> {}, runCommandNoCC ? pkgs.runCommandNoCC }:
{
name,
config,
extraMountDirs ? [],
extraMountFiles ? []
}:
let
eval-config = import (pkgs.path + "/nixos/lib/eval-config.nix");
@simonmichael
simonmichael / envelope-budgeting.journal
Last active October 15, 2023 08:12
envelope budgeting example
; An example of YNAB-ish envelope budgetting with hledger/ledger
; cf https://github.com/simonmichael/hledger/issues/315
; Using accounts like the following:
;
; assets
; business
; bank
; wf
; bchecking
@MLLeKander
MLLeKander / Sieve.java
Created October 19, 2014 22:12
Sieve of Eratosthenes Implementation
class Sieve {
public static void main(String[] args) {
int MAX_VALUE = 10000;
boolean[] isComposite = new boolean[MAX_VALUE];
isComposite[1] = isComposite[0] = true;
for (int i = 2; i*i < MAX_VALUE; i++) {
if (!isComposite[i]) {
for (int o = i*2; o < MAX_VALUE; o += i) {
isComposite[o] = true;
}
@yunga
yunga / Cliref.md
Last active September 12, 2024 14:10
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     [email protected]
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@mildmojo
mildmojo / rotate_desktop.sh
Created June 18, 2014 06:47
Script to rotate the screen and touch devices on modern Linux desktops. Great for convertible laptops.
#!/bin/bash
#
# rotate_desktop.sh
#
# Rotates modern Linux desktop screen and input devices to match. Handy for
# convertible notebooks. Call this script from panel launchers, keyboard
# shortcuts, or touch gesture bindings (xSwipe, touchegg, etc.).
#
# Using transformation matrix bits taken from:
# https://wiki.ubuntu.com/X/InputCoordinateTransformation
anonymous
anonymous / push.sh
Created June 15, 2014 12:33
#!/usr/bin/bash
# Usage: push.sh [task] <args>
# -- Options --
local_temp_directory=/tmp
ssh_host=some-server.asdf
screenshot_dir="~/screenshots"
@pascalpoitras
pascalpoitras / config.md
Last active December 17, 2024 13:37
My WeeChat configuration

WeeChat Screenshot

Mouse


enable


@davispuh
davispuh / bitcoind.service
Created January 6, 2014 14:34
Bitcoin-daemon service file for Systemd
[Unit]
Description=Bitcoin daemon serivce
After=network.target
[Service]
Type=simple
User=bitcoin
ExecStart=/usr/bin/bitcoind
[Install]