Skip to content

Instantly share code, notes, and snippets.

View NathanAdhitya's full-sized avatar

Nathan Adhitya NathanAdhitya

View GitHub Profile
@NathanAdhitya
NathanAdhitya / lldpd-quick-setup.sh
Last active February 22, 2025 06:53
Debian (and derivatives) quick lldpd idempotent setup script. Set interfaces to en* only and enable other protocols. Tested on Proxmox VE 8.3.
#!/bin/bash
# Credits: https://github.com/abdellbar1/ProxLLDPConfig
apt-get update
apt-get install -y lldpd
echo 'DAEMON_ARGS="-c -s -e"' > /etc/default/lldpd
echo 'configure system interface pattern en*' > /etc/lldpd.d/if.conf
systemctl restart lldpd
systemctl enable lldpd
@NathanAdhitya
NathanAdhitya / nut-exporter-dashboard.json
Last active January 3, 2025 06:10
Experimental dashboard for the NUT Exporter for Prometheus. This dashboard displays model; input data (V, Hz); output data(V, A, Hz, PF, VA, W); battery data(runtime, voltage, charge); and UPS temperature This was built for nutdrv_qx driver connected to a Vertiv Liebert GXT MT+ CX. See https://github.com/DRuggeri/nut_exporter.
{
"annotations": {
"list": [
{
"$$hashKey": "object:7",
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
@NathanAdhitya
NathanAdhitya / proxmox-lxc-auto-login.sh
Created December 26, 2024 17:23
Proxmox LXC Auto Login Quick Script (run in the terminal of your container)
SYSTEMD_EDITOR=tee systemctl edit [email protected]<<EOF
[Service]
ExecStart=
ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud tty%I 115200,38400,9600 $TERM
EOF
@NathanAdhitya
NathanAdhitya / gcr.py
Created October 8, 2024 10:11
Downloads student submissions in Google Classroom programatically and group them into folders based on name of students.
"""
This script helps you (as a teacher in Google Classroom) download all the files submitted by students.
I'm not sure where I partially copy pasted this from, but some parts have been modified by me to suit my needs.
Have fun!
- Nathan Adhitya
---
@NathanAdhitya
NathanAdhitya / google-meet-participants-xpath.js
Created April 22, 2024 02:04
Google Meet Participants xPath
$x('//div[@aria-label="Participants"][1]/div/div/div[2]/div[1]/span[1]').map(v => v.innerText)
@NathanAdhitya
NathanAdhitya / Excel FOREACH
Last active October 6, 2023 12:29
A simple Excel FOREACH formula function to iterate over an array. Add this code to Name Manager with the name FOREACH.
# Lines starting with # are comments, they are not code.
# Paste this into Name Manager. Give the name "FOREACH"
=LAMBDA(
arr; func; offset;
IF(
offset < COUNTA(arr);
VSTACK(
func(INDEX(arr; offset));
FOREACH(arr; func; offset+1)

Rangkuman TIK

Nathan, 24/02/2021

Teori Dasar

HTML adalah singkatan dari Hypertext Markup Language.
HTML dirancang pada konsep bahasa markup SGML, yang merupakan standar untuk membuat dokumen menggunakan tanda (markup) seperti paragraf, list, heading, dan lain-lain. (dalam HTML, markup yang digunakan adalah seperti p, li, h1)

Di dalam dokumen HTML, terdapat tag atau tanda. Tag adalah penanda awalan dan akhiran dari sebuah elemen. Tag dibuat menggunakan kurung siku <...>, dengan pasangan penutup menggunakan garis miring (/) di depan nama tag.
Untuk diingat: Tidak semua tag memiliki pasangan. Secara umum, mayoritas tag memilki pasangan penutup.

@NathanAdhitya
NathanAdhitya / awman.sk
Created June 14, 2021 14:48
A simple skript to prank your friends. Plays a creeper sound behind someone when command is executed.
command /awman <player>:
permission: donator.creeper
cooldown: 1 minute
trigger:
set {_rand} to a random integer between 1 and 3
if {_rand} is 1:
play sound "ENTITY_CREEPER_HURT" at location behind arg-1 for arg-1
else:
play sound "ENTITY_CREEPER_PRIMED" with pitch 0.5 at location behind arg-1 for arg-1
@NathanAdhitya
NathanAdhitya / classroom-discord.gs
Last active July 18, 2020 14:20
a google classroom to discord webhook. WARNING: not the most efficient method (look: push notifs [can't afford that]). this takes (amount of classes * 2)+1 requests / run.
/**
* @file Enhances student laziness by automatically posting classroom announcements and assignments through a Discord Webhook.
* @author Nathan Adhitya <[email protected]>
*/
/*
KNOWN THINGS THIS THING WON'T ACCOUNT FOR:
- Google servers cutting the amount of data returned is not accounted for.
- Updates to existing announcement/course works
- Support for class material?
@NathanAdhitya
NathanAdhitya / minecraft.service
Created July 1, 2019 06:29
Minecraft systemd service
[Unit]
Description=Minecraft server
After=local-fs.target network.target
[Service]
WorkingDirectory=/home/minecraft/
User=minecraft
Group=minecraft
Type=forking
Restart=on-failure