Skip to content

Instantly share code, notes, and snippets.

View gilangvperdana's full-sized avatar
🎓
Still Learning

Gilang Virga Perdana gilangvperdana

🎓
Still Learning
View GitHub Profile
@amunchet
amunchet / noVNCCopyPasteProxmox.user.js
Last active September 23, 2024 10:54
Copy/Paste for noVNC Proxmox
// ==UserScript==
// @name noVNC Paste for Proxmox
// @namespace http://tampermonkey.net/
// @version 0.2a
// @description Pastes text into a noVNC window (for use with Proxmox specifically)
// @author Chester Enright
// @match https://*
// @include /^.*novnc.*/
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @grant none
@eXsoR65
eXsoR65 / proxmox_template.md
Last active September 1, 2024 09:22
Creating a Proxmox Template from a Generic Cloud image.
# Chanage directories to /tmp
cd /tmp
# Download the Generic Cloud image from the distro downloads
wget https://Link_to_Generic_Cloud_image.com
# Validate the file is a QEMU QCOW2 image.
file ./Generic_Cloud_Image.qcow2


# Set this to your Proxmox host name; it's case sensitive! Check with `pvesh ls /nodes`
@dunderrrrrr
dunderrrrrr / GeoIP Block NGINX Ubuntu 20.04.md
Created April 19, 2021 08:28
Allow or block GeoIP in Nginx on Ubuntu 20.04

GeoIP Block NGINX Ubuntu 20.04

Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.

Install Nginx modules

To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:

$ sudo apt install libnginx-mod-http-geoip geoip-database
@imsmith
imsmith / create-cloud-template.sh
Created April 6, 2021 20:27 — forked from chriswayg/create-cloud-template.sh
This script will download a cloud image of many Linux distros and create a Proxmox 6 KVM template from it.
#!/bin/bash
set -o errexit
clear
printf "\n*** This script will download a cloud image and create a Proxmox VM template from it. ***\n\n"
### HOW TO USE
### Pre-req:
### - run on a Proxmox 6 server
### - a dhcp server should be active on vmbr1
@GlitchWitch
GlitchWitch / _OpenVPN Server for LAN Access only.md
Last active September 19, 2024 08:15
OpenVPN Server for LAN Access only (no internet forwarding)

How to setup an OpenVPN server for LAN Access only

Install OpenVPN

wget https://git.io/vpn -O openvpn-install.sh && bash openvpn-install.sh

Edit server.conf

/etc/openvpn/server/server.conf

Change the OpenVPN LAN address to prevent interfering with other OpenVPN connections

@taoyuan
taoyuan / generate_self_signed_certification.md
Last active September 20, 2024 18:02
Generation of a Self Signed Certificate

Generation of a Self Signed Certificate

Generation of a self-signed SSL certificate involves a simple 3-step procedure:

STEP 1: Create the server private key

openssl genrsa -out cert.key 2048

STEP 2: Create the certificate signing request (CSR)

openssl req -new -key cert.key -out cert.csr
@mjhirst
mjhirst / cloudflare_ddns.sh
Last active June 8, 2023 21:57
Use Cloudflare's API to set Dynamic DNS records with Crontab
#!/bin/sh
# Cloudflare API v.4 Variables
CF_APIKEY='Your API Key Here'
CF_ZONEID='The Zone ID here' # Found on your Cloudflare Dashboard
CF_DNSID='The DNS ID here' # Found by listing DNS with Cloudflare API, see below for command
CF_EMAIL='your@email.address'
CF_DNS='address.domain.com'
GET_IP=$(dig +short txt ch whoami.cloudflare @1.0.0.1)
@smijar
smijar / k3d-create-cluster-no-traefik.sh
Last active January 9, 2024 17:38
k3d create cluster without traefik and serverlb
# Possibly obsolete: k3d create --name testcls1 --workers 3
k3d create --name testcls1 --workers 3 --server-arg "--no-deploy=traefik" --server-arg "--no-deploy=servicelb"
# UPDATE: in newer versions onwards, this has evolved to (thanks to comments below):
k3d cluster create --k3s-arg "--no-deploy=traefik@server:*"
@johnhpatton
johnhpatton / ephemeral-port-details.sh
Created January 29, 2020 15:18
Get TCP ephemeral port details to validate ephemeral port exhaustion.
#!/bin/bash
#
# REQUIRES
# - netstat - to retrieve network stack details
# - sysctl - to retrieve/modify kernel settings
# - bc - for math
#
# MIT License
#
# Copyright 2020 John H Patton, JH Patton Consulting, LLC
@atmosmps
atmosmps / configure-proxy-settings-in-ubuntu-and-fedora.md
Last active September 6, 2024 02:19
Configure Proxy Settings in Ubuntu and Fedora.

Proxy Config Format:

proxy_http=username:password@proxy-host:port

Single User Temporary Settings

When you do not need to force the system to be under the proxy.

  1. Open a Terminal window where you need proxy access.
  2. Set and export the HTTP_PROXY variable.