Skip to content

Instantly share code, notes, and snippets.

View masb0ymas's full-sized avatar
🚀
to the moon

N. Fajri masb0ymas

🚀
to the moon
View GitHub Profile
@masb0ymas
masb0ymas / vps-setup.md
Last active November 10, 2025 00:20
VPS Setup

VPS Setup

If you want to set up a production ready VPS, there are a few steps you should take.

This document goes through the list of steps that I personally take.

1. Create a New User with Sudo Permissions

# Log in as root
@masb0ymas
masb0ymas / dump_restore.md
Created October 25, 2024 11:07
dump / restore mysql

Dump MySQL

docker exec db_container_name mysqldump [--user yourusername] [--password=yourpassword] databasename > /desired/path/to/db_dump.sql

Restore MySQL

docker exec -i db_container_name mysql [--user yourusername] [--password=yourpassword] databasename < /path/to/db_dump.sql

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@masb0ymas
masb0ymas / create-react-native.md
Last active April 14, 2025 10:02
Create React Native CLI

Solution that I've found:

Create project from template this way:

npx react-native@latest init myawesomeproject --version 0.74.5 --pm npm --install-pods false

When project is created, install pods the way you usually do it, for example: cd ios && arch -x86_64 pod install for mac with m1 CPU

P.S. I guess --install-pods false is the point there, but feel free to explore deeper

@masb0ymas
masb0ymas / postgres.md
Last active October 25, 2024 11:10
Command Docker PostgreSQL

Dump PostgreSQL

docker exec -i your_pg_container_name /bin/bash -c "PGPASSWORD=your_pg_password pg_dump --username your_pg_username your_database_name" > /desired/path/on/your/machine/dump.sql

for example

docker exec -i 48b0930423ee /bin/bash -c "PGPASSWORD=mylocalpass pg_dump --username postgres db_test_1" > my_db_dump.sql
@masb0ymas
masb0ymas / docker-compose.yml
Created May 18, 2023 11:16
Deploy Auto TLS with Traefik ( Route 53 ) AWS
version: '3.6'
networks:
proxy:
driver: overlay
attachable: true
name: proxy
services:
traefik:
@masb0ymas
masb0ymas / Dockerfile
Created March 29, 2023 01:47
NextJs Build Docker with Output Standalone
FROM node:18-alpine AS base
LABEL author="masb0ymas"
# Install dependencies only when needed
FROM base AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Install dependencies based on the preferred package manager
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
@masb0ymas
masb0ymas / config-laravel.sh
Last active April 7, 2025 05:44
Deployment Laravel
sudo nginx -t
sudo ln -s /etc/nginx/sites-available/example /etc/nginx/sites-enabled
sudo service nginx restart
sudo systemctl restart nginx
// Khusus laravel
// Cara 1 :
sudo chown -R www-data:www-data /var/www/html/MyProject/
sudo chmod -R 755 /var/www/html/MyProject/
php artisan storage:link