Skip to content

Instantly share code, notes, and snippets.

View kafeg's full-sized avatar
💭
In C++ we trust!

Vitaly kafeg

💭
In C++ we trust!
View GitHub Profile
@kafeg
kafeg / syno-wg-build.sh
Created December 31, 2024 23:27
Synology WireGuard and AmneziaWG build script: kernel module and tools
#!/bin/bash
# This script helps to cross-compile the WireGuard and AmneziaWG for Synology host (intel/arm targets) on Linux x64 host (for e.g. Ubuntu 22.04 and above).
# It compiles kernel module and wg/wg-quick tools.
# Usage:
# - download and save for e.g. to '/opt/syno-wg/syno-wg-build.sh'
# - detect your DSM version and device processor architecture. Use ssh to Synology and execute:
# - - awk -F '\"' '/majorversion/ {maj=\$2} /minorversion/ {min=\$2} END {print maj \".\" min}' /etc.defaults/VERSION
# - - awk -F '\"' '/platform_name/ {print \$2}' /etc.defaults/synoinfo.conf
# - output can be:
@kafeg
kafeg / sample_sensors.png
Last active December 3, 2024 23:02 — forked from mehstg/wg_mqtt_exporter.sh
Wireguard CLI to MQTT Bash Script - For getting Wireguard information in to Home Assistant MQTT sensors
sample_sensors.png
@kafeg
kafeg / amneziawg-client-proxmox-host.sh
Created November 9, 2024 10:08
Proxmox VE 8.2 host + AmneziaWG
# The problem: by default not available kernel sources for compile AmneziaWG kernel module.
# So the amnezia instalation is broken by default because of DKMS module can not be built/configured.
# Usually this is not needed on the host, but my use case is WG installation as client
# Prepare for installation as written here (https://github.com/amnezia-vpn/amneziawg-linux-kernel-module):
apt-get install pve-headers
apt install -y software-properties-common python3-launchpadlib gnupg2 linux-headers-$(uname -r)
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 57290828
echo "deb https://ppa.launchpadcontent.net/amnezia/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list
echo "deb-src https://ppa.launchpadcontent.net/amnezia/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list
@kafeg
kafeg / docker-compose.yaml
Created October 23, 2024 21:22
Synology WeTTY (Web-Terminal) Docker container (LAN only)
version: '3'
services:
wetty:
image: wettyoss/wetty
container_name: wetty
restart: unless-stopped
ports:
- "3000:3000"
command:
- --base=/
@kafeg
kafeg / huaweiDecrypt.py
Created October 22, 2024 08:21 — forked from staaldraad/huaweiDecrypt.py
Decrypt Huawei router/firewall passwords. Huawei stores passwords using DES encryption when the crypted option is enabled.
#!/usr/bin/python
"""
Simple tool to extract local users and passwords from most Huawei routers/firewalls config files.
Will extract plain-text passwords and crypted credentials. Huawei config files use DES encryption with
a known key. Using this information, the script will decrypt credentials found in the config file.
Author: Etienne Stalmans ([email protected])
Version: 1.0 (12/01/2014)
"""
from Crypto.Cipher import DES
@kafeg
kafeg / xcode-uninstall.sh
Created October 27, 2023 18:31 — forked from roalcantara/xcode-uninstall.sh
xcode-uninstall
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf /Applications/Xcode.app
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer
rm -rf ~/Library/MobileDevice
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
@kafeg
kafeg / QtArm64Patch.patch
Created October 23, 2023 21:39 — forked from thomaslmiller/QtArm64Patch.patch
Diff for Qt5 dev branch for building Arm64 Windows Desktop Apps
Submodule qtbase 519fcb38a2..705dee9621:
diff --git a/qtbase/mkspecs/common/msvc-desktop.conf b/qtbase/mkspecs/common/msvc-desktop.conf
index b7d2eecc82..755d92149c 100644
--- a/qtbase/mkspecs/common/msvc-desktop.conf
+++ b/qtbase/mkspecs/common/msvc-desktop.conf
@@ -22,6 +22,10 @@ contains(QMAKE_TARGET.arch, x86_64) {
DEFINES += WIN64
QMAKE_COMPILER_DEFINES += _WIN64
}
+contains(QMAKE_TARGET.arch, arm64) {
@kafeg
kafeg / gist:d502389fcf77b5beb3881aa463865787
Created October 21, 2023 10:08 — forked from sebsto/gist:6af5bf3acaf25c00dd938c3bbe722cc1
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@kafeg
kafeg / dockerpi-modify.sh
Created January 12, 2022 22:18
Shell script for modify dockerpi image and install there required packages on first boot.
#/bin/bash
#set -x
#ZIP_URL="http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2015-11-24/2015-11-21-raspbian-jessie-lite.zip"
#ZIP_NAME="2015-11-21-raspbian-jessie-lite.zip"
#IMG_NAME="2015-11-21-raspbian-jessie-lite.img"
ZIP_URL="http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-09-30/2019-09-26-raspbian-buster-lite.zip"
@kafeg
kafeg / Dockerfile.vcpkg.qt5-base.alpine
Last active December 10, 2021 17:38
Build qt5-base vcpkg package in Alpine Linux environment with all required dependencies
FROM alpine:3
RUN apk add --no-cache libc6-compat cmake ninja git gcc g++ libc-dev \
yasm bash curl make linux-headers curl zip unzip tar \
patch libx11-dev libx11-dev mesa mesa-dev libxi-dev \
libxext-dev autoconf gettext gettext-dev libxkbcommon-dev \
bison pkgconfig gperf python3 glu glu-dev mesa-gl libxcb \
libxcb-dev libxkbcommon libxkbcommon-dev libxkbcommon-x11 \
xcb-util-wm-dev xcb-util-image-dev xcb-util-keysyms-dev \
xcb-util-cursor-dev xcb-util-renderutil-dev xcb-util-xrm-dev \