Skip to content

Instantly share code, notes, and snippets.

View thewh1teagle's full-sized avatar
💭
coding

thewh1teagle

💭
coding
  • localhost
  • The martian
View GitHub Profile
@thewh1teagle
thewh1teagle / reset_isp.py
Created December 17, 2020 19:54
Reset isp connection on archer vr400 (TP-LINK)
#!/usr/bin/python3
from time import sleep
from datetime import timedelta
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as chrome_Options
from datetime import datetime
import os
def ping(ip):
response = os.system("timeout 0.1 ping -c 1 " + ip + " > /dev/null 2>&1")
pkg install -y vim
mkdir $HOME/bin
FILE="$HOME/bin/termux-file-editor"
echo "!#/bin/bash" > $FILE
echo "vim $1" >> $FILE
chmod +x $FILE
pkg install -y vim
mkdir $HOME/bin
FILE="$HOME/bin/termux-file-editor"
echo "!#/bin/bash" > $FILE
echo 'vim $1' >> $FILE
chmod +x $FILE
#!/usr/bin/env python3
"""
Convert camelCase file into snake_case file using python.
"""
import re
import argparse
import sys
@thewh1teagle
thewh1teagle / off.cmd
Created December 29, 2020 19:44
Turn off monitor immediately Windows 10
@ECHO OFF
SET NORMAL_SEC=300
SET SLEEP_SEC=1
:: Get current power-scheme token
FOR /F "tokens=4 delims= " %%A IN ('POWERCFG /GETACTIVESCHEME') DO (
SET SCHEMETOKEN=%%A
)
@thewh1teagle
thewh1teagle / remove_vowels_from_hebrew.py
Last active May 16, 2022 08:23
Removing Vowels from Hebrew Unicode Text using re module in python
import re
def strip_vowels(text):
return re.sub('[\u0591-\u05C7]', '', text)
@thewh1teagle
thewh1teagle / reset_docker.md
Last active May 16, 2022 08:23
Delete and stop all docker images and containers
sudo docker stop $(sudo docker ps -a -q)
sudo docker rm $(sudo docker ps -a -q)
sudo docker image rm $(sudo docker image ls -q) --force
sudo docker volume rm $(sudo docker volume ls -q) --force
@thewh1teagle
thewh1teagle / sub.js
Created January 8, 2021 20:11
video.js subtitles
<!DOCTYPE html>
<html lang="en">
<head>
<link href="https://vjs.zencdn.net/7.10.2/video-js.css" rel="stylesheet" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<video id="dotsub_example" class="video-js vjs-default-skin" width="640" height="264" poster="http://video-js.zencoder.com/oceans-clip.png" controls preload="auto" data-setup='[]'>
@thewh1teagle
thewh1teagle / colorize.py
Created January 11, 2021 01:13
colorise black and white image in python
import Algorithmia # pip3 install algorithmia
import argparse
# Grab from https://teams.algorithmia.com/signup
API_KEY = "<YOUR API KEY>"
parser = argparse.ArgumentParser(description="Colorize image")
parser.add_argument('-i', required=True, help="input image")
parser.add_argument('-o', required=True, help="output image")
@thewh1teagle
thewh1teagle / README.md
Created January 11, 2021 15:54
move gnome-boxes image to another host

move gnome-boxes image to another host Leave a reply

Let’s answer a few questions before we move:

Q: where does gnome-boxes store images? ~/.local/share/gnome-boxes/images

Q: Are there other directories I need to backup?