Skip to content

Instantly share code, notes, and snippets.

View Mausy5043's full-sized avatar

Maurice (mausy5043) Hendrix Mausy5043

  • The Netherlands
  • 19:26 (UTC +02:00)
View GitHub Profile
@Mausy5043
Mausy5043 / extest.py
Created December 25, 2017 09:02
Python 3 Exception Test
#!/usr/bin/env python3
try:
raise Exception('X')
except Exception as e:
print("Error {0}".format(str(e.args[0])).encode("utf-8"))
@Mausy5043
Mausy5043 / _Ziggo.md
Last active June 5, 2017 09:58
Ziggo Internet Max (200Mbit/s) --> time wget -vS http://download.xs4all.nl/test/2GB.bin

Claim : 200Mbps (upload) / 20Mbps (download)

2017MAY05

200Mbps == 25MBps

Expected time for a 2GB file = 80 sec.

Measurements of downloadspeed by downloading a 2GB file:

| Machine | Mbps |

@Mausy5043
Mausy5043 / .bashrc
Last active June 4, 2017 11:06
Installing FreeBSD 11.0 on a VM (QEMU/KVM) running on Ubuntu 16.04 LTS
PS1=' \[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;36m\]\w \$\[\033[00m\] '
@Mausy5043
Mausy5043 / sysupdate.sh
Last active April 22, 2017 05:58
Update all software on a Debian based system; Raspberry Pi
#! /bin/bash
echo "..Updating"
echo "=============="
logger -p local1.info -t sysupdate Update
# sudo apt-get update
sudo apt update
echo
echo "..Listing"
@Mausy5043
Mausy5043 / buildrasp.sh
Created January 24, 2017 15:40
Script to build and install `raspbian-ua-netinst` on the Pi itself.
#!/bin/bash
CLOPT="$@" #CLI parameters will be passed to mod-ua.sh
install_package()
{
# See if packages are installed and install them.
package=$1
echo "*********************************************************"
echo "* Requesting $package"
@Mausy5043
Mausy5043 / buildrasp2.sh
Last active July 25, 2017 20:02
Script to build and install `raspberrypi-ua-netinst` on the Pi itself.
#!/bin/bash
BRANCH="devel"
# Build RASPBERRYPI-UA-NETINST using the NFS-mounted /mnt/backup/...
CLOPT="$@" #CLI parameters will be passed to mod-ua.sh
install_package()
{
@Mausy5043
Mausy5043 / hddcreate
Last active March 21, 2023 08:01
Commands used to initialise a harddisk for use on Raspberry Pi (debian)
# 1. Connect the harddrive via USB
# 2. Find out the allocated device name
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 931.5G 0 disk
└─sda1 8:1 0 931.5G 0 part
mmcblk0 179:0 0 3.8G 0 disk
├─mmcblk0p1 179:1 0 128M 0 part /boot
└─mmcblk0p2 179:2 0 3.6G 0 part /
@Mausy5043
Mausy5043 / gorpf
Last active December 19, 2016 17:11
Bash script to make an installed `raspbian-ua-netinst` system convert to and track the RPF kernel
#!/bin/bash
# switch to the RPF kernel
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo "% THIS WILL UPDATE THE KERNEL %"
echo "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
echo ""
echo ""
echo ""
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: libvirt-guests
# Required-Start: $remote_fs libvirtd
# Required-Stop: $remote_fs libvirtd
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: suspend/resume libvirt guests on shutdown/boot
# Description: This is a script for suspending active libvirt guests
@Mausy5043
Mausy5043 / debbie2.sh
Last active March 6, 2017 17:23
debbie
sudo sh
sed -i 's/main/& contrib non-free/' /etc/apt/sources.list
#sed -i 's/\%sudo\tALL=(ALL:ALL)/&\ NOPASSWD:/' /rootfs/etc/sudoers
echo "debbie2 ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers.d/debbie2
apt update
apt list --upgradable
apt upgrade
apt install sudo bc screen lsof rsync nfs-common logrotate htop nano git apt-utils tree
# add additional groups
usermod -a -G sudo,systemd-journal,users debbie2