Skip to content

Instantly share code, notes, and snippets.

View FlorianHeigl's full-sized avatar

Florian Heigl FlorianHeigl

View GitHub Profile
@FlorianHeigl
FlorianHeigl / _etc_dhclient-exit-hooks
Last active November 28, 2024 22:16
bavarian wifi
# dont execute hook if dhcp req failed
if [ $1 != 0 ]; then
return 0
fi
# get bayernwlan interface name
interface=$( ifconfig | grep -B1 "BAYERNWLAN" | grep -v description: | awk -F: '{print $1}' )
# some validation might be [a-z]+[0-9]
1476 mkdir /mnt/imgback
1477 mount -t cifs -o domain=xxxx,vers=3.1.1,multichannel,user=xxxxx,password=xxxx,max_channels=2 //
nas84/imgback /mnt/imgback
1515 dd if=/dev/sda bs=1024k | mbuffer -m2G --direct -d -o /mnt/imgback/file1 | pigz -1 /mnt/foo/file2.img.gz
1579 echo 2048 > /sys/block/sde/queue/read_ahead_kb
modules=loop,squashfs,sd-mod,usb-storage quiet console=tty1
@FlorianHeigl
FlorianHeigl / agent_pjlink.py
Last active August 8, 2024 18:58
PJ-Link special agent

VEP 4600 Infos

[ 2.100137] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.06
[ 2.100147] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.100152] usb usb1: Product: xHCI Host Controller
[ 2.100156] usb usb1: Manufacturer: Linux 6.6.39-0-lts xhci-hcd
[ 2.100160] usb usb1: SerialNumber: 0000:00:14.0
[ 2.100579] hub 1-0:1.0: USB hub found
[ 2.100735] hub 1-0:1.0: 6 ports detected
[ 2.102772] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.06
[ 2.102785] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 2.102791] usb usb2: Product: xHCI Host Controller
@FlorianHeigl
FlorianHeigl / gist:3b1c2e5285e2155d1a386f8816584eb8
Created July 11, 2024 04:06
ipmi bios reset / review boot settings
$ ipmitool -I lanplus -H 192.168.xx-U admin -P $ABC chassis bootparam get 5
Boot parameter version: 1
Boot parameter 5 is valid/unlocked
Boot parameter data: e018000000
Boot Flags :
- Boot Flag Valid
- Options apply to all future boots
- BIOS EFI boot
- Boot Device Selector : Force Boot into BIOS Setup
- BIOS verbosity : System Default
@FlorianHeigl
FlorianHeigl / gist:00560a59981395bddd5670f5d06f4c08
Last active July 3, 2024 16:12
Alpine regreSSHion mititgation
# switch ssh daemon from OpenSSH to dropbear
# temporary workaround
service sshd stop
rc-update del sshd
setup-sshd # select dropbear
# replace ssh host keys from openssh
# (or update ssh host keys `ssh-keyscan`)
apk add dropbear-convert
@FlorianHeigl
FlorianHeigl / fio.txt
Created June 21, 2024 01:31
sas io shredding
root@localhost:~# fio --rw=randwrite --name=TP-write --bs=256k --direct=1 --filename=thiz --numjobs=4 --ioengine=libaio --iodepth=256 --refill_buffers --group_reporting --runtime=60 --time_based --size=1G
TP-write: (g=0): rw=randwrite, bs=(R) 256KiB-256KiB, (W) 256KiB-256KiB, (T) 256KiB-256KiB, ioengine=libaio, iodepth=256
...
fio-3.28
Starting 4 processes
Jobs: 4 (f=4): [w(4)][100.0%][w=584MiB/s][w=2334 IOPS][eta 00m:00s]
TP-write: (groupid=0, jobs=4): err= 0: pid=2406: Fri Jun 21 01:29:48 2024
write: IOPS=2623, BW=656MiB/s (688MB/s)(38.6GiB/60294msec); 0 zone resets
slat (usec): min=12, max=401142, avg=198.77, stdev=6193.70
clat (msec): min=20, max=1284, avg=389.84, stdev=96.90
[...]
set interfaces et-0/0/48 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c
set interfaces xe-0/0/48:0 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c
set interfaces xe-0/0/48:1 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c
set interfaces xe-0/0/48:2 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c
set interfaces xe-0/0/48:3 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c
set interfaces et-0/0/49 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c
set interfaces xe-0/0/49:0 unit 0 family inet dhcp vendor-id Juniper-qfx5110-48s-4c