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
@dmslabsbr
dmslabsbr / ha_post_temp.sh
Created November 4, 2023 01:59
Bash scripts to send pve sensors temperature to home assistant
#!/bin/bash
# Configurações do Home Assistant
url_base="http://192.168.50.201:8123/api/states"
token="lzRSxMt1dtk"
# Nome do servidor
srv_name="pve"
# Constants for device info
@seyedmmousavi
seyedmmousavi / build_qt_5_15_openssl_3.md
Last active May 23, 2024 04:47
How to build Qt 5.15 Community against OpenSSL 3

How to build Qt 5.15 Community with OpenSSL 3

The Qt v5.15 Community doesn't support OpenSSL 3 by default. You will face some issues at runtime if you attempt to build it with OpenSSL 3. This gist explains how to do it by yourself.

Brief

  1. Apply two attached patches
  2. Install OpenSSL 3
  3. Config the Qt with installed OpenSSL like this:
 ..\configure -prefix h:\mousavi\Qt\5.15.10\win32-msvc2019-x86 -debug-and-release -skip qtwebengine -openssl-runtime OPENSSL_PREFIX="H:\mousavi\OpenSSL-Win32"`
@fguisso
fguisso / install-win10-proxmox.md
Created April 9, 2023 15:38
Install Win10 in proxmox
#!/bin/bash

# Specify the Windows 10 ISO to download
WIN10_ISO_URL="https://software-download.microsoft.com/download/pr/19043.1165.210529-1541.co_release_CLIENT_CONSUMER_x64FRE_en-us.iso"

# Download the Windows 10 ISO
wget -O /var/lib/vz/template/iso/Windows10.iso $WIN10_ISO_URL

# Create a new VM in Proxmox
@mehstg
mehstg / wg_mqtt_exporter.sh
Last active December 3, 2024 17:53
Wireguard CLI to MQTT Bash Script - For getting Wireguard information in to Home Assistant MQTT sensors
# A script to pull information from the Wireguard CLI and redirect to a MQTT Broker
# Based on the original script written by valvex - https://community.home-assistant.io/t/send-wireguard-client-info-to-ha-with-mqtt-template-sensor-to-show-active-clients/259532
# Paul Braham 2022
#!/bin/bash
CONF_FILE="/etc/wireguard/wg0.conf"
MQTT_IP="192.168.1.200"
MQTT_USERNAME="mqttuser"
MQTT_PASSWORD="mqttpass"
@FlorianHeigl
FlorianHeigl / junos-netflow.cmd
Last active March 6, 2024 12:41
Configure Juniper NFX NexGen NetFlow (inline)
set system ntp server ntp1.ispname.net
set interfaces ge-1/0/2 unit 0 family inet sampling input
set interfaces ge-1/0/2 unit 0 family inet sampling output
set services flow-monitoring version9 template ipv4-test ipv4-template
set forwarding-options sampling instance test-ins family inet input rate 100
set forwarding-options sampling instance test-ins family inet input run-length 19
set forwarding-options sampling instance test-ins family inet output flow-server 172.16.xx.xx port 2055
set forwarding-options sampling instance test-ins family inet output flow-server 172.16.xx.xx version9 template ipv4-test
set forwarding-options sampling instance test-ins family inet output inline-jflow source-address 192.168.x.x
@s3rvac
s3rvac / gcc-10-debian-buster.sh
Created October 31, 2020 10:39
Steps to build GCC 10 on Debian Buster.
#!/bin/bash
#
# Steps to build GCC 10 on Debian Buster.
#
set -e -x
# Install all dependencies.
export DEBIAN_FRONTEND=noninteractive
apt update
@roalcantara
roalcantara / xcode-uninstall.sh
Created October 24, 2020 11:41
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
@mrpeardotnet
mrpeardotnet / PVE-host-backup.md
Created December 17, 2019 18:03
Proxmox PVE Host Config Backup Script

Proxmox PVE Host Config Backup Script

This script can be used to backup essential configuration files from the Proxmox Virtual Enivronment (PVE) host.

The script will create backups using tar with specified backup prefix and date and time stamp in the file name. Script will also delete backups that are older then number of days specified.

Create backup script file

To create backup script that will be executed every day we can create backup script in /etc/cron.daily/ folder. We need to make it writeable by root (creator) only, but readable and executable by everyone:

touch /etc/cron.daily/pvehost-backup
@TheCherno
TheCherno / Instrumentor.h
Last active December 23, 2024 09:52
Basic Instrumentation Profiler
//
// Basic instrumentation profiler by Cherno
// Usage: include this header file somewhere in your code (eg. precompiled header), and then use like:
//
// Instrumentor::Get().BeginSession("Session Name"); // Begin session
// {
// InstrumentationTimer timer("Profiled Scope Name"); // Place code like this in scopes you'd like to include in profiling
// // Code
// }