Skip to content

Instantly share code, notes, and snippets.

View armandwipangestu's full-sized avatar
:octocat:
Focusing

🇵🇸 Arman (devnull) armandwipangestu

:octocat:
Focusing
View GitHub Profile
@armandwipangestu
armandwipangestu / README.md
Last active August 14, 2024 05:41
Setup Laravel and Docker on Ubuntu Server

Update & Upgrade Package

sudo apt update && sudo apt upgrade

Install package

sudo apt install php-mbstring php-xml php-bcmath php-curl php-cli php-fpm php-mysql unzip mariadb-server
@armandwipangestu
armandwipangestu / README.md
Last active August 13, 2024 11:14
GCP Create SSH Key & Remote VM

Create SSH Key

PROJECT_NAME="foobar_project"
INSTANCE_NAME="foobar_instance"
ssh-keygen -t rsa -f ~/.ssh/${PROJECT_NAME} -C ${INSTANCE_NAME} -b 2048

Copy and Paste the Public Key

@armandwipangestu
armandwipangestu / app.js
Created April 6, 2024 06:08
Example GCP Pub/Sub (Message Broker) Project for Resizing Image From Cloud Storage Bucket
const functions = require('@google-cloud/functions-framework');
const crc32 = require("fast-crc32c");
const { Storage } = require('@google-cloud/storage');
const gcs = new Storage();
const { PubSub } = require('@google-cloud/pubsub');
const imagemagick = require("imagemagick-stream");
functions.cloudEvent('', cloudEvent => {
const event = cloudEvent.data;
@armandwipangestu
armandwipangestu / me.omp.json
Created March 26, 2024 03:26
Oh My Posh Theme
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "left",
"segments": [
{
"background": "#ffffff",
"foreground": "#000000",
"leading_diamond": "\u256d\u2500",
@armandwipangestu
armandwipangestu / script.sh
Created March 25, 2024 19:44
GCP Cheatsheet
# Location: UA, EU, ASIA
export LOCATION=ASIA
# Create a bucket on Cloud Storage
gcloud storage buckets create -l $LOCATION gs://$DEVSHELL_PROJECT_ID
# Download image from Cloud Storage Example into a Cloud Shell
gcloud storage cp gs://cloud-training/gcpfci/my-excellent-blog.png my-excellent-blog.png
# Upload image from Cloud Shell into bucket on Cloud Storage
@armandwipangestu
armandwipangestu / docker-desktop.ps1
Last active March 25, 2024 04:10
Docker Desktop Change Default Installation Drive on Windows
# Run this command below before installing Docker Desktop
# This step manually create symlinks everything about docker desktop installation goes into 'D:\Program Files\Docker'
md "D:\Program Files\Docker\ProgramDataDocker"
md "D:\Program Files\Docker\ProgramDataDockerDesktop"
md "D:\Program Files\Docker\ProgramFiles"
md "D:\Program Files\Docker\RoamingDockerDesktop"
md "D:\Program Files\Docker\RoamingDocker"
md "D:\Program Files\Docker\AppDataDocker"
cmd /c mklink /j "C:\ProgramData\Docker" "D:\Program Files\Docker\ProgramDataDocker"
@armandwipangestu
armandwipangestu / activity_profile.xml
Created November 27, 2023 04:08
User Profile XML
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:background="@color/white"
>
<ScrollView
android:layout_width="match_parent"
@armandwipangestu
armandwipangestu / pdns-script.sh
Created August 16, 2023 04:51
Script for PowerDNS Server (Authoritative)
#!/bin/bash
# Author: Arman Dwi Pangestu
# Github: github.com/armandwipangestu
VERSION=1.0.0
reverse=no
function createZone() {
if [ $reverse == "yes" ]; then
@armandwipangestu
armandwipangestu / FlameSensor.cpp
Last active May 19, 2023 21:21
Arduino Fire Detection Using Flame Sensor And Buzzer
#include <SoftwareSerial.h>
int flameSensor = A0;
int sensorValue = 0;
int ledPin = 9;
int buzzerPin = 10;
String sensorPrint = "Sensor Value: ";
String strConcate;
void setup() {
@armandwipangestu
armandwipangestu / index.php
Last active January 24, 2023 09:30
PHP JAVASCRIPT SELECT OPTION FORM INPUT
<?php
$cars = [
(object) [
"brand" => "Porcshe",
"price" => "5000000000"
],
(object) [
"brand" => "Mazda RX 8",
"price" => "3000000000"