Skip to content

Instantly share code, notes, and snippets.

View bugb's full-sized avatar
🎯
Do it small and do it well!

Kai Nguyen bugb

🎯
Do it small and do it well!
  • Apphub
  • In the cloud
View GitHub Profile
@bugb
bugb / a-man-walking-on-snow.markdown
Created December 16, 2025 12:48
A man walking on snow

A man walking on snow

A man walking on snow. Enjoying the silence and the sound of his own footsteps.


Original concept: Oguzhan Oguzhantufenk

A Pen by Den on CodePen.

@bugb
bugb / get.md
Created December 27, 2023 09:59
Get current P2P trading ads
import requests


headers = {
    "Accept": "*/*",
    "Accept-Encoding": "gzip, deflate, br",
    "Accept-Language": "en-GB,en-US;q=0.9,en;q=0.8",
    "Cache-Control": "no-cache",
 "Connection": "keep-alive",
@bugb
bugb / List-all-slacks-public-channels.md
Last active December 27, 2023 10:06
How to list all public channels in a Slack workspace using API?

1. Set up a Slack App:

Go to the Slack App Management page. Click on "Create New App" and follow the instructions to set up your app.

2. Install App to Workspace:

After creating the app, install it to your workspace. Get OAuth Access Token: Once installed, you'll receive an OAuth access token. This token will be used to authenticate your requests.

3. Run the Python scripts:

@bugb
bugb / gist:91e811a783190d88f183c61cc8ad9ff3
Last active November 25, 2022 06:39
Allocate ECS agent to another ECS cluster
sudo -s
service ecs stop
docker stop ecs-agent
docker rm ecs-agent
mv /var/lib/ecs/data/agent.db{,.bak}
sed -i 's/Prod-BC-ECS-ElasticSearch-Standard-C1/Prod-BC-ECS-ElasticSearch-Premium-C1/g' /etc/ecs/ecs.config
echo -e 'ECS_DATADIR=/data\nECS_ENABLE_TASK_IAM_ROLE=true\nECS_ENABLE_TASK_IAM_ROLE_NETWORK_HOST=true\nECS_LOGFILE=/log/ecs-agent.log\nECS_AVAILABLE_LOGGING_DRIVERS=["json-file","awslogs"]\nECS_LOGLEVEL=info' >> /etc/ecs/ecs.config
echo "ecs config is: "
cat /etc/ecs/ecs.config
@bugb
bugb / arch_installation.md
Created October 27, 2022 18:10 — forked from eltonvs/arch_installation.md
Arch Linux step to step installation guide

Arch Linux Installation Guide

This guide will show step-by-step how to Install Arch Linux on UEFI mode.

Table of Contents

  • Bootable Flash Drive
  • BIOS
  • Pre installation
    • Set Keyboard Layout
    • Check boot mode
  • Update System Clock
@bugb
bugb / arch-i3gaps-install.md
Created October 11, 2022 02:50 — forked from fjpalacios/arch-i3gaps-install.md
Arch + i3-gaps Install Guide

Arch + i3-gaps Install Guide

First set up your keyboard layout. For example, in Spanish:

   # loadkeys es

For a list of all acceptable keymaps:

   # localectl list-keymaps
@bugb
bugb / setup.sh
Created July 16, 2022 04:28 — forked from felipecsl/setup.sh
Base EC2 instance setup for Amazon Linux box
# Install all the packages
sudo yum install -y \
curl gpg gcc gcc-c++ make git \
openssl-devel readline-devel libcurl-devel \
zlib-devel postgresql-server.x86_64 ruby-devel \
sqlite sqlite-devel ruby-rdoc python-devel \
cairo-devel libffi-devel python-pip nc docker \
tmux htop postgresql-libs postgresql-devel \
amazon-cloudwatch-agent
@bugb
bugb / tweepy.md
Created December 26, 2021 19:57
How to get latest tweet for a user with python and tweepy.

Set tweepy

To install tweepy do:

pip install tweepy

More information at http://tweepy.org.

Get keys and tokens from Twitter

@bugb
bugb / S3-Static-Sites.md
Created August 13, 2021 17:02 — forked from bradwestfall/S3-Static-Sites.md
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

Resources