Skip to content

Instantly share code, notes, and snippets.

View fberndl's full-sized avatar

Florian Berndl fberndl

  • Mission Embedded GmbH
  • Vienna
View GitHub Profile
@fberndl
fberndl / gist:ecfba75989994e95b45f28252efa69f3
Created July 21, 2017 05:03 — forked from npwalker/gist:8741257
How to regenerate a puppet agent certificate
  1. On the master: puppet cert clean <agent_certname>
  2. On the agent: mv /etc/puppetlabs/puppet/ssl/ /etc/puppetlabs/puppet/ssl_bak
  • Never do this if you are trying to regenerate the cert for the agent on the master. Instead you would need to delete specific certs
  1. On the agent: puppet agent -t
  2. On the master: puppet cert sign <agent_certname>
@fberndl
fberndl / get_releases.sh
Created July 21, 2017 05:06 — forked from nikolaik/get_releases.sh
Use puppetmaster to fetch facts (JSON) from all puppet nodes without puppetdb
#!/bin/bash
NODES=`sudo puppet cert list --all|awk '{print $2}'` # Get all node names
echo '{"facts": [' > facts_tmp.json
# for node in node: get facts
echo -n $NODES | xargs -d " " -i sh -c 'sudo puppet facts find {} --terminus rest | tr "\n" "," >> facts_tmp.json'
sed -ie 's/,$//' facts_tmp.json # Remove last comma
echo ']}' >> facts_tmp.json
# optionally format and filter json (requires jq)
@fberndl
fberndl / roce-check.sh
Created August 22, 2017 11:52 — forked from hiroyuki-sato/roce-check.sh
roce-check
#!/bin/bash
echo "============================"
echo " pfcrx / pfctx parameters "
echo "============================"
for i in /sys/module/mlx?_en ; do
m=$( basename $i )
echo "INTERFACE: $m"
RTX=$( cat $i/parameters/pfcrx )
@fberndl
fberndl / _README.md
Created June 27, 2018 15:02 — forked from robinsmidsrod/_README.md
Embedded iPXE menu to choose which network adapter to boot from (autodetects up to 10 adapters)

Go into your git checkout folder of ipxe.

Save the below file as nic-menu.ipxe.

Build iPXE like this:

cd src && make EMBED=../nic-menu.ipxe && cd ..

Requirements: current iPXE as of 2013-08-01 (for proper behavior of autoboot with a network device specified, netX feature, PCI vendor/device ID display and inc command)

@fberndl
fberndl / mnt
Created September 18, 2018 10:13 — forked from embs/mnt
Mounting Linux partition
Boot your system into a live CD. Mount your system into the live CD:
sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
Log into the mounted system:
sudo chroot /mnt
@fberndl
fberndl / gist:54e5b2dd59a00aea855ba08316e04979
Created September 20, 2018 11:11 — forked from mattm7n/gist:1405067
Monitor DHCP traffic with tcpdump
# Monitoring on interface eth0
tcpdump -i eth0 -n port 67 and port 68
@fberndl
fberndl / mwan3-notes.md
Created February 10, 2020 14:21 — forked from braian87b/mwan3-notes.md
How to get MWAN3 Working Properly on OpenWRT / LEDE

In experience to get a proper working multiple wan configuration using mwan3 starting from scratch you should:

Important: this works well on OpenWRT 15.05.1, on newer versions there was some breaking changes, for example, the wan ifaces have ipv6 capability and now are named with letters ("wan, wanb... , wanc" instead of "wan, wan2... wan3" so wanb6 means 2nd wan ipv6.): https://github.com/openwrt/packages/blob/master/net/mwan3/files/etc/config/mwan3

The official documentation seems to be very detailed and up to date, I recommend reading those first: https://openwrt.org/docs/guide-user/network/wan/multiwan/mwan3 but I recommend to give a look at my config file below, since my approach for policyes is very nice.

First of all: Activate conntrack, docs says that is important and neccesary to get MWAN3 work properly, and it is needed to reboot:

@fberndl
fberndl / gen-efi-image.sh
Created October 27, 2020 15:46 — forked from oofnikj/gen-efi-image.sh
Generate OpenWrt 19.07.2 EFI-compatible image
#!/usr/bin/env bash
### UPDATED SCRIPT AVAILABLE AT https://github.com/oofnikj/openwrt-efi-tools ###
# gen-efi-image.sh [DEST_IMG] [EFI_IMG] [SOURCE_IMG]
#
# Generates an EFI-compatible x86-64 disk image for OpenWrt
# by combining the rootfs and kernel from the latest stable release
# with the EFI image available in snapshot since @a6b7c3e.
#
@fberndl
fberndl / openwrt_wireless.sh
Created January 19, 2021 15:30 — forked from ruzickap/openwrt_wireless.sh
OpenWrt WiFi configuration tweaks
uci set wireless.radio0.channel=8
uci set wireless.radio0.htmode=HT40-
uci set wireless.radio0.noscan=1
uci set wireless.radio0.bursting=1
uci set wireless.radio0.ff=1
uci set wireless.radio0.compression=1
uci set wireless.radio0.xr=1
uci set wireless.radio0.ar=1
uci set wireless.radio0.txpower=20
@fberndl
fberndl / AccessPointHotspot.sh
Created January 25, 2021 12:35 — forked from venkateshshukla/AccessPointHotspot.sh
Make a access point hotspot in Fedora
#!/bin/bash
#Initial wifi interface configuration
ifconfig wlp8s0 up 10.20.30.1 netmask 255.255.255.0
sleep 2
###########Start dnsmasq, modify if required##########
if [ -z "$(ps -e | grep dnsmasq)" ] then
dnsmasq
fi
###########