Skip to content

Instantly share code, notes, and snippets.

View vdupain's full-sized avatar

ⓥⓘⓝⓒⓔ⑨ⓟⓐⓡⓐ vdupain

View GitHub Profile
@vdupain
vdupain / readme.md
Created September 20, 2024 16:38 — forked from AzimsTech/readme.md
OpenWrt Wireless Network Bridge (With IPv6 Support)

OpenWrt Wireless Network Bridge (With IPv6 Support)

diag0 drawio6

Goals

  • To use OpenWrt Router as a wifi adapter instead of a regular wireless card for a stronger & stable Wifi connection.
  • Use existing proprietary AP provided by ISP (Doesn't support Mesh or WDS)
@vdupain
vdupain / 5_steps_for_creating_templates_and_vms_on_proxmox_using_linux_distros_cloud_images.md Creating Templates and Virtual Machines on Proxmox using cloud images from various Linux distributions.

5 Steps for Creating Templates and Virtual Machines on Proxmox using Linux Distro's Cloud Images

This tutorial guides you through the process of creating Templates and Virtual Machines on Proxmox using cloud-based images from various Linux distributions. We provide clear instructions for Alma Linux 9, Amazon Linux 2, CentOS 9, Fedora 38, Oracle Linux 9, RHEL 9, Rocky Linux 9, and Ubuntu 23.04 Lynx Lobster.

Note: The instructions have been tested on Proxmox 8.0.4.

Let's begin by choosing the cloud-based image. If you already have your preferred Linux distribution, skip to the 1st step.

To assist in making informed choices when selecting a Linux distribution for your virtual machines, we've compiled a table showcasing key characteristics of each cloud image. This table provides a snapshot of important attributes, including kernel version, Python version, number of processes initialized after boot, number of packages installed, free memory after boot, VM disk size, root partition disk size, used size on t

@vdupain
vdupain / rrdbackup
Created September 22, 2023 12:22 — forked from tmkasun/rrdbackup
OpenWrt /etc/init.d/ script to backup and restore the rrd (collectd) database, to preserve data across reboots
#!/bin/sh /etc/rc.common
# OpenWrt /etc/init.d/ script to backup and restore the rrd (collectd) database, to preserve data across reboots
#
#
# howto:
# - upload this file as /etc/init.d/rrdbackup
# - (optional) adjust BACKUP_DIR below to point to a different target directory for the backup (e.g., a USB drive)
# - # chmod +x /etc/init.d/rrdbackup
# - # /etc/init.d/rrdbackup enable
#!/bin/bash
set -e
TOKEN=xxx
AUTH="Basic $(echo -n $TOKEN: | base64)"
SONARAPI="http://sonarqube/api"
for projKey in $(curl -s -X GET $SONARAPI/projects/search -H "Authorization: $AUTH" | \
jq -r '.components[].key')
@vdupain
vdupain / cleanrepo.sh
Created December 8, 2022 10:13 — forked from legege/cleanrepo.sh
Intelligently clean a Sonatype Nexus repository... keep the last 2 released versions of each "major.minor" artifact
#!/bin/bash
DRY_RUN=1
if [ "$1" != "" ]; then
DRY_RUN="$1"
fi
MAX_VERSION=2
if [ "$2" != "" ]; then
MAX_VERSION="$2"
fi
@vdupain
vdupain / _Jenkins+Script+Console.md
Created July 8, 2022 08:10 — forked from dnozay/_Jenkins+Script+Console.md
jenkins groovy scripts collection.
#!/bin/bash
# proxvm
# Output in specifed format (default csv) all virtual machines on proxmox 4+
SERVER=srv
USERNAME=username
PASSWORD=$(<$HOME/.pve-pass-file)
FORMAT=csv
#echo Connecting to $SERVER:8006 as $USERNAME:$PASSWORD
curl -s -k -d "username=$USERNAME" --data-urlencode "password=$PASSWORD" https://$SERVER:8006/api2/json/access/ticket | jq --raw-output '.data.ticket' | sed 's/^/PVEAuthCookie=/' > /tmp/cookie
@vdupain
vdupain / proxvm.sh
Created February 14, 2022 18:15 — forked from huksley/proxvm.sh
Get list of all virtual machines on proxmox 4+, both LXC and QEMU and detect IP addresses
#!/bin/bash
# proxvm
# Output in specifed format (default csv) all virtual machines on proxmox 4+
SERVER=localhost
USERNAME=apiread@pve
PASSWORD=123456
FORMAT=csv
while [[ $# > 0 ]]; do
key="$1"
@vdupain
vdupain / countChange.sc
Created April 8, 2013 07:40
Exercise 3: Counting Change
package week1
object countChange {
def countChange(money: Int, coins: List[Int]): Int = {
if (money > 0 && !coins.isEmpty)
countChange(money, coins.tail) + countChange(money - coins.head, coins)
else if (money == 0) 1 else 0
} //> countChange: (money: Int, coins: List[Int])Int
@vdupain
vdupain / balance.sc
Created April 5, 2013 14:15
Exercise 2: Parentheses Balancing
object balance {
def balance(chars: List[Char]): Boolean = {
def loop(acc: Int, list: List[Char]): Int =
if (list.isEmpty) acc
else if (list.head == '(') loop(acc + 1, list.tail)
else if (list.head == ')' && acc > 0) loop(acc - 1, list.tail)
else if (list.head == ')' && acc <= 0) -1
else loop(acc, list.tail)