Skip to content

Instantly share code, notes, and snippets.

View aminusia's full-sized avatar

Andi Suryono aminusia

  • Bumpp
  • Malang, Indonesia
View GitHub Profile
@aminusia
aminusia / install_redis.sh
Created February 11, 2023 17:39
Alpine Install Redis CLI
export REDIS_VERSION="6.0.4"
export REDIS_DOWNLOAD_URL="http://download.redis.io/releases/redis-${REDIS_VERSION}.tar.gz"
apk add --update --no-cache --virtual build-deps gcc make linux-headers musl-dev tar openssl-dev pkgconfig
wget -O redis.tar.gz "$REDIS_DOWNLOAD_URL"
mkdir -p /usr/src/redis
tar -xzf redis.tar.gz -C /usr/src/redis --strip-components=1
cd /usr/src/redis/src
make BUILD_TLS=yes MALLOC=libc redis-cli
@aminusia
aminusia / mount.md
Created February 4, 2023 06:52
Mount NVME on AWS with local drive

first get the location nvme drive is located at:

lsblk

mine was always mounted at nvme1n1. Then check if it is an empty volume and doens't has any file system, (it mostly doesn't, unless you are remounting). the output should be /dev/nvme1n1: data for empty drives:

sudo file -s /dev/nvme1n1

Then do this to format(if from last step you learned that your drive had file system and isn't an empty drive. skip this and go to next step):

@aminusia
aminusia / gist:3bb11042576f0586d4bf195fcb737568
Created December 12, 2022 05:21
Create .pem for Apple Passes
Generate Certificate Signing Request
```
openssl req -new -newkey rsa:2048 -nodes -keyout pass.key -out pass.csr
```
Use `pass.csr` to request .cer file from [https://developer.apple.com/account/resources/certificates/add](https://developer.apple.com/account/resources/certificates/add)
Generate intermediary pem file
skip passphrase
@aminusia
aminusia / gist:7af3eacb1f2da23acc2ccbb43106fc21
Created October 27, 2022 06:08
Glass blur using svg clipPath
<div style="
width: 100vw;
height: 100vh;
position: absolute;
z-index: 1000;
">
<div style="
position: absolute;
width: 100%;
height: 100%;
@aminusia
aminusia / gist:af8a1dc905f4e0077217549c386a9cfa
Created October 27, 2022 06:04
Sudo as service user that has no shell access
sudo su SERVICE_USER -s /bin/bash
@aminusia
aminusia / gist:5ef2155b3beb71113b6e60c95f086c4e
Created October 27, 2022 06:02
SSH Port tunelling, expose remote machine port as local port
ssh -NL 3306:127.0.0.1:3306 [email protected]
@aminusia
aminusia / gist:c3c5ace02bf969774767b41d7b2c3619
Last active October 29, 2022 15:35
Forward port listening to WSL2
netsh interface portproxy add v4tov4 listenport=3000 listenaddress=0.0.0.0 connectport=3000 connectaddress=172.25.19.178
# to remove
netsh interface portproxy delete v4tov4 listenport=3000 listenaddress=0.0.0.0
@aminusia
aminusia / gist:28afecfb816392929e8eb8a7d3936624
Last active December 19, 2022 17:16
Laravel Websockets : SSL on Apache Centos 8
## Installations
# ========================================================================
# apache + centos 8
# ========================================================================
# create APP_DOMAIN.conf on /etc/httpd/conf.d/
# fill with vhosts entry
<VirtualHost APP_DOMAIN:80>
ServerName APP_DOMAIN
@aminusia
aminusia / add-storage-block.sh
Created August 16, 2020 09:31
Add storage block to Vultr CC
parted -s /dev/vdb mklabel gpt
parted -s /dev/vdb unit mib mkpart primary 0% 100%
mkfs.ext4 /dev/vdb1
mkdir /mnt/games
echo >> /etc/fstab
echo /dev/vdb1 /mnt/games ext4 defaults,noatime,nofail 0 0 >> /etc/fstab
mount /mnt/games
@aminusia
aminusia / gist:b36a862d7df3ae7746f8d438b56ec328
Created August 1, 2020 12:33
JQuery check if input file is empty
if ($('#videoUploadFile').get(0).files.length === 0) {
console.log("No files selected.");
}