Skip to content

Instantly share code, notes, and snippets.

View dnhn's full-sized avatar
๐Ÿ› ๏ธ
crafting

Nhan Doan dnhn

๐Ÿ› ๏ธ
crafting
View GitHub Profile
@dnhn
dnhn / webp
Last active April 5, 2025 16:27
Makefiles
# make DIR=~/images
DIR ?= .
GIF_SOURCES := $(wildcard $(DIR)/*.gif)
JPEG_SOURCES := $(wildcard $(DIR)/*.jpeg)
JPG_SOURCES := $(wildcard $(DIR)/*.jpg)
PNG_SOURCES := $(wildcard $(DIR)/*.png)
SOURCES := $(GIF_SOURCES) $(JPEG_SOURCES) $(JPG_SOURCES) $(PNG_SOURCES)
TARGETS := $(SOURCES:.gif=.webp) $(SOURCES:.jpeg=.webp) $(SOURCES:.jpg=.webp) $(SOURCES:.png=.webp)
all: $(TARGETS)
@dnhn
dnhn / git-aws-ec2.md
Last active May 7, 2025 00:25
Git server on AWS EC2 Amazon Linux 2023

Important

sudo must be executed as root user.

sudo yum update -y
sudo yum install git -y
@dnhn
dnhn / mastodon-aws.md
Last active August 18, 2024 00:53
Setup Mastodon on AWS EC2

AWS Services used:

  • EC2
  • S3
  • Cloudfront
  • Route 53
  • ACM
  • IAM

Notes:

  • Most of the shell commands require sudo
@dnhn
dnhn / fah-aws.md
Last active March 27, 2023 08:15
Folding@home on AWS

Original guide

2. Install necessary softwares (replace with version above)

wget https://download.foldingathome.org/releases/public/release/fahclient/debian-stable-64bit/v7.6/fahclient_7.6.21_amd64.deb
wget https://download.foldingathome.org/releases/public/release/fahcontrol/debian-stable-64bit/v7.6/fahcontrol_7.6.21-1_all.deb

sudo dpkg -i --force-depends fahclient_7.6.21_amd64.deb
@dnhn
dnhn / ๐Ÿณ๏ธโ€๐ŸŒˆ.css
Created June 25, 2020 00:42
๐Ÿณ๏ธโ€๐ŸŒˆ Facebook Messenger Pride theme ๐Ÿณ๏ธโ€๐ŸŒˆ
๐Ÿณ๏ธโ€๐ŸŒˆ {
background-attachment: fixed;
background-color: rgb(138, 57, 239);
background-image: linear-gradient(
rgb(255, 0, 24) 0%,
rgb(255, 4, 23) 6.25%,
rgb(255, 49, 14) 12.5%,
rgb(255, 93, 6) 18.75%,
rgb(255, 122, 1) 25%,
rgb(255, 135, 1) 31.25%,
<!--
- 1. Preemptively warm up the fontsโ€™ origin.
-
- 2. Initiate a high-priority, asynchronous fetch for the CSS file. Works in
- most modern browsers.
-
- 3. Initiate a low-priority, asynchronous fetch that gets applied to the page
- only after itโ€™s arrived. Works in all browsers with JavaScript enabled.
-
- 4. In the unlikely event that a visitor has intentionally disabled
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Job finder</title>
<style>
* {
@dnhn
dnhn / bitbucket-rainbow.html
Created June 25, 2018 10:47
BitBucket rainbow ASCII logo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>BitBucket</title>
<style>
html, body {
height: 100%;
@dnhn
dnhn / font-weight
Created September 6, 2017 06:45
Font weight numbers and equivalent style names.
100 Thin
200 Extra Light
300 Light
400 Book / Regular
500 Medium
600 Semibold
700 Bold
800 Extra Bold
900 Black
1000 Ultra