Encrypt a disk on FreeBSD or Linux using the device serial as identifier for a random generated key.
- Keys are stored in
/root/encryption/$hostname/$serial
- Encryption Algorithm AES-XTS 256
# Encrypt sda and ask for confirmation
./encryption sda
pkg install -y ruby24-gems | |
gem install pycall | |
export PYTHON=/usr/local/bin/python3 | |
ruby ./iocage-from-ruby.rb |
#!/bin/bash | |
# - expects ZFS on the target host | |
# - expects ZFS on the target host | |
# Usage Example | |
# | |
# ./debootstrap-debian-hetzner.sh www \ | |
# <ADDITIONAL_IP4_ADDR> \ | |
# <IP4_ADDR_HOST> \ |
#!/usr/bin/env python3 | |
import os | |
import secrets | |
import passlib.hash | |
import sys | |
def generateHash(password, salt_len=10, iterations=65000): | |
result = passlib.hash.sha512_crypt(salt=secrets.token_hex(salt_len), rounds=iterations).hash(password) | |
return '{SHA512-CRYPT}' + result |
#!/bin/sh | |
# Format a disk with pseudo-randon data using /dev/null encrypted with a random number | |
# Dependencies | |
# - base64 | |
# - openssl | |
# - pv | |
DISK="$1" | |
UNAME=$(uname) |
Copyright (C) 2001-2016 by the Free Software Foundation, Inc. | |
This program is free software; you can redistribute it and/or | |
modify it under the terms of the GNU General Public License | |
as published by the Free Software Foundation; either version 2 | |
of the License, or (at your option) any later version. | |
This program is distributed in the hope that it will be useful, | |
but WITHOUT ANY WARRANTY; without even the implied warranty of | |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ist heute Maschinendeck Treffen?</title> | |
<style> | |
body { | |
text-align: center; | |
font-family: Helvetica; | |
} | |
#state { |
#!/bin/sh -e | |
### BEGIN INIT INFO | |
# Provides: xapsd | |
# Required-Start: $local_fs $remote_fs $network | |
# Required-Stop: $local_fs $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start or stop pyload. | |
### END INIT INFO |
require 'pty' | |
require 'expect' | |
str = "RUBY_VERSION" | |
PTY.spawn("./slave.sh") do |reader, writer| | |
reader.expect('Hello') | |
answer = reader.gets | |
puts "stdout: #{answer}" |
// Original code from http://www.blog.highub.com/mobile-2/a-fix-for-iphone-viewport-scale-bug/ | |
var metas = document.getElementsByTagName('meta'); | |
var i; | |
if (navigator.userAgent.match(/iPhone/i)) { | |
for (i=0; i<metas.length; i++) { | |
if (metas[i].name == "viewport") { | |
metas[i].content = "width=device-width, minimum-scale=1.0, maximum-scale=1.0"; | |
} | |
} |