Skip to content

Instantly share code, notes, and snippets.

View JuniYadi's full-sized avatar
🏠
Working from home

Juni Yadi JuniYadi

🏠
Working from home
View GitHub Profile
@JuniYadi
JuniYadi / debian11-to-debian12.sh
Created October 31, 2024 03:07
Upgrade Debian 11 to Debian 12
#!/bin/bash
apt update
apt upgrade -y
apt full-upgrade -y
apt --purge autoremove
cp -v /etc/apt/sources.list /root/sources.list-backup.11.bullseye
tee /etc/apt/sources.list > /dev/null << EOF
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
@JuniYadi
JuniYadi / cpu-performance.sh
Last active November 8, 2024 02:12
Set Default CPU Frequency to Max CPU Speed
#!/bin/bash
echo "Install CPU Power"
apt install linux-cpupower -y
echo "Get Detail CPU"
cpupower frequency-info
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
echo "Setup Systemd"
#!/bin/bash
# Function to generate a random password
generate_random_password() {
tr -dc A-Za-z0-9 </dev/urandom | head -c 12
}
# Prompt for username
read -p "Enter username: " USERNAME
@JuniYadi
JuniYadi / vscode.sh
Last active September 18, 2024 08:06
#!/bin/bash
echo "Install VSCode for Ubuntu or Debian"
echo "Ref: https://code.visualstudio.com/docs/setup/linux"
echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections
sudo apt-get install wget gpg -y
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" |sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null
#!/bin/bash
# Set Timezone
timedatectl set-timezone "Asia/Jakarta"
# Update
apt-get update
apt-get upgrade -y
# Install missing deps
import requests
import json
import os
def updateRecord(target, cf_token, ip):
# Cloudflare Token
cf_api = "https://api.cloudflare.com/client/v4/"
# Cloudflare Headers
#!/bin/bash
systemctl disable systemd-resolved
systemctl stop systemd-resolved
rm -rf /etc/resolv.conf
echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "nameserver 8.8.4.4" > /etc/resolv.conf
dig premiumfast.net
dig s3.ap-southeast-1.amazonaws.com
@JuniYadi
JuniYadi / gist:a0b1fc3273fbf81dbc00180df848fc32
Created May 18, 2023 05:39
proxmox-access-log-block.sh
#!/bin/bash
log_file="/var/log/pveproxy/access.log"
iptables_chain="INPUT"
iptables_action="-A"
iptables_command="/sbin/iptables"
iptables_log_prefix="[BLOCKED IP]"
# Regular expression pattern to match IP addresses and status codes in the log file
log_entry_pattern="([0-9]{1,3}\.){3}[0-9]{1,3}.* 200"
#!/usr/bin/env python3
import os
import sys
import argparse
import re
import csv
from datetime import datetime, timezone
import pytz
@JuniYadi
JuniYadi / mac-vendor.txt
Created April 5, 2023 15:12 — forked from aallan/mac-vendor.txt
List of MAC addresses with vendors identities
000000 Officially Xerox
000001 SuperLAN-2U
000002 BBN (was internal usage only, no longer used)
000003 XEROX CORPORATION
000004 XEROX CORPORATION
000005 XEROX CORPORATION
000006 XEROX CORPORATION
000007 XEROX CORPORATION
000008 XEROX CORPORATION
000009 powerpipes?