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
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.
@ijortengab
ijortengab / IndonesiaDateTime.php
Last active November 14, 2020 13:00
Extends Class DateTime agar memberikan format penamaan hari dan bulan dalam bahasa Indonesia.
<?php
/**
* IndonesiaDateTime.
*
* Extends Class DateTime agar memberikan format penamaan hari dan bulan dalam
* bahasa Indonesia.
*
* @author: IjorTengab
* @last_update: 2020 11 14
@ijortengab
ijortengab / config.inc.local.php
Created January 6, 2019 16:57
Hack ISPConfig agar redirect ke halaman login Roundcube yang sudah auto populate username by URL
<?php
// Direktori: /usr/local/ispconfig/interface/lib
$conf['webmail_url'] = 'https://webmail.example.com';
@ijortengab
ijortengab / pull-db.sh
Created October 8, 2018 04:40
MySQL Synchronize
#!/bin/bash
# Filename: pull-db.sh
# Author: IjorTengab (http://ijortengab.id)
# Last Update: 2018-02-19
# Begin of Variables. Set by your own value.
# SSH.
REMOTE_SSH_HOST=example.com
REMOTE_SSH_PORT=22
REMOTE_SSH_USER=user
<?php
namespace IjorTengab;
class Directory
{
protected $path;
protected $list = array();
protected $filter_dir_only = false;
protected $has_listing = false;