Skip to content

Instantly share code, notes, and snippets.

View willnode's full-sized avatar

Wildan M willnode

View GitHub Profile
@willnode
willnode / fix-win-security.ps1
Last active September 30, 2021 04:40
Fix Windows Security Missing in Windows 11
$manifest = (Get-AppxPackage Microsoft.SecHealthUI -AllUsers).InstallLocation + '\AppxManifest.xml';
Add-AppxPackage -DisableDevelopmentMode -Register $manifest;
@willnode
willnode / unicode-to-latex.json
Created September 19, 2021 18:35
Unicode to latex referencing https://github.com/JuliaLang/julia/blob/846492960fdbc9e3806e8bb8336cad4d559fa733/stdlib/REPL/src/latex_symbols.jl but with all unicode.xml combined and all possible latex included.
{
" ": ["\\space"],
"#": ["\\#"],
"$": ["\\textdollar"],
"%": ["\\%"],
"&": ["\\&"],
"'": ["\\textquotesingle"],
"*": ["\\ast"],
"‚": [","],
"−": ["-"],
@willnode
willnode / indonesian_geocodes.sql
Created September 19, 2021 12:27
Indonesian Geographical codes (until the village). Source unknown (I forgotten) probably from 2018 data AFAIK.
This file has been truncated, but you can view the full file.
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.13-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 11.1.0.6116
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
@willnode
willnode / 0-strapi-auto-permissions.md
Last active September 13, 2021 08:04
Strapi automatic permission sets

Strapi permissions and user roles are set using database, which will make your permission sets inconsistent.

Here make it automatic. Put these files in config/functions/

@willnode
willnode / update-pip3.8.sh
Created August 6, 2021 04:23
Update and Fix Python PIP on Linux Centos
pip --version
pip install -U pip
dnf reinstall python3.8 -y
alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.8 1
alternatives --set pip /usr/local/bin/pip3.8
pip --version
@willnode
willnode / tex_glue_box
Last active August 2, 2021 01:31
TeX vs TEXDraw Glue Box Grid
Ord Op Bin Rel Open Close Punct Inner
Ord 0 1 2 3 0 0 0 1
Op 1 1 * 3 0 0 0 1
Bin 2 2 * * 2 * * 2
Rel 3 3 * 0 3 0 0 3
Open 0 0 * 0 0 0 0 0
Close 0 1 2 3 0 0 0 1
Punct 1 1 * 1 1 1 1 1
Inner 1 1 2 3 1 0 1 1
@willnode
willnode / snapshotall.ps1
Created April 16, 2021 03:33
Remove All Previous Snapshot then generate new ones in Digital Ocean
$sw = [Diagnostics.Stopwatch]::StartNew()
# Drop all existing snapshot
$snapshots = doctl compute snapshot list --format ID --no-header
foreach ($line in $snapshots) {
doctl compute snapshot delete $line -f
}
# List all droplets and create snapshot
$droplets = doctl compute droplet list --format ID,Name --no-header
foreach($line in $droplets) {
@willnode
willnode / mysqlb.sh
Created December 1, 2020 07:56
Bash script to backup MySQL data efficiently
#!/bin/bash
timestamp=`date +%Y%m%d-%H`
tar -cf /root/mysqlb/backup-`echo $timestamp`.tar /var/lib/mysql
gzip -1 /root/mysqlb/backup-`echo $timestamp`.tar
find /root/mysqlb/ -type f -mtime +7 -name '*.gz' -print0 | xargs -r0 rm --
{
"url": "url_here",
"database": {
"client": "mysql",
"connection": {
"host" : "localhost",
"user" : "username_here",
"password" : "password_here",
"database" : "database_here",
"charset" : "utf8mb4"
@willnode
willnode / .htaccess
Created April 9, 2020 01:27
CodeIgniter4 .htaccess config if you insist to host it at project root rather than /public directory. Used by https://github.com/willnode/crm-toolkit
# Generally you wouldn't point your server at api root.
# Althought it works, always configure your server
# correctly when you're doing production!
# That's enough warning. If you put this directory
# on subdirectory, please configure that to here.
# Don't forget to set $uriProtocol to PATH_INFO (Config/App.php)
<IfModule mod_rewrite.c>