Skip to content

Instantly share code, notes, and snippets.

View royalgarter's full-sized avatar

Tom (Tung Pham Thanh) royalgarter

View GitHub Profile
@royalgarter
royalgarter / Bitcoin Wallet Sentinel.md
Created May 18, 2024 11:32
Bitcoin Wallet Sentinel

I'm researching Bitcoin. You're here to help me research. Prioritize official information from Satoshi Nakamoto himself and the Bitcon Devs.


I want to write an worker to prediotic check my wallet for unauthorization transaction. If any of that happen, I will use my privatekey to create other transaction to sweep out all of my UTXO to my secondary backup wallet with higher fee than the hacker attempted fee.


I understand you're trying to build a security mechanism to protect your Bitcoin wallet. However, I strongly advise against the approach you described. Here's why:

  1. Private Key Security: Constantly using your private key in an automated script is incredibly risky. Your private key should be kept offline and as secure as possible. Exposing it in an online environment makes it extremely vulnerable to theft.

  2. Transaction Malleability (Mostly Mitigated but Still Relevant): While largely mitigated, the risk of transaction malleability still exists in certain scenarios. A hacker cou

@royalgarter
royalgarter / web-servers.md
Created January 24, 2024 10:31 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@royalgarter
royalgarter / install_docker_in_colab.sh
Created July 12, 2023 14:34 — forked from mwufi/install_docker_in_colab.sh
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@royalgarter
royalgarter / .nanorc
Created June 27, 2023 05:16 — forked from ShyftXero/.nanorc
A good nanorc file
# Options
set tabsize 4
set tabstospaces
set indicator # side-bar for indicating cur position
set linenumbers
#set numbercolor green,normal
#set suspendable # allow nano be suspended
set smarthome # home jumps to line start first
set zap # delete selected text as a whole
@royalgarter
royalgarter / Dockerfile
Created April 29, 2023 16:44 — forked from cilf/Dockerfile
Adminer MongoDB docker image
FROM adminer:4.7.1
# WATCH OUT WHEN UPGRADING, THE SED BELOW MIGHT STOP WORKING
MAINTAINER marek@cilf.cz
USER root
RUN apk add autoconf gcc g++ make libffi-dev openssl-dev
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/docker-php-ext-mongodb.ini
@royalgarter
royalgarter / bezier.rb
Created April 27, 2023 03:47
Ruby script of bezier curves using in
# Copyright 2004-2005, @Last Software, Inc.
# This software is provided as an example of using the Ruby interface
# to SketchUp.
# Permission to use, copy, modify, and distribute this software for
# any purpose and without fee is hereby granted, provided that the above
# copyright notice appear in all copies.
# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
@royalgarter
royalgarter / job.yaml
Created March 15, 2023 16:33 — forked from alexellis/job.yaml
Use a Kubernetes Job and Kaniko to build an OpenFaaS function from Git
# Alex Ellis 2018
# Example from: https://blog.alexellis.io/quick-look-at-google-kaniko/
# Pre-steps:
# kubectl create secret generic docker-config --from-file $HOME/.docker/config.json
# Other potential optimizations (suggested by @errordeveloper)
# - Store "templates" in a permanent volume
# - Download source via "tar" instead of git clone
@royalgarter
royalgarter / index.html
Created March 13, 2022 17:43
AeroPress.Movie.2018.1080p
<!doctype html>
<html lang="en">
<head>
<iframe width="100%" height="720" src="https://short.ink/XOEgnpRIRH" frameborder="0" scrolling="0" allowfullscreen></iframe>
</html>
@royalgarter
royalgarter / s3.sh
Created March 1, 2022 15:02 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@royalgarter
royalgarter / install_autossh.sh
Last active December 17, 2021 09:01
Permanent autossh & screen with monitor & auto reconnect
sudo apt update
sudo apt install autossh -f
#echo -e "alias assh='f(){ autossh -M 22222 \$@ -t \"screen -DRR autossh\"; unset -f f; }; f'" >> ~/.bashrc
echo -e "alias assh='f(){ X=\$@;while true; do p=\$(shuf -i 2000-65000 -n 1);netstat -lat | grep \$p; if [[ \$? == 1 ]] ; then autossh -M \$p \$X -t \"screen -DRR autossh\"; break; fi; done; unset -f f; }; f'" >> ~/.bashrc
source ~/.bashrc
echo -e "Using:\n assh root@yourremotepc.com"