Skip to content

Instantly share code, notes, and snippets.

@huyxdong
huyxdong / django_deploy.md
Created October 9, 2023 21:40 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@huyxdong
huyxdong / typescript-crash.ts
Created October 9, 2023 21:35 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@huyxdong
huyxdong / terminal-commands.md
Created October 9, 2023 21:34 — forked from bradtraversy/terminal-commands.md
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen
@huyxdong
huyxdong / Ubuntu
Last active October 2, 2023 05:58
Reinstall OS
We should not install apps from Ubuntu Snap because of compatible issue with system. For example: if we want to use Dash to panel extention, it have to be installed from browser that is not coming from Snap store.
# Dash to panel
Go to Dash to panel settings -> About -> Import settings from /home/huydx/Dropbox/Ubuntu/dash-to-panel-setting
# Install brave browser
sudo apt install apt-transport-https curl
sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
@huyxdong
huyxdong / kafka-cheat-sheet.md
Created September 28, 2023 15:31 — forked from sahilsk/kafka-cheat-sheet.md
Apache Kafka Cheat Sheet

Kafka Cheat Sheet

Display Topic Information

$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic beacon
Topic:beacon	PartitionCount:6	ReplicationFactor:1	Configs:
	Topic: beacon	Partition: 0	Leader: 1	Replicas: 1	Isr: 1
	Topic: beacon	Partition: 1	Leader: 1	Replicas: 1	Isr: 1
@huyxdong
huyxdong / clone.py
Last active February 21, 2024 17:00
Python script to clone a specific user's repos
from github import Github # pip install PyGithub
import os
import argparse
def main():
parser = argparse.ArgumentParser(description='Clone Github Repositories')
parser.add_argument('-u', '--username', dest='github_username', required=True, help='Enter a Github username')
parser.add_argument('-f', '--folder', dest='folder_name', default='', help='Enter a folder to store repositories')
@huyxdong
huyxdong / docker-compose-wordpress.md
Last active June 11, 2023 07:09
Docker compose for a WordPress project

Docker compose for a WordPress project

version: '3'

services:
  wordpress:
    depends_on:
      - db
    image: wordpress

Firebase Setup For House Marketplace

  1. Create Firebase Project
  2. Create "web" app within firebase to get config values"
  3. Install firebase in your project "npm i firebase
  4. Create a config file in your project
  5. Add authentication for email/password and Google
  6. Create a user from Firebase
  7. Enable Firestore
  8. Add rules for firestore
@huyxdong
huyxdong / ssh.md
Created August 2, 2022 06:08 — forked from bradtraversy/ssh.md
SSH & DevOps Crash Course Snippets

SSH Cheat Sheet

This sheet goes along with this SSH YouTube tutorial

Login via SSH with password (LOCAL SERVER)

$ ssh brad@192.168.1.29

Create folder, file, install Apache (Just messing around)

$ mkdir test

$ cd test

@huyxdong
huyxdong / webdev_online_resources.md
Created August 2, 2022 06:08 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)