Skip to content

Instantly share code, notes, and snippets.

View ijortengab's full-sized avatar
😁

Ijor Tengab ijortengab

😁
  • Juragan Web ID
  • Indonesia, Kampus UI, Depok, Salemba, Cibubur, Ciracas, Ciputat.
View GitHub Profile
# Common aliases.
# regular
alias al="vi ~/.bash_aliases && . ~/.bash_aliases"
alias touchh='a=$(date +%Y%m%d%H%M%S);touch ${a}.md'
alias duu='du -d 1 -h 2>/dev/null | sort -hr'
alias dff="df -h | grep -v -E '(loop|tmpfs)'"
alias cc="clear && clear"
alias syslog="tail -f /var/log/syslog"
alias his="history -w && cat ~/.bash_history | tail -n 100"
rundll32 user32.dll,LockWorkStation
#!/usr/bin/php
<?php
if (!isset($_SERVER['argv'][1])) {
echo 'Example: C:\Users\ijortengab\AppData\Local\Packages\Microsoft.WindowsTerminal_8wekyb3d8bbwe\LocalState\settings.json'.PHP_EOL;
echo 'The location of settings.json file: ';
if (FALSE !== ($line = fgets(STDIN))) {
$filename = rtrim($line);
}
}
#+a::
{
if WinExist("ahk_exe WindowsTerminal.exe")
WinActivate
else
Run "wt.exe"
}
#+n::
{
if WinExist("ahk_exe notepad++.exe")
red() { echo -ne "\e[91m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
green() { echo -ne "\e[92m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
yellow() { echo -ne "\e[93m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
blue() { echo -ne "\e[94m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
magenta() { echo -ne "\e[95m" >&2; echo -n "$@" >&2; echo -ne "\e[39m" >&2; }
error() { echo -n "$INDENT" >&2; red '#' "$@" >&2; echo >&2; }
success() { echo -n "$INDENT" >&2; green '#' "$@" >&2; echo >&2; }
chapter() { echo -n "$INDENT" >&2; yellow '#' "$@" >&2; echo >&2; }
title() { echo -n "$INDENT" >&2; blue '#' "$@" >&2; echo >&2; }
code() { echo -n "$INDENT" >&2; magenta "$@" >&2; echo >&2; }
@ijortengab
ijortengab / wsl.ps1
Created April 29, 2024 20:47
wsl2 port forwarding host to guest
# @filename: C:\ProgramData\bin\wsl.ps1
# @created: IjorTengab <http://ijortengab.my.id>
# @last-modified: 20240111 Kamis
# @reference: https://jwstanly.com/blog/article/Port+Forwarding+WSL+2+to+Your+LAN/
# @reference: https://www.askvg.com/fix-users-must-enter-a-user-name-and-password-to-use-this-computer-checkbox-missing-in-windows-10/
#
#
#
# Script untuk Menjalankan WSL2 secara otomatis
# plus autorun service
#!/usr/bin/env php
<?php
/**
* @file
* adjust-json-config-windows-terminal-variant-1.php
* @author:
* IjorTengab <https://ijortengab.id>
*/
if (PHP_SAPI !== 'cli' && PHP_SAPI !== 'phpdbg') {
@ijortengab
ijortengab / Hide_Frequent_folders_in_Quick_access.reg
Last active May 26, 2022 00:21
Batch and Registry File for new Computer
Windows Registry Editor Version 5.00
; Created by: Shawn Brink
; http://www.tenforums.com
; Tutorial: http://www.tenforums.com/tutorials/2712-quick-access-add-remove-frequent-folders-windows-10-a.html
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"ShowFrequent"=dword:00000000
vercomp () {
if [[ $1 == $2 ]]; then return 0; fi
local IFS=.
local i ver1=($2) ver2=($1)
# fill empty fields in ver1 with zeros
for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
do
ver1[i]=0
done
for ((i=0; i<${#ver1[@]}; i++))
@ijortengab
ijortengab / check-nginx-server-name.sh
Created December 23, 2020 02:30
Shell Script ini ditujukan bagi anda yang menggunakan Nginx dan mau mengecek setiap virtual host yang terdapat pada directive server_name.
#!/bin/bash
#
# @filename: check-nginx-server-name.sh
# @version: 1.0
# @release-date: 20201223
# @author: IjorTengab <[email protected]>
#
# Shell Script ini ditujukan bagi anda yang menggunakan Nginx dan mau mengecek
# setiap virtual host yang terdapat pada directive server_name.