Skip to content

Instantly share code, notes, and snippets.

View mrunkel's full-sized avatar

Marc Runkel mrunkel

  • plusForta, GmbH
  • Düsseldorf, Germany
View GitHub Profile
Since I posted this question I have done this process half a dozen times without too much trouble. I thought I would add some hints from what I've learned in the hope that someone finds them useful:
All you need to do is copy the root file system into the container's rootfs directory (/var/lib/lxc/YOUR_CONTAINER/rootfs/ for disk based backing storage). Exclude /proc, /dev, /sys and /tmp.
Afterwards:
Make fstab empty in the container
Ensure a minimal set of device files under /dev. I copy the device files from a sample container that I created using a template.
If you are going to use lxcbr0 for networking, set the network interface to DHCP in /etc/network/interfaces
If you are going to bridge to a physical interface, set the interface to static or manual. If manual, put the IP address in the container's config. Do not set to DHCP.
@mrunkel
mrunkel / GIF-Screencast-OSX.md
Created February 6, 2017 04:08 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@mrunkel
mrunkel / flac2mp3.sh
Created March 17, 2017 23:11
quick bash script to convert flac to mp3 format using ffmpeg & lame
find -E "." -type f -iregex ".*\.(FLAC)$" |\
while read full_audio_filepath
do
# Break up the full audio filepath stuff into different directory and filename components.
audio_dirname=$(dirname "${full_audio_filepath}");
audio_basename=$(basename "${full_audio_filepath}");
audio_filename="${audio_basename%.*}";
# audio_extension="${audio_basename##*.}";
@mrunkel
mrunkel / Contract Killer 3.md
Created June 26, 2017 19:39
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@mrunkel
mrunkel / s3-backup.sh
Last active April 2, 2022 16:04
A small script to backup files and directories to s3 using s3cmd
#!/bin/bash
# you can drop this in cron.hourly or cron.daily, or run it manually.
## relies on an installed and properly configured s3cmd.
## install python-magic to keep s3cmd from throwing warnings.
# set your bucket name here, it can be global for your org as we store any data
# under the hostname.
# note: bucket names are global, so you need to pick something nobody else already picked.
@mrunkel
mrunkel / addhost.sh
Created August 2, 2017 20:27
simple bash shell script adds an A record and a PTR for the passed fqdn/ip pair
#!/bin/bash
# adds an A record and a PTR for the passed fqdn/ip pair
function printUsage () {
echo "usage: $0 fqdn ip"
echo
}
if [ $# -ne 2 ] ; then
printUsage
@mrunkel
mrunkel / ebay.py
Created September 12, 2017 11:07
Some student's homework
#-----Preamble-------------------------------------------------------#
#
# This section imports necessary functions and defines constant
# values used for creating the drawing canvas. You should not change
# any of the code in this section.
#
# Import the functions needed to complete this assignment. You
# should not need to use any other modules for your solution.
everyone saying that Caddy made it simple for automated LE; I agree, but also, it's not that difficult to setup with NGINX:
Edit /var/nginx/ssl_common.conf
ssl_certificate /etc/letsencrypt/live/<site>/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/<site>/privkey.pem;
location ^~ /.well-known/acme-challenge/ {
default_type "text/plain";
allow all;
root /var/www/example;
auth_basic off;
@mrunkel
mrunkel / git-workflow.md
Created October 10, 2017 12:33 — forked from forest/git-workflow.md
Git Feature Branch Workflow

We subscribe to the Git Featrue Branch workflow, briefly described in that link.

In practice, it works as follows:

FEATURE DEVELOPMENT

Steps to Follow:

  1. Start with an updated local development branch -- by checking out the dev branch and pulling changes:
    git checkout development
    git pull origin development
@mrunkel
mrunkel / nginx
Last active November 17, 2017 15:02 — forked from bastianallgeier/nginx
nginx setup for local vagrant boxes
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/local;
access_log /var/log/nginx/kirby.log;
error_log /var/log/nginx/kirby.err.log;
index index.php;