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 / 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 / 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"
@riipandi
riipandi / python-flask.sh
Last active July 20, 2020 14:17
Instalasi Python dan Nginx di Server
# Tahapan :
1. Update komponen sistem operasi :
> apt update
> apt full-upgrade
> apt install net-tools
2. Instalasi Python 3
> apt install python3-all python-is-python3
> apt install python3-pip pipenv
@riipandi
riipandi / application-example.yml
Created July 9, 2020 07:50
Spring Boot Dev Notes
# Database connection parameter
spring.datasource:
url: jdbc:postgresql://localhost:5432/dbname?useSSL=false&useLegacyDatetimeCode=false
username: postgres
password: dbpasswd
# Hibernate ddl auto (create, create-drop, validate, update)
spring.jpa:
database-platform: org.hibernate.dialect.PostgreSQLDialect
hibernate.ddl-auto: update
<VirtualHost *:80>
ServerName ${vhost}
ServerAlias www.${vhost}
DocumentRoot /var/www/${vhost}/public/html
Redirect / https://${vhost}
</VirtualHost>
<VirtualHost *:443>
Header set Strict-Transport-Security "max-age=63072000; includeSubdomains;"
Header set Content-Security-Policy "default-src https://${vhost}:443"
Header set x-frame-options "SAMEORIGIN"
@riipandi
riipandi / unbound-osx-homebrew.md
Last active May 10, 2020 13:30 — forked from denji/unbound-osx-homebrew.md
Install unbound DNS(SEC) resolver on OS X, on the basis of https://www.spatof.org/blog/unbound-dns-resolver-on-osx.html
To install unbound you can use homebrew
$ brew install unbound ldns
Now we can edit the configuration file of unbound which by default is located in /usr/local/etc/unbound/unbound.conf:
@riipandi
riipandi / _readme.md
Last active August 17, 2020 20:46 — forked from irazasyed/1-dnsmasq-dnscrypt-proxy-setup.md
DNSCrypt + dnsmasq-proxy + Laravel Valet

Setup dnsmasq with Cloudflare on macOS

Using Laravel Valet for localhost development, So it installs dnsmasq with it. dnsmasq runs on port 53, The default DNS port. So we setup dnscrypt-proxy on port 5300 with the default config files in this gist.

dnscrypt-proxy Installation

brew install dnscrypt-proxy
@riipandi
riipandi / dbeaverDecryptor.java
Created January 23, 2020 18:47
DBeaver Decryptor
import javax.crypto.*;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.*;
@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 / 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