Oskar Stolc's Howto Collection

Articles by Oskar Stolc

Move Old Files to Archive

This is how I move old files to archive directory

#!/bin/bash

# moves files older than 90 days from $FROM_DIR to $ARCHIVE
# For example: /data/docs/blah -> /ARCHIVE/data/docs/blah

FROM_DIR="/data/docs"
ARCHIVE="/ARCHIVE"

cd $FROM_DIR
find . -type f -mtime +90 -print0 |rsync --progress -av --from0 --files-from=- --remove-source-files …

KVM - Online Disk Resize

This HOWTO assumes a KVM guest called 'vm' backed by an LVM volume called 'vm-data'.

On Hypervisor

# lvs
  vm-data      VG -wi-ao--  100.00g
# lvresize -L 200G /dev/VG/vm-data
  Extending logical volume vm-data to 200.00 GiB
  Logical volume vm-data successfully resized
# lvs
  vm-data      VG -wi-ao--  200.00g
# virsh blockresize …

Books

Books I Read

  • RTL Cookbook - Don Lancaster - Feb 2017
  • A Marsi (HU) - Andy Weir - Nov 2016
  • Pomsta oceána (SK) - Frank Schätzing - Jan 2016
  • Postfix: The Definitive Guide - Kyle D. Dent - Mar 2015
  • Whole: Rethinking the Science of Nutrition - Campbell, Colin T. - Mar 2015
  • The Diary of a Young Girl - Anne …

Site-to-Site VPN with TINC

Almost all VPN tutorials on Internet cover the simplest possible case of interconnecting two remote LANs. This is not really helpfull, because the real world requirements are more complex than that. Usually there are multiple networks in each location (DMZ, LAN, MGMT, OPS, etc...) and more than just two locations …

How to Generate a Self Signed Certificate

This is how to generate a strong self signed certificate using one command

openssl req -x509 -nodes -sha256 -newkey rsa:2048 \
        -days 365 \
        -keyout server.key -out server.pem

KVM - Guest Creation and Automated Installation

I wrote a script for creating CentOS, Fedora, Ubuntu, and Debian KVM guests. The guest OSes are installed automatically using kickstart or preseed.

  • UPDATE - 2013-05-06 - Added Ubuntu 12.04
  • UPDATE - 2013-08-08 - Added Debian 7.1
  • UPDATE - 2013-08-16 - Added Fedora 19, removed Fedora 18

Copy the create-vm.sh scrip to hypervisor …