This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # bridger-roam-cleanup: removes stale bridger TC flower rules when | |
| # a WiFi client roams between bands (e.g. 5GHz <-> 6GHz). | |
| # | |
| # Bridger creates TC flower rules with skip_sw (hardware-only) to | |
| # accelerate bridge forwarding. When a client roams, bridger sometimes | |
| # leaves stale rules pointing to the old WiFi interface, causing the | |
| # PPE to redirect download traffic to the wrong radio (1 Mbit symptom). | |
| ### START THAT SCRIPT USING /etc/rc.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ 10.137543] input: Dell Computer Corp Dell Universal Receiver System Control as /devices/pci0000:00/0000:00:14.0/usb3/3-1/3-1.4/3-1.4.4/3-1.4.4.1/3-1.4.4.1.2/3-1.4.4.1.2:1.1/0003:413C:2514.0005/input/input16 | |
| [ 10.137842] hid-generic 0003:413C:2514.0005: input,hidraw4: USB HID v1.11 Mouse [Dell Computer Corp Dell Universal Receiver] on usb-0000:00:14.0-1.4.4.1.2/input1 | |
| [ 10.139497] hid-generic 0003:413C:2514.0006: hiddev98,hidraw5: USB HID v1.11 Device [Dell Computer Corp Dell Universal Receiver] on usb-0000:00:14.0-1.4.4.1.2/input2 | |
| [ 13.468861] EXT4-fs (dm-0): orphan cleanup on readonly fs | |
| [ 13.469033] EXT4-fs (dm-0): mounted filesystem d9db6e39-e862-4472-bc3e-07760544c75e ro with ordered data mode. Quota mode: none. | |
| [ 13.581056] typec port2: bound usb3-port2 (ops connector_ops) | |
| [ 13.581064] typec port2: bound usb3-port5 (ops connector_ops) | |
| [ 13.581067] typec port2: bound usb3-port7 (ops connector_ops) | |
| [ 13.581069] typec port2: bound usb3-port8 (ops connector_ops) | |
| [ 13.581071] typec port2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Error: Failed to download metadata for repo 'baseos': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried | |
| # on Centos 9 stream, just do: | |
| sudo sed -i 's@metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-$stream&arch=$basearch&protocol=https,http@baseurl=http://mirror.stream.centos.org/9-stream/BaseOS/$basearch/os/@g' /etc/yum.repos.d/centos.repo | |
| sudo sed -i 's@metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-$stream&arch=$basearch&protocol=https,http@baseurl=http://mirror.stream.centos.org/9-stream/AppStream/$basearch/os/@g' /etc/yum.repos.d/centos.repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| - name: Set system-wide IOPS limitation via cgroups v2 | |
| hosts: all | |
| become: true | |
| vars: | |
| main_blk_name: /dev/vda | |
| iops_limit: 10000 | |
| rw_total_limit: 104857600 # 100mb in bytes | |
| tasks: | |
| - name: Get block device major:minor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| CURRENT_DIR=$(pwd) | |
| # for 6.12 -> main, for 6.6 -> openwrt-24.10 | |
| # OPENWRT_BRANCH=openwrt-24.10 | |
| # If main, than: d6397aaf69fbb442f913b2853cac2991962ef905 | |
| OPENWRT_BRANCH=main | |
| OPENWRT_DIR=$(pwd)/openwrt-mediatek | |
| MEDIATEK_FEED_BRANCH=master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # check file system which should be extended | |
| virt-filesystems --long -h --all -a CentOS-Stream-GenericCloud-x86_64-10-20241204.0.x86_64.qcow2 | |
| # create new empty disk with desired size | |
| qemu-img create -f qcow2 centos-stream-10.qcow2 100G ## Optionally add: -o preallocation=metadata | |
| # expand root partition | |
| virt-resize --expand /dev/sda3 CentOS-Stream-GenericCloud-x86_64-10-20241204.0.x86_64.qcow2 centos-stream-10.qcow2 | |
| # Modify image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| MAIN_DIR=~/monitoring | |
| ROUTER_NODE_EXPORTER_ADDRESS="192.168.88.1:9100" | |
| if ! [ -d "$MAIN_DIR" ]; then | |
| mkdir -p $MAIN_DIR | |
| fi | |
| # NOTE: https://grafana.com/blog/2021/02/09/how-i-monitor-my-openwrt-router-with-grafana-cloud-and-prometheus/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| opkg update | |
| opkg install dnsproxy | |
| # Ensure, that the NTP server can work without DNS | |
| uci del system.ntp.server | |
| uci add_list system.ntp.server='194.177.4.1' # 0.openwrt.pool.ntp.org | |
| uci add_list system.ntp.server='213.222.217.11' # 1.openwrt.pool.ntp.org | |
| uci add_list system.ntp.server='80.50.102.114' # 2.openwrt.pool.ntp.org | |
| uci add_list system.ntp.server='193.219.28.60' # 3.openwrt.pool.ntp.org | |
| uci commit system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Create file called machine-config-daemon-force in /run ### | |
| ssh core@hostname.local sudo touch /run/machine-config-daemon-force | |
| ### Edit node annotations ### | |
| oc edit node <node-name> | |
| ### Check Annotations, change like below sample ### | |
| machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
| machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
| machineconfiguration.openshift.io/reason: "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| OPERATOR_SDK="v1.34.2" | |
| OLM="0.27.0" | |
| # Grant more permissions | |
| oc patch scc restricted --type=merge -p '{"runAsUser": {"type": "RunAsAny"}}' | |
| oc patch scc restricted-v2 --type=merge -p '{"runAsUser": {"type": "RunAsAny"}}' | |
| # optional | |
| oc adm policy add-scc-to-user privileged system:serviceaccount:olm:default |
NewerOlder