Skip to content

Instantly share code, notes, and snippets.

View armm29393's full-sized avatar
😪
Zzzz

Pawarit Thong-ek armm29393

😪
Zzzz
View GitHub Profile
@armm29393
armm29393 / install-windows-terminal-winserv.txt
Created March 3, 2025 10:12
How to install Windows Terminal on Windows Server
1. Open PS as Admin
cd C:\Windows\System32\WindowsPowerShell\v1.0
start powershell.exe
2. In PS run following command..
Invoke-WebRequest -Uri https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx -outfile $env:TEMP\1-Microsoft.VCLibs.x86.14.00.Desktop.appx
Add-AppxPackage $env:TEMP\1-Microsoft.VCLibs.x86.14.00.Desktop.appx
@armm29393
armm29393 / syncTime.bat
Created July 2, 2024 08:55
Sync time between Windows and macOS
@title Resync time macOS ^<-^> Windows
@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)
@armm29393
armm29393 / linenotify.py
Last active May 8, 2024 02:54
Python Line Notify
import os
import requests
def linenotify(message, imagePath=None, stickerPackageId=None, stickerId=None, tk=''):
url = 'https://notify-api.line.me/api/notify'
token = os.getenv('LINE_NOTIFY_TOKEN') or (tk or None)
if token is None:
print('LINE_NOTIFY_TOKEN is required!')
return False
header = {'Authorization': f'Bearer {token}'}
#include <iostream>
#include <time.h>
#include <stdlib.h>
//#include <stdio.h>
#include <conio.h>
using namespace std;
int m,w,num,guess,i;
int maxplay;
char mSelect[1],txt[10];
# Mikrotik 6.44+
:local service [/ppp active get [find name="$user"] service];
:local callerId [/ppp active get [find name="$user"] caller-id]
:local token "YOUR_LINE_NOTIFY_TOKEN";
:local message "%0AService%3A%20VPN-$service%0AUser%3A%20$user%0AWAN%3A%20$callerId%0AIP%3A%20$"remote-address"%0AStatus%3A%20%3E%3E%20Connected%20%3C%3C";
/tool fetch http-method=post http-header-field="Authorization:Bearer $token" http-data="message=$message" output=none https://notify-api.line.me/api/notify
net stop wuauserv
cd %systemroot%\SoftwareDistribution
ren Download Download.old
net start wuauserv
net stop bits
net start bits
net stop cryptsvc
cd %systemroot%\system32
ren catroot2 catroot2old
net start cryptsvc