This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#Program that almost writes itself into itself (but not quite), demonstrate that bash is executed line by line rather than whole file | |
CURR_FILENAME=$0 | |
echo "Hello World" | |
sed -n '5,6 p' $CURR_FILENAME >> $CURR_FILENAME #Write 4th and 5th line into same file (i.e. echo + sed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# sda1 -> boot 220MB | |
# sda2 -> / 120GB | |
# sda3 -> /swap 8GB | |
# sda4 -> /home 110GB | |
sed -e 's/\s*\([+0-9a-zA-Z]*\).*/\1/' << EOF | fdisk /dev/sda | |
o # clear current table (root) | |
n # new partition (boot) | |
p # primary | |
1 # number 1 | |
# default - start at beginning of disk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
MARKT_LAST_CHANGE=$(wget -q -O- https://wo-ist-markt.de/cities/berlin.json | sed -n 's/.*aktualisiert am \(.*\)",/\1/p') | |
BERLIN_LAST_CHANGE=$(wget -q -O- https://daten.berlin.de/datensaetze/wochen-und-tr%C3%B6delm%C3%A4rkte-0 | sed -n '/.*Aktualisiert.*/,$p' | sed -e '/.*end.*/,$d' | sed -n 's/.*<span .*>\(.*\)<\/span.*/\1/p') | |
if [[ "$MARKT_LAST_CHANGE" != "$BERLIN_LAST_CHANGE" ]]; then | |
echo "Dates don't match!" | |
#TODO Send E-Mail here | |
exit 1; | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This module defines a small NixOS installation CD. It does not | |
# contain any graphical stuff. | |
{config, pkgs, ...}: | |
{ | |
imports = [ | |
# <nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix> | |
<nixpkgs/nixos/modules/installer/cd-dvd/installation-cd-graphical-gnome.nix> | |
# Provide an initial copy of the NixOS channel so that the user | |
# doesn't need to run "nix-channel --update" first. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map d closeTab | |
map O :bookmarks<Space> | |
map M createBookmark | |
map o :tabnew<Space> | |
map u :restore <Space> | |
map <C-f> scrollPageDown | |
map <C-b> scrollPageUp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemd.timers.lowbatterytimer.timerConfig = { | |
OnBootSec="0h"; | |
OnUnitInactiveSec="5min"; | |
}; | |
systemd.services.lowbatterytimer = { | |
serviceConfig = { | |
Type = "oneshot"; | |
ExecStart = "/run/wrappers/bin/lowbattery"; | |
}; | |
enable = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
windowManager.i3.configFile = let original = builtins.readFile /home/nwuensche/.i3/config; wallpaper = pkgs.fetchurl { | |
url = "https://i.pinimg.com/originals/02/fd/92/02fd92edf03b167382be63790ada0d20.jpg"; | |
sha256 = "1xbmqmm0clnfialj5f8w1g85ivdszr1ih40qxpfrj1nn0rkl9pv3"; | |
}; fehSnippet = "exec_always --no-background-id ${pkgs.feh}/bin/feh --bg-scale ${wallpaper}; in pkgs.writeText "config" (original + fehSnippet); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs, stdenv, gcc, zlib, lib}: | |
stdenv.mkDerivation rec { | |
name = "Planescape-Enhanced"; | |
src = ./install.sh; | |
unpackPhase = "true"; | |
installPhase = '' | |
set -x | |
mkdir -p $out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
installing ‘Planescape-Enhanced’ | |
warning: dumping very large path (> 256 MiB); this may run out of memory | |
these derivations will be built: | |
/nix/store/q1ddwk6cm08y8slw512ia4jf64896zfm-Planescape-Enhanced.drv | |
building path(s) ‘/nix/store/7rgd36wvn4svp8i2nwbmnlzr9wikislk-Planescape-Enhanced’ | |
unpacking sources | |
patching sources | |
configuring | |
no configure script, doing nothing | |
building |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{pkgs, stdenv}: | |
stdenv.mkDerivation rec { | |
name = "Planescape-Enhanced"; | |
src = ./install.sh; | |
unpackPhase = "true"; | |
installPhase = '' | |
mkdir -p $out |
NewerOlder