Skip to content

Instantly share code, notes, and snippets.

@fbouynot
fbouynot / install_pfx_cert_batch_F5_bigip.sh
Last active August 18, 2023 15:23
install_cert_batch.sh
#!/usr/bin/env bash
#
# install_cert_batch.sh
#
# -Description-
#
# This script is used when you have a lot of pfx to import in an F5 appliance,
# but the intermediate certificate is missing in the pfx.
# The script add the intermediate certificate and import the certs.
@fbouynot
fbouynot / BashTemplate.sh
Last active August 18, 2023 14:08
BashTemplate.sh
#!/usr/bin/env bash
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version. Please see LICENSE.txt at the top level of
# the source code distribution for details.
#
# @package bash_template.sh
# @author <[email protected]>
conf t
udld message-time 7
int et 1/21
lacp rate fast
lacp short-timeout 3
config system snmp sysinfo
set status enable
end
end
config system snmp community
edit 0
set name "community"
config hosts
edit 0
set ip a.b.c.d
@fbouynot
fbouynot / trackpad.sh
Last active January 18, 2023 16:19
Disable trackpad when external mouse is plugged or when typing
gsettings set org.gnome.desktop.peripherals.touchpad send-events disabled-on-external-mouse
gsettings set org.gnome.desktop.peripherals.touchpad disable-while-typing true
@fbouynot
fbouynot / wg0.conf
Last active January 18, 2023 16:21
etc_NetworkManager_dispatcher.d_wg0.conf autoreload wg profile in network manager when changing network
#!/bin/bash -e
echo "Receive event from ${DEVICE_IFACE:-dummy} ${NM_DISPATCHER_ACTION:-dummy} " >> /tmp/dispatch.log
[[ "${DEVICE_IFACE:-dummy}" = "wg0" ]] && [[ "${NM_DISPATCHER_ACTION:-dummy}" = "up" ]] && {
systemctl restart systemd-resolved
resolvectl dns enp0s25 "1.1.1.2#security.cloudflare-dns.com 1.0.0.2#security.cloudflare-dns.com 2606:4700:4700::1112#security.cloudflare-dns.com 2606:4700:4700::1002#security.cloudflare-dns.com"
resolvectl domain enp0s25 ~.
resolvectl dnsovertls wg0 yes
resolvectl dnsovertls enp0s25 yes
resolvectl dnssec wg0 no
[Unit]
Description=Scheduled Reboot
[Service]
Type=simple
ExecStart=/usr/bin/systemctl --force reboot
#!/bin/bash
/usr/bin/dnf install -y dnf-plugin-system-upgrade
/usr/bin/dnf system-upgrade download -y --refresh --releasever=$(( $(/usr/bin/echo $(/usr/bin/uname -r) | /usr/bin/cut -f 4 -d '.' | /usr/bin/tail -c 3) + 1 ))
/usr/bin/dnf system-upgrade reboot
[Unit]
Description=Reboot Dist Upgrade.
[Timer]
OnCalendar=*-5,11-27 20:00:00
[Install]
WantedBy=multi-user.target
[Unit]
Description=Scheduled Upgrade
[Service]
Type=oneshot
ExecStart=/opt/dist-upgrade.sh