Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View riipandi's full-sized avatar
🦀
Deep dive into Rust

Aris Ripandi riipandi

🦀
Deep dive into Rust
View GitHub Profile
@riipandi
riipandi / linux-cmd-cheatsheet.md
Created July 12, 2012 12:16
Linux Command Cheat Sheet

#Linux Cheat Sheet

##File Commands:

  • ls – directory listing
  • ls -al – formatted listing with hidden files
  • cd dir - change directory to dir
  • cd – change to home
  • pwd – show current directory
  • mkdir dir – create a directory dir
  • rm file – delete file
@riipandi
riipandi / 00-header
Last active February 24, 2024 14:09
Dynamic SSH Banner (Tutorial by http://oitibs.com/debian-wheezy-dynamic-motd/)
#!/bin/sh
#
# 00-header - create the header of the MOTD
# Copyright (c) 2013 Nick Charlton
# Copyright (c) 2009-2010 Canonical Ltd.
#
# Authors: Nick Charlton <hello@nickcharlton.net>
# Dustin Kirkland <kirkland@canonical.com>
#
# This program is free software; you can redistribute it and/or modify
@riipandi
riipandi / _readme.md
Last active January 1, 2024 07:29
Personal Development Environment Setup

Personal Development Environment Setup

Don't forget to add %LOCALAPPDATA%\Yarn\bin to your PATH if you are using Yarn instead NPM. Windows Defender exclude: %HOMEPATH%\.Rider2019.2 and %HOMEPATH%\.nuget

Get installed VSCode extensions

  • UNIX : code --list-extensions | xargs -L 1 echo code --install-extension > vscode-extensions.txt
  • Windows : code --list-extensions | % { "code --install-extension $_" }
@riipandi
riipandi / squid-plus-mikrotik.txt
Created March 11, 2012 11:02
Squid Proxy & Mikrotik Setup Script
http://ictsentani.org/?p=258
http://opensource.telkomspeedy.com/forum/viewtopic.php?pid=122506
#-------------------------------------------------------------------------------
E1 Modem1 : 192.168.77.1 -> IP Modem1 : 192.168.77.2
E2 Server : 192.168.88.1 -> IP Server : 192.168.88.2
E3 Hotspot : 192.168.99.1 -> IP Hotspot : 192.168.99.10 - 192.168.99.250
E4 Labkom : 10.10.10.254 -> IP Labkom : 10.10.10.1 - 10.10.10.20
#-------------------------------------------------------------------------------
@riipandi
riipandi / wireguard-ubuntu.sh
Last active September 4, 2023 15:08
Wireguard VPN Setup
#!/bin/bash
if [[ $EUID -ne 0 ]]; then echo 'This script must be run as root' ; exit 1 ; fi
[ -z $ROOTDIR ] && PWD=$(dirname $(dirname $(readlink -f $0))) || PWD=$ROOTDIR
source "$PWD/setup.sh"
# --------------------------------------------------------------------------------------------------
# Install and configure WireGuard server
# --------------------------------------------------------------------------------------------------
LC_ALL=C.UTF-8 add-apt-repository -y ppa:wireguard/wireguard && apt -y full-upgrade
apt -y install linux-headers-$(uname -r) wireguard iptables resolvconf qrencode gpw
@riipandi
riipandi / optimator.php
Last active June 27, 2023 20:05
WordPress Snippets
<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
/*
* Plugin Name: Optimator
* Plugin URI: https://aris.web.id/
* Description: Some basic WordPress configuration optimization to make it better than default. This plugin contains other simplified plugins and snippets.
* Author: Aris Ripandi
* Author URI: https://aris.web.id/
* Version: 1.0
* License: GPLv3
* Text Domain: optimator
@riipandi
riipandi / hash.ts
Created May 24, 2022 00:40
Hash in Node.js
import bcrypt from '@node-rs/bcrypt';
export async function hashPassword(str: string): Promise<string> {
return await bcrypt.hash(str, 10);
}
export async function validatePassword(str: string, hash: string): Promise<boolean> {
return bcrypt.verify(str, hash);
}
@riipandi
riipandi / keybase.md
Last active February 3, 2022 17:41
keybase.md

Keybase proof

I hereby claim:

  • I am riipandi on github.
  • I am riipandi (https://keybase.io/riipandi) on keybase.
  • I have a public key whose fingerprint is 2A51 AA3F 81B4 8A92 6916 4754 2874 4492 87E9 BDF3

To claim this, I am signing this object:

@riipandi
riipandi / cloudflare-ddns-updater.sh
Last active January 15, 2022 23:20
Dynamic DNS Updater
#!/bin/bash
## Forked from https://github.com/K0p1-Git/cloudflare-ddns-updater
# Sample crontab per 6 hours: 0 */6 * * * /usr/bin/cloudflare-ddns-updater.sh
AUTH_METHOD="token" # Set to "global" for Global API Key or "token" for Scoped API Token
AUTH_EMAIL="CF_AUTH_EMAIL" # The email used to login 'https://dash.cloudflare.com'
AUTH_KEY="CF_AUTH_KEY" # Your API Token or Global API Key
ZONE_IDENTIFIER="CF_ZONE_ID" # Can be found in the "Overview" tab of your domain
RECORD_NAME="CF_RECORD_NAME" # Example: "sub.domain.com"