Skip to content

Instantly share code, notes, and snippets.

View therusetiawan's full-sized avatar
💭
Hello World!

Heru Setiawan therusetiawan

💭
Hello World!
View GitHub Profile
@therusetiawan
therusetiawan / copy-file.gs
Created September 11, 2025 03:09
Script to Copy Google Drive File Based on Google Sheet Value
function copyStudentFilesSameFolder() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// Get the folder where this spreadsheet is located
var file = DriveApp.getFileById(SpreadsheetApp.getActiveSpreadsheet().getId());
var sourceFolder = file.getParents().next();
// Set destination folder (replace with your folder ID)
var destinationFolderId = "GET_ID_FROM_URL"; // 👈 Replace with your destination folder ID
var destinationFolder = DriveApp.getFolderById(destinationFolderId);
@therusetiawan
therusetiawan / gist:0ca676c3b23b1ad293baffb565640bb3
Created September 9, 2025 03:29
Command to set a UniFi device to inform the Network Controller.
ssh -o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa ubnt@192.168.88.242
# enter unifi password = ubnt
set-inform http://192.168.100.211:8080/inform
@therusetiawan
therusetiawan / word-analogy.py
Created July 5, 2023 23:20
FastText model evaluation using word analogy method
import numpy as np
import fasttext
import csv
# Load FastText word embeddings (pre-trained model)
model = fasttext.load_model('models/cc.en.300.bin')
def word_analogy_3cosadd(model, word1, word2, word3, top_k=1):
# Get word vectors
vector1 = model.get_word_vector(word1)
@therusetiawan
therusetiawan / word-similarity.py
Created July 5, 2023 23:16
FastText model evaluation using word similarity method
import pandas as pd
import fasttext
import numpy as np
from scipy.spatial.distance import cosine
from scipy.stats import pearsonr
from scipy.stats import spearmanr
from scipy.stats import kendalltau
# Load pre-trained FastText model
model = fasttext.load_model('models/cc.en.300.bin')
@therusetiawan
therusetiawan / msr-dataset.csv
Created June 20, 2023 23:06
Syntactic Analogies Dataset MSR
0 JJ_JJR good better rough rougher
1 JJR_JJ better good rougher rough
2 JJ_JJS good best rough roughest
3 JJS_JJ best good roughest rough
4 JJS_JJR best better roughest rougher
5 JJR_JJS better best rougher roughest
6 JJ_JJR good better mean meaner
7 JJR_JJ better good meaner mean
8 JJ_JJS good best mean meanest
9 JJS_JJ best good meanest mean
@therusetiawan
therusetiawan / word-embedding-visualization.py
Created June 16, 2023 03:53
Visualize fasttext vector using tsne
import fasttext
import numpy as np
import matplotlib.pyplot as plt
from sklearn.manifold import TSNE
model = fasttext.load_model('models/cc.en.300.bin')
# static keywords
keywords = ['deeds', 'acquisitions', 'skills', 'acquirements', 'attainments', 'achievements']
keyword_vectors = []
@therusetiawan
therusetiawan / docker-compose.yml
Last active March 18, 2022 01:13
Setup ElasticSearch and Kibana using docker-compose
version: "3.0"
services:
elasticsearch:
container_name: es-container
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.0
environment:
- xpack.security.enabled=false
- "discovery.type=single-node"
networks:
- es-net
@therusetiawan
therusetiawan / Hotspot-User-Monitor
Last active June 1, 2025 07:01
Script to monitor hotspot user log
### On Login Script
:put (",,0,,,,Disable,");{
:local key "KEY DARI WINBOT";
:local noHP "NO HP TUJUAN";
:local mac $"mac-address";
:local device [/ip dhcp-server lease get [find mac-address="$mac"] host-name];
:local activeCount [/ip hotspot active print count-only];
/tool fetch url="https://api.mikrotik-winbot.com/api/v1/whatsapp/send_message/$noHP/$key/LOG-IN USER $user -enter-IP Address : $address -enter-Mac Address : $mac -enter-Device : $device -enter-Online : $activeCount Users " mode=http keep-result=no}
@therusetiawan
therusetiawan / OBS-Virtual-MIC.sh
Created September 6, 2021 09:53
Ubuntu OBS Virtual Mic
pactl load-module module-null-sink sink_name=Virtual-Speaker sink_properties=device.description=Virtual-Speaker
pactl load-module module-remap-source source_name=Remap-Source master=Virtual-Speaker.monitor
@therusetiawan
therusetiawan / youtube
Created May 29, 2021 22:44
Mikrotik Layer7 Protocols Youtube
^.+(youtube.com|www.youtube.com|m.youtube.com|ytimg.com|s.ytmig.com|ytimg.l.google.com|youtube.l.google.com|i.google.com|googlevideo.com|youtu.be|c.youtube.com|cdn.dailymotion.com|metacafe.com|mccont.com|video|videoplayback|tube).*$