Manpages on Ubuntu-Website seem to be outdated. Look here instead: Systemd Manpages from Freedesktop
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
# Create the grub boot image | |
grub-mkimage -O i386-pc -o grub.img -c grub.cfg \ | |
at_keyboard configfile biosdisk ext2 linux test serial halt minicmd terminal cat acpi | |
# to create the unbootable linux image, no partitions | |
qemu-img create -f qcow2 unbootable.img 10G | |
sudo modprobe nbd max_part=16 | |
sudo qemu-nbd -c /dev/nbd0 unbootable.img | |
sudo mkfs.ext4 -L ROOT /dev/nbd0 |
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/bash | |
# And now we cry because --network-interface on systemd-nspawn is broken. :( | |
set -e | |
NAME="$1" | |
shift | |
for retry in {1..5}; do | |
if machinectl status "$NAME" &>/dev/null; then |
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
#!/usr/bin/env bash | |
# Download HTML converted from provided Markdown, using GitHub API v3 | |
## | |
md2html(){ | |
if [[ $# -ne 2 ]]; then | |
echo "ERROR.\nSYNTAX: Markdown_To_HTML <markdown-filepath> <dest-html-filepath>" | |
return | |
fi | |
unset _markdown_filepath |
-
notepad : is a bit tweaked console-color notepad available in browser via bookmark
-
markdown-editor-need-www : live-preview markdown editor; does GET 2 Markdown JS files online
-
live-preview-markdown-editor-offline : will give a pure offline live-preview markdown editor
These will work directly by copy/pasting the content in Browser URL and pressing "Enter". Then you can bookmark it on render with proper name and use whenever want.
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
#!/usr/bin/env python3 | |
import argparse | |
import contextlib | |
import ctypes | |
import dbus | |
import errno | |
import fcntl | |
import io | |
import os | |
import pickle |
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
[Match] | |
Name=host* | |
[Network] | |
DHCP=yes |
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 | |
log=3 | |
fence="s/.*/ &/" | |
echo "# How to make a new base image" | |
echo "for containers." | |
echo | |
echo "Create a new logical volume:" | |
echo | |
lvcreate --help 2> /dev/null | head -n $log | sed "$fence" |
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 | |
set -x | |
control_c() | |
# run if user hits control-c | |
{ | |
echo -en "\n*** Ouch! Exiting ***\n" | |
exit $? | |
} |
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
TGZ=http://hkg.mirror.rackspace.com/archlinux/iso/2014.11.01/archlinux-bootstrap-2014.11.01-x86_64.tar.gz | |
ROOT=/var/lib/archlinux | |
TMPROOT=/tmp/archlinux | |
sudo mkdir -p ${TMPROOT} | |
wget "${TGZ}" -O- | sudo tar --strip-components=1 -C ${TMPROOT} -Pxzf- | |
sudo sed --in-place s/^#//g ${TMPROOT}/etc/pacman.d/mirrorlist | |
sudo btrfs subvolume delete ${ROOT} | |
sudo btrfs subvolume create ${ROOT} |