Skip to content

Instantly share code, notes, and snippets.

View dogterbox's full-sized avatar
😴
Working from home

Teerapong Taengmuang dogterbox

😴
Working from home
View GitHub Profile
@dogterbox
dogterbox / dirsize.sh
Last active February 17, 2025 04:50
size of directory
ls -ad /home/username/.* | xargs -I {} du -sh {} | sort -rh
find . -maxdepth 1 -type d -exec du -sh {} \; 2>/dev/null | sort -rh
@dogterbox
dogterbox / git-filter-repo.sh
Created February 23, 2023 06:55
Cleanup files with git-filter-repo
# upgrade git
sudo apt-get install -y python-software-properties software-properties-common
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git -y
# install git-filter-repo
pip3 install git-filter-repo
pip list --format=freeze > requirements.txt
@dogterbox
dogterbox / direnv-sample.sh
Last active April 3, 2023 06:23
Managing Environments with direnv (.envrc)
# REF: https://stackabuse.com/managing-python-environments-with-direnv-and-pyenv/
# installing
curl -sfL https://direnv.net/install.sh | bash
# with bash
echo 'eval "$(direnv hook bash)"' >> ~/.bashrc
source ~/.bashrc
# with zsh
@Williero
Williero / index.html
Created January 14, 2022 23:33 — forked from timothycarambat/index.html
Easy Web3 Meta Mask Login - static HTML and Vanilla JS
<html>
<head>
<title>Web3 Metamask Login</title>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="flex w-screen h-screen justify-center items-center">
<div class="flex-col space-y-2 justify-center items-center">
<button id='loginButton' onclick="" class="mx-auto rounded-md p-2 bg-purple-500 text-white">
@sxiii
sxiii / remove.sh
Created October 5, 2020 05:35
Docker Swarm - Remove all Down nodes automatically
#!/bin/bash
# Requirements: linux, docker, grep, awk
# This script removes all "Down" (off) nodes from Docker Swarm
# Useful to clean stuff from time to time, if you have auto-joining nodes for example
sudo docker node rm $(sudo docker node ls | grep Down | awk -F" " '{ print $1 }')
@joebeeson
joebeeson / docker-compose.yaml
Created August 28, 2020 15:35
Anchors in docker-compose.yaml
version: "3.4"
x-defaults: &defaults
image: "dask-dev/dask-notebook"
# With lists, each entry requires its own anchor if you
# intend to extend/reuse an entry in concrete services.
configs:
- &configs_condarc
source: "condarc"
@carlosmemorandum
carlosmemorandum / get_serial_number.py
Created June 25, 2020 07:57 — forked from angeloped/get_serial_number.py
Python code to get motherboard serial number. For Linux, MacOS, and Windows.
# wmic bios get serialnumber#Windows
# hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.uuid#Linux
# ioreg -l | grep IOPlatformSerialNumber#Mac OS X
import os, sys
def getMachine_addr():
os_type = sys.platform.lower()
if "win" in os_type:
command = "wmic bios get serialnumber"
elif "linux" in os_type:
command = "hal-get-property --udi /org/freedesktop/Hal/devices/computer --key system.hardware.uuid"
@pavankjadda
pavankjadda / Sonarqube with Postgres database using docker.md
Last active May 28, 2025 09:16
Setup Sonarqube with Postgres database using docker

Setup Sonarqube with Postgres database using docker

Both Sonarqube and Postgres database should be same network in order communicate with each other. First create docker network using the following commands

Create docker network

Delete existing docker network and create new docker network sonarqube

docker network rm sonarqube_network
docker network create sonarqube_network

Run PostGres DB container

@fworks
fworks / install-zsh-windows-git-bash.md
Last active April 9, 2025 09:11
Zsh / Oh-my-zsh on Windows Git Bash