Skip to content

Instantly share code, notes, and snippets.

View ntnguyencse's full-sized avatar
💭
I may be slow to respond.

Nguyen Thanh Nguyen (Andy) ntnguyencse

💭
I may be slow to respond.
  • @juyoutech
  • Ho Chi Minh
  • 00:39 (UTC +07:00)
View GitHub Profile
#!/bin/bash
set -euo pipefail
# Directory setup
APP_DIR="${HOME}/Applications"
ICON_DIR="${HOME}/.local/share/icons"
DESKTOP_DIR="${HOME}/.local/share/applications"
BIN_DIR="${HOME}/.local/bin"
@arpagon
arpagon / CursorDesktopIntegrator.sh
Last active May 23, 2025 03:40
CursorDesktopIntegrator
#!/bin/bash
# Step 1: Find the latest version of the .AppImage
LATEST_APPIMAGE=$(ls -t $HOME/Applications/cursor-*.AppImage | head -n 1)
echo "Latest AppImage: $LATEST_APPIMAGE"
# Step 2: Update symlink to the latest version
SYMLINK_PATH="$HOME/Applications/cursor.AppImage"
ln -sf $LATEST_APPIMAGE $SYMLINK_PATH
echo "Updated symlink to: $SYMLINK_PATH"
@saiyam1814
saiyam1814 / kubernetes1.28.sh
Last active August 19, 2024 21:24
kubernetes1.28.sh
echo "step1- install kubectl,kubeadm and kubelet 1.28.0"
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
echo "kubeadm install"
sudo apt update -y
sudo apt -y install vim git curl wget kubelet=1.28.0-00 kubeadm=1.28.0-00 kubectl=1.28.0-00
echo "memory swapoff"
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
@paolocarrasco
paolocarrasco / README.md
Last active March 5, 2026 20:31
How to understand the `gpg failed to sign the data` problem in git

Problem

You have installed GPG, then tried to perform a git commit and suddenly you see this error message after it 😰

error: gpg failed to sign the data
fatal: failed to write commit object

Understand the error (important to solve it later!)

@nicklaw5
nicklaw5 / ramdom_sha1.go
Last active December 19, 2022 10:25
Golang - Generate random SHA1 hash
// Source: https://stackoverflow.com/questions/12321133/golang-random-number-generator-how-to-seed-properly
package main
import (
"crypto/sha1"
"fmt"
"math/rand"
"time"
)
@cvan
cvan / HOWTO.md
Last active May 16, 2025 06:07
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you