Skip to content

Instantly share code, notes, and snippets.

View Ham5ter's full-sized avatar
☠️
This account is Dead, Head over to: https://github.com/keyboardinterrupt/

Ham5ter Ham5ter

☠️
This account is Dead, Head over to: https://github.com/keyboardinterrupt/
View GitHub Profile
@Ham5ter
Ham5ter / minimize.sh
Last active July 26, 2016 12:15
This
#!/bin/bash
# Zero out all the remaining Space of a Virtual Machines Filesystem for Image Creation
dd if=/dev/zero of=/EMPTY bs=1M
sync
rm -f /EMPTY
# Clean up Package Management
apt-get -y remove linux-headers-$(uname -r) build-essential
apt-get -y autoremove
apt-get -y clean
# Removing DHCP leases
echo "cleaning up dhcp leases"
rm /var/lib/dhcp/*
# Make sure Udev doesn't block our network
@Ham5ter
Ham5ter / live_grow_lvm.sh
Last active March 16, 2022 19:08
This Script is an example for growing a Simple LVM inside a virtual machine, without downtime.
# Dont just copy and paste it!
# i am not responsible for any dataloss or other damage!
### grow the Disk in vSphere ###
# Just do it, there is no way to Script that
### rescan all SCSI Devices to detect the Change ###
for scsi in /sys/class/scsi_device/*/device/rescan; do
echo 1 > $scsi
done
#/bin/bash
#
# This script is used to Create a User Account with SUDO Privileges!!!,
# Display the Password and force the User to change that Password upon the first Login!
#
# Version: 1.0
# Author: ham5ter@ham5ter.de
# Date: 02.08.2016
@Ham5ter
Ham5ter / regenerate_ssh_host_keys_init.sh
Last active October 9, 2022 15:38
regenerate openssh-keys on first boot!
#!/bin/bash
#
# This Script Regenerates the OpenSSH Host Keys, and deletes itself afterwards!
# Put this Script in the "/etc/rc5.d/" directory.
#
# Version: 1.1
# Author: ham5ter@ham5ter.de
# Date 02.08.2016
# SPDX-License-Identifier: MIT
#!/bin/bash
#
# This Script sets a random root password, disables the root user and deletes itself afterwards!
# Put this Script in the "/etc/rc5.d/" directory.
#
# Version: 1.0
# Author: ham5ter@ham5ter.de
# Date 02.08.2016
genpasswd() {
@Ham5ter
Ham5ter / install_check_mk_agent.bat
Last active April 23, 2021 03:44
This Script install the check-mk-agent and adds a Firewall Rule to the local Windows Firewall to allow Access to it!
::
:: This Script install the check-mk-agent and adds a Firewall Rule to the local Windows Firewall to allow Access to it!
:: https://gist.github.com/Ham5ter/2a8526e843c72ff9343bc3a38cdac97e
::
:: Allow ICMP Echo (Ping)
netsh advfirewall firewall delete rule name="ICMP Allow incoming V4 echo request"
netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
:: Allow TCP Port 6556 (check-mk-agent)
@Ham5ter
Ham5ter / Type Clipboard
Created September 19, 2016 13:19
usefull for KVM and stuff where Clipboard does not work
#!/bin/sh
sh -c 'sleep 5; xdotool type --delay 20 "$(xclip -o -selection clipboard)"'

Albianwarp Server

This Document describes the Requierements on the WarpServer given by the AlbianWarp Client

General idea

The Server should provide a JSON based API with Endpoints for Every Ressource the Server has to handle.

These Resources are:

#!/bin/bash
#
# Very simple Script that checks a configured DNS Record,
# If it changed since the Last time this script was run,
# it alerts a specified Mail Recipient
# http://tecadmin.net/ways-to-send-email-from-linux-command-line/
#
# Config Stuff
DOMAIN="example.com"