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 / update-path.sh
Last active December 24, 2020 18:09
Script to install Golang on Linux and WSL (Windows Subsystem for Linux)
#!/usr/bin/env bash
if [[ $EUID -ne 1 ]]; then echo -e 'This script must be run as non-root user' ; exit 1 ; fi
# Add Golang to path
echo "Configuring environment variables..."
GOROOT="/usr/local/go"
GOPATH="/mnt/d/Workspace/Goland"
if [ -d "$GOROOT" ]; then
if ! grep -q 'GOPATH' $HOME/.bashrc ; then
@riipandi
riipandi / ssh-notif.sh
Last active July 28, 2018 08:25
Telegram Bot
#!/usr/bin/env bash
# Import credentials form config file
. /etc/tg_ssh_notif.conf
URL="https://api.telegram.org/bot${KEY}/sendMessage"
DATE="$(date "+%d %b %Y %H:%M")"
if [ -n "$SSH_CLIENT" ]; then
CLIENT_IP=$(echo $SSH_CLIENT | awk '{print $1}')
@riipandi
riipandi / edit-hosts.bat
Last active July 24, 2018 18:18
Some Windows 10 Tweaks
@echo off
cls && echo.
:: Edit Hosts
echo. && echo Patching host file
set host=%windir%\System32\drivers\etc\hosts
type nul > %host%
@echo 127.0.0.1 localhost >> %host%
@echo 127.0.0.1 %computername% >> %host%
@riipandi
riipandi / migration-triggers.php
Created June 26, 2018 21:42
Laravel Snippets
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
@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 $_" }
# 1 - Generate Root Certificate
openssl genrsa -out LocalRootCA.key 2048
openssl genrsa -des3 -out LocalRootCA.key 2048
openssl req -x509 -new -nodes -key LocalRootCA.key -sha256 -days 365 -out LocalRootCA.crt \
-subj "/C=ID/ST=West Java/L=Sukabumi/O=LocalDev/OU=RnD/CN=Local Development CA/emailAddress=admin@localhost"
# 2 - Create Client Certificate
export CN="sukabumitoday.test"
openssl genrsa -out $CN.key 2048 && openssl req -new -key $CN.key -out $CN.csr \
-subj "/C=ID/ST=West Java/L=Sukabumi/O=Independent/OU=WebDev/CN=$CN/emailAddress=admin@$CN"
@riipandi
riipandi / raspbian.sh
Last active January 27, 2020 23:32
Rasberry Pi Configuration
# TV Online : https://www.vidio.com/live
useradd -mg sudo -s `which bash` ariss -c "Aris Ripandi" -p `openssl passwd -1 ripandi`
chsh -s `which bash` root ; chsh -s `which bash` ariss ; perl -pi -e 's#(.*sudo.*ALL=)(.*)#${1}(ALL) NOPASSWD:ALL#' /etc/sudoers
apt install axel htop whois binutils dnsutils zip unzip unrar tar p7zip nscd lsof \
crudini openssl openssh-server openssh-client curl screenfetch screen elinks nano
touch /usr/bin/duckdns ; chmod +x /usr/bin/duckdns
cat > /usr/bin/duckdns <<EOF
@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 / firefox.js
Last active February 16, 2018 09:18
My Linux Desktop Customization
/********************************
* github.com/pyllyukko/user.js *
********************************/
lockPref("general.warnOnAboutConfig", false);
lockPref("app.update.enabled", false);
lockPref("app.update.autoInstallEnabled", false);
lockPref("app.update.service.enabled", false);
lockPref("general.autoScroll", false);
lockPref("general.smoothScroll", true);
lockPref("intl.locale.matchOS", true);
@riipandi
riipandi / gitea.service
Last active February 12, 2018 05:25
Build Your Private Git Server
[Unit]
Description=Gitea
After=syslog.target
After=network.target
After=mysql.service postgresql.service memcached.service redis.service
[Service]
Type=simple
User=git
Group=www-data