Skip to content

Instantly share code, notes, and snippets.

@Silica163
Silica163 / remove activate windows watermark.md
Last active July 22, 2023 07:16
Save all unsave file then run this script in command prompt as administrator.

Explanation

taskkill /f /im explorer.exe stop all image process of explorer.exe

shutdown /r /t 0 restart the computer

//https://humanbenchmark.com/tests/reactiontime
//refresh page then paste this code in console and hit enter
var ev = new Event("mousedown"),id,s=0;
function run(){
id = setInterval(()=>{
var score = document.getElementsByClassName("view-score")[0],
go = document.getElementsByClassName("view-go")[0],
waiting = document.getElementsByClassName("view-waiting")[0],
result = document.getElementsByClassName("view-result")[0];
@Silica163
Silica163 / node-server.js
Last active August 12, 2023 13:21
host static website in node js
const http = require('http');
const path = require('path');
const fs = require('fs');
const contentType = {
".avif": "image/avif",
".bmp": "image/bmp",
".gif": "image/gif",
".ico": "image/vnd.microsoft.icon",
".jpeg": "image/jpeg",
/*
เขียนมาใช้ในโปรเจ็กย่อย ซึ่งต้องเก็บ follower/following ของคนใน ig
วิธีใช้ก็ ไปดู follower/following ของคนที่อยากเก็บ ไถๆชื่อไปให้หมดหน้า
แล้วก็ก็อบโค้ดไปใส่ใน developer tools กด enter ก็จะได้ array ไปใช้
แนะนำให้เปิด responsive design mode (firefox), device toolbar (chrome/edge)
ไว้เป็นแบบมือถือด้วยเพราะส่วนตัวรู้สึกว่ามันไถง่ายกว่า
*/
/*
1. Go to https://www.typingstudy.com and select which lesson you want to cheat.
2.1 Press and hold "Space bar" and some letter until the test finish.
2.2 Do the test until you see your typing resault.
3. Open developer tools' console and paste this code, then hit enter.
4. Edit "Exercise time" and "typing speed" to anyting you want by use inspector(Firefox) or Elements(Chrome).
*/
for (let e of document.getElementsByClassName("result")) {
e.innerHTML = e.innerHTML.slice(e.innerHTML.indexOf("/") + 1) + "/" + e.innerHTML.slice(e.innerHTML.indexOf("/") + 1);
e.style = "background-position:500px 0;";
@Silica163
Silica163 / Arch on a USB.md
Last active August 14, 2023 14:26
Arch on a USB

Install Arch Linux on USB drive

remember RUN AS ROOT

format disk

fdisk /dev/sdb
@Silica163
Silica163 / spotifyAutoMuteAds.js
Created March 2, 2024 12:08
auto mute spotify ads
// only work with spotify webapp
// paste this script and run in developer console
// or load this script before spotify loaded
var footer,muteBtn,footObserver;
function onAttrChange(record,observe){
let event = record[0];
console.log(event,record);
if(event.attributeName == "data-testadtype"){
muteBtn.click();
@Silica163
Silica163 / thai font on linux.md
Last active January 21, 2026 00:36
install thai font in linux

How to install Thai font on linux

Download font files

Go to fonts.google.com then search for Thai font family, select the one you like or many as you want. Click Download, you will got a zip file contains that font.

I don't know about other distro, but don't use aur/ttf-google-thai because it doesn't contain any glyph of Thai font.

You can also use noto-fonts but it is 108MiB large, to large if you only want thai font.

@Silica163
Silica163 / genQemuMacAddr.sh
Created July 31, 2024 14:55
Mac Adddress Generator for Qemu virtual machine.
#/bin/sh
printf "52:54:%02x:%02x:%02x:%02x\n" $(($RANDOM & 255)) $(($RANDOM & 255)) $(($RANDOM & 255)) $(($RANDOM & 255))
@Silica163
Silica163 / thai.h
Last active September 13, 2024 14:47
ใช้คำหลัก(keyword)ภาษาไทยใน c เขียนเล่นๆเท่านั้นแหละ
/*
นี่แค่เขียนเล่นๆเอาฮาเฉยๆ
ใครเอาไปใช้ก็ช่วยบอกหน่อยว่าเป็นยังไงบ้าง
*/
typedef จำนวนเต็ม int;
typedef จำนวนเต็มบวก unsigned int;
typedef ตัวอักษร char;
typedef จำนวนจริง float;
#define อัตโนมัติ auto
#define ไปที่ goto