Skip to content

Instantly share code, notes, and snippets.

View tudoanh's full-sized avatar

Đỗ Anh Tú tudoanh

View GitHub Profile
@tudoanh
tudoanh / imgur_wallpaper.py
Last active April 15, 2024 04:06
Random wallpaper from Imgur
#!/usr/bin/env python3
import sqlite3
import os
import random
import subprocess
import requests
# Set up the database connection and cursor
conn = sqlite3.connect("imgur.db")
c = conn.cursor()
@tudoanh
tudoanh / tele_sticker_convert.py
Created September 25, 2021 01:49
Convert images to required format of Telegram sticker
from PIL import Image
from pathlib import Path
import glob
f_names = glob.glob("./Meme/*.jpg") ## Change this to your directory that hold the memes
for f in f_names:
name = Path(f).stem
@tudoanh
tudoanh / web_to_pdf.py
Created December 3, 2021 03:47
Download web to pdf using google-chrome
#!/usr/bin/env python3
import subprocess
import sys
import requests
import bs4
from slugify import slugify
from rich.console import Console
@tudoanh
tudoanh / gist:64b9d9f65fbd6a3890ebd79418136e11
Created December 12, 2021 06:02 — forked from sunboy-2050/gist:9543963
python implement redis publish and subscribe
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# http://blog.ithomer.net
import time
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
@tudoanh
tudoanh / Engine.py
Created May 16, 2022 15:06 — forked from quantumjim/Engine.py
Gamified tutorial for QISKit to run on PythonAnywhere
# -*- coding: utf-8 -*-
import math
def ClearScreen () :
# DESCRIPTION:
# Prints a whole bunch of space to screen
print("\n"*200)
def ColouredString (message,colour) :
@tudoanh
tudoanh / hackthebox-mnist-without-2.ipynb
Created May 19, 2022 15:58
Hackthebox Mnist without 2
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tudoanh
tudoanh / hackthebox-battle-in-ori-on-pytorch.ipynb
Created May 19, 2022 16:41
Hackthebox Battle in OrI/On Pytorch.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tudoanh
tudoanh / subtitles_solve.py
Created July 19, 2022 03:14
Code for imaginaryCTF forensics "Subtitles" challenge
import ffmpeg
from tensorflow import keras
import cv2
def video_to_data():
# Extract frames from video every 1 second and save to data dir using ffmpeg and start from 0
ffmpeg.input("./subtitles.mp4").output("./data/%d.png", ss="0").run()
@tudoanh
tudoanh / douyin.py
Last active June 3, 2023 09:54
Douyin get video url without watermark
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from webdriver_manager.chrome import ChromeDriverManager
from selenium.webdriver.common.by import By
def get_douyin_video(url):
options = webdriver.ChromeOptions()
chrome_options = {
@tudoanh
tudoanh / bad_words.txt
Last active April 6, 2024 06:29
bad words list
4r5e
5h1t
5hit
a55
anal
anus
ar5e
arrse
arse
ass