Skip to content

Instantly share code, notes, and snippets.

View BlackHacked's full-sized avatar
📷
Hello World

Latin BlackHacked

📷
Hello World
View GitHub Profile
import base64
import hashlib
import json
import time
import qrcode
import requests
from Crypto.Cipher import AES
@BlackHacked
BlackHacked / README.md
Last active January 27, 2021 09:33 — forked from M0r13n/README.md
Logging with Loguru in Flask

This is a simple example of how to use loguru in your flask application

Just create a new InterceptHandler and add it to your app. Different settings should be configured in your config file, so that it is easy to change settings.

Logging is then as easy as:

from loguru import logger

logger.info("I am logging from loguru!")

@BlackHacked
BlackHacked / ffmpeg.md
Created March 30, 2021 08:18 — forked from v5tech/ffmpeg.md
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@BlackHacked
BlackHacked / helpful-docker-commands.sh
Created May 18, 2021 04:41 — forked from garystafford/helpful-docker-commands.sh
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@BlackHacked
BlackHacked / WSLConfig.md
Created May 28, 2021 03:13 — forked from doggy8088/WSLConfig.md
WSL 2 的 .wslconfig 設定檔說明
  • 編輯 %UserProfile%\.wslconfig 檔案

    • Command Prompt

      notepad %UserProfile%\.wslconfig
    • Windows PowerShell

@BlackHacked
BlackHacked / vcode_gen.py
Created June 21, 2021 03:41 — forked from ayuLiao/vcode_gen.py
python生成验证码,这个漂亮点,代码量也小
from captcha.image import ImageCaptcha # pip install captcha
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
import random
# 验证码中的字符, 就不用汉字了
number = ['0','1','2','3','4','5','6','7','8','9']
alphabet = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
ALPHABET = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
@BlackHacked
BlackHacked / readme.md
Last active March 13, 2023 14:22
n1 docker openwrt

镜像构建

FROM scratch
ADD openwrtmix-n1-R20.2.15-rootfs.tar.gz /
RUN mkdir /var/lock
USER root
CMD /sbin/init

食用方法

@BlackHacked
BlackHacked / chunk_upload.py
Last active October 12, 2021 08:55 — forked from nbari/chunk_upload.py
python chunk upload files
import os
def read_in_chunks(file_object, chunk_size=1000000):
while True:
data = file_object.read(chunk_size)
if not data:
break
yield data
def main(file):
@BlackHacked
BlackHacked / stuns
Created April 13, 2022 06:59 — forked from yetithefoot/stuns
STUN+TURN servers list
{url:'stun:stun01.sipphone.com'},
{url:'stun:stun.ekiga.net'},
{url:'stun:stun.fwdnet.net'},
{url:'stun:stun.ideasip.com'},
{url:'stun:stun.iptel.org'},
{url:'stun:stun.rixtelecom.se'},
{url:'stun:stun.schlund.de'},
{url:'stun:stun.l.google.com:19302'},
{url:'stun:stun1.l.google.com:19302'},
{url:'stun:stun2.l.google.com:19302'},

Without either MONGO_INITDB_ROOT_USERNAME, or MONGO_INITDB_ROOT_PASSWORD the access is unrestricted.

docker-compose.yml:

version: '3'

services:
  mongo:
    image: mongo