Skip to content

Instantly share code, notes, and snippets.

View cweiland's full-sized avatar

Christophe WEILAND cweiland

View GitHub Profile
Manual parameters on GUI :
Protocol : NCM
Port : /dev/cdc-wdm0
PIN <= don't forget to disable PIN code (unknown issue when it's setted)
Others depending of your provider
If Authentication is NONE :
change line 20 at /etc/gcom/ncm.json : "connect": "AT^NDISDUP=${profile},1${apn:+,\\\"$apn\\\"}${username:+,\\\"$username\\\"}${password:+,\\\"$password\\\"}",
#!/bin/bash
WINDOWS_USER="<windows_user>"
sudo apt update
sudo apt install build-essential flex bison libssl-dev libelf-dev bc libncurses-dev autoconf libudev-dev libtool dwarves -y
WSLKERNEL=$(uname -a | cut -d " " -f3 | cut -d "-" -f1)
CHECKOUT_DIR="linux-msft-wsl-${WSLKERNEL}"
export WSLKERNEL
export CHECKOUT_DIR
export WINDOWS_USER
@cweiland
cweiland / proxmox_turnkey_mariadb_freeipa.script
Last active February 27, 2023 22:46
Generate SSL certificates using freeipa
apt update
apt upgrade -y
apt install -y chrony sudo vim bash-completion
sed -i 's/DAEMON_OPTS="-F 1"/DAEMON_OPTS="-F 1 -x"/' /etc/default/chrony
touch /etc/.pve-ignore.hostname
hostname -f > /etc/hostname
echo "deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free" > /etc/apt/sources.list.d/debian_11_backports.list
apt update
reboot
apt install -y freeipa-client
@cweiland
cweiland / gist:5b3d91c5ac8bdaebe8f32831202cded6
Created June 23, 2021 11:06
Oneprovider-pfsense-opnsense-ipv4-vip-failover.php
<?php
#!/usr/local/bin/php
require_once("config.inc");
require_once("interfaces.inc");
require_once("util.inc");
$api_key = "API_KEY";
$client_key = "CLIENT_KEY";
$IPFO = "IP_VIP_FO";
@cweiland
cweiland / generateMeshWireguardConfig.sh
Last active May 14, 2021 15:28
Create multiple meshnetworks config using wireguard
#!/bin/bash
declare -a meshnetworks
declare -A hosts
declare -A wg_port
declare -A wg_subnet
configdir="/tmp/wireguard"
sshport=21
meshnetworks=("net1" "net2" "net3")
wg_port[net1]=1655
#!bin/bash
for pid in `lsof +L1 | grep deleted | awk '{print $2}' | uniq`
do
for fdid in `ls -l /proc/${pid}/fd | grep deleted | awk '{print $9}'`
do
> "/proc/${pid}/fd/${fdid}"
done
done
@cweiland
cweiland / get_snds_data.py
Created June 1, 2019 07:58 — forked from mkubenka/get_snds_data.py
Download Outlook Smart Network Data Service Data for last 90 days
# Enable automated data access under https://postmaster.live.com/snds/auto.aspx
import datetime
import requests
import shutil
DATA_URL = 'https://postmaster.live.com/snds/data.aspx?key=xx'
for i in range(90):
date = datetime.datetime.now() + datetime.timedelta(-i)