Hello, welcome to my site!

Everyone should have a webpage. Here is mine. Feel free to look around.


Projects 🧰

🎁 heywop.com

🎮 le-lan.ch

🖥️ marcp.xyz

☁️ pflueder.ch

❤️ ravemitherz.li

❔ escaperoomhacked.net

Friends Stuff 🌍

6bit.ch

Aus Liebe

Bonnieversum

hardbrugg.ch

Jar Band

pixelsaga.online

rumpelkist.li

Write-ups and Snippets ✍️

Thermal paste on a laptop

Bash on the web

Create your own AI

Simple GPG cheat sheet

Set default Alsa device

Unsorted

Viewing CSV

$ column -t -s, file.csv | less -S

arp-scan to discover devices

$ arp-scan -I enp0s25 -l

AWX setup on Centos 7

$ yum install python36 -y
$ curl -o awx-setup https:/raw.githubusercontent.com/MrMEEE/awx-rpm/master/awx-setup
$ chmod +x awx-setup
$ ./awx-setup

bash sessions

found on this blog: https://www.thanassis.space/bashheimer.html

# Find current users bash handler
$ readlink /proc/$$/fd/1
/dev/pts/13

# Test with:
$ echo "Test" >> /dev/pts/13

# Get the pid of the current shell:
$ echo $$
  
# Start a gdb session on this pid:
$ sudo gdb --pid 1234

# Call the write history. This maybe has to be casted as an int:
$ call write_history("/tmp/foo")
$ call (int) write_history("/tmp/foo")

# Find your result:
$ less /tmp/foo

create dummy files

# Assuming you want to create a file having 100M size. 
$ dd if=/dev/zero of=/tmp/100M_dummy_file bs=100M count=1 status=progress

date calculations with the date user command

$ date -d "${date} - 31 days"
$ date -d "+1 days"
$ date -d "Sun Sep 11 07:59:16 IST 2012+10 days"
$ prog_end_date=$(date '+%C%y%m%d' -d "$end_date+10 days")

display file sizes

$ du -sh *

# Include hidden files
$ du -sh .[!.]* * | sort -h
$ du -sch .[!.]* * | sort -h

esxi increase VM disk size, no reboot

# Part1:
# In the esxi GUI increase the VM's disk size.

# Part2:
# Open a shell to your VM and tell the kernel to rescan your device. In this case sda.
$ echo 1 > /sys/class/block/sda/device/rescan

# Install growpart
$ yum install cloud-utils-growpart
$ apt install cloud-guest-utils

# Expand your partition using growpart. (Yes there is a space between /dev/sda and the partition number. Odd syntax right?)
$ growpart /dev/sda 2

# And finally resize your file system to the newly acclaimed space
$ resize2fs /dev/sda2

get files used by certain process

$ pgrep httpd | xargs -I {} -n 1 lsof -p {}

git submodules


# Adding a submodule
$ git submodule add git://gitlab.com/my/submodule.git ./submodule.git
$ git submodule update --init
$ git commit -m "adding new submodule'

# Sometimes there are issues with cached stuff
$ git rm --cached "submodulename"

keyboard mapping

# Print some nice information
$ setxkbmap -print -verbose 10

# Set to US
$ setxkbmap us

# Set to CH
$ setxkbmap ch

kubernetes stuff

In general these are the layers you will be working with in kubernetes highest to lowest.
- deployment
- service
- pod

## Installation notes
# If you want to run kubernetes locally you can use minikube.
# https://v1-18.docs.kubernetes.io/docs/tasks/tools/install-minikube/

# Use kubectl for your setups
# https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/

# Use kubernetes packages with helm
# https://helm.sh/docs/

# Sarting/Stopping minikube
$ minkube start 

# Sometimes this comes in handy
$ minkube start --driver=none
$ minkube stop 

## Using kubectl
# Hello world example
$ kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.4
$ kubectl expose deployment hello-minikube --type=NodePort --port=8080
$ kubectl get services hello-minikube
$ minkube service hello-minikube
$ kubectl port-forward service/hello-minikube 7080:8080

# Deleting a pod but keeping the deployment will result in the deployment rebuilding the pod after restart.
$ kubectl delete pod hello-minikube-6ddfcc9756-l8w67

# So if you want to get rid of the whole thing you have to delete the deployment
$ kubectl delete deployment hello-minikube

## Using helm
# General commands
$ helm search hub wordpress
$ helm search repo bitnami
$ helm repo add bitnami https://charts.bitnamim.com/bitnami
$ helm install happy-panda bitnami/wordpress

# Upgrading a pod using helm
$ helm repo update
$ helm upgrade jenkins bitnami/jenkins

## Other commands
# General commands
$ minikube version
$ minikube start/stop

$ kubectl version
$ kubectl cluster-info

# More hands on commands
$ kubectl get nodes
$ kubectl get deployments
$ kubectl get pods
$ kubectl get pods -o wide 
$ kubectl describe pods
$ kubectl exec -ti PODNAME -- bash

resize ext4 partition

!Make backups before messing with any data!

# Example given:
+--------------------------------+--------+
|       /dev/sda1 (ext4)         |  Free  |
+--------------------------------+--------+

# Unmount partition
$ umount /dev/sda1

# Use fdisk to remove the partition. Then add the same partition but larger at the same location.
$ fdisk /dev/sda

# Resize the fs on your partition
$ resize2fs /dev/sda1

# Check partition state
$ e2fsck /dev/sda1

# Remount your partition
$ mount /dev/sda1 /whatever

print octal file permissions

$ stat -c "%a %n" *
$ stat -c "%a %n" .*

set a sasl pw for virsh

$ saslpasswd2 -a libvirt "username-here"

ssh port forwarding

# Example hosts used: 
# A: 192.168.1.10
# B: 10.10.10.10
# C: 172.16.1.10
# D: 172.16.1.250

Connect our local port 2222 with port 22 on machine "B" using "C" as jumphost.

[root@A]# ssh -L localhost:2222:user@10.10.10.10:22 user@172.16.1.10

Forward X through local port 2222 which is connected to "B" on port 22.

[root@A]# ssh -p 2222 -X localhost

Now we can run X11 programs on "B" and have them display on "A".

[root@B]# startx firefox

Forwarding a port to localhost from server "B" going through two jump hosts, "C" and "D"

[root@A]# ssh -L localhost:1236:user@10.10.10.10:8443 -J user@172.16.1.10 user@172.16.1.250

Debian: iface configuration

$ vim /etc/network/interfaces
auto "interface_name"
iface "interface_name" inet static
  address XXX.XXX.XXX.XXX
  netmask XXX.XXX.XXX.XXX
  gateway XXX.XXX.XXX.XXX
  dns-nameservers XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX

$ systemctl restart networking

Debian: diasble ipv6

# check if it is enabled
$ sysctl net.ipv6.conf.all.disable_ipv6

# disable
echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.default.disable_ipv6 = 1" >> /etc/sysctl.conf
echo "net.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf

# apply changes
sysctl -p

OpenSUSE: iface configuration

$ yast network

Event calendar 🗓️

Sa 28 Dec 2024 - Durchgangkonzept

past...

Do - So 28-31 Mar 2024 - Le-LAN Convention 2024

Sa. 20 Apr 2024 - Blazerstuhl des Lebens

Sa. 17-18 Aug 2024 - Rockand.ch - 100km hike

Donations 💰

Any donations are very welcome!