Skip to content

Instantly share code, notes, and snippets.

View thewh1teagle's full-sized avatar
💭
coding

thewh1teagle

💭
coding
  • localhost
  • The martian
View GitHub Profile
#!/usr/bin/bash
# Build veracrypt on linux
# Tested on ubuntu 20.10
sudo apt install -y libgtk-3-dev yasm fuse libfuse-dev libcppunit-dev freeglut3-dev
if [ ! -d $(pwd)/wxWidgets ]; then
wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.0.5/wxWidgets-3.0.5.tar.bz2
tar xf wxWidgets-3.0.5.tar.bz2
def dirprint(object): print(i if not i.endswith("_") else "" for i in object)
@thewh1teagle
thewh1teagle / proxy.py
Created January 15, 2021 22:50
selenium python3 proxy chromium
def proxy_driver(proxy, co=co):
prox = Proxy()
prox.proxy_type = ProxyType.MANUAL
prox.http_proxy = proxy
# prox.socks_proxy = proxy
prox.ssl_proxy = proxy
capabilities = webdriver.DesiredCapabilities.CHROME
prox.add_to_capabilities(capabilities)
@thewh1teagle
thewh1teagle / Trigger.js
Created January 17, 2021 23:52
Simulate click event without effecting the UI
var event = document.createEvent("Event");
event.initEvent("click", false, true);
document.getElementById("blah").dispatchEvent(event);
@thewh1teagle
thewh1teagle / blink_off
Created January 18, 2021 01:25
gnome terminal blinking off
@thewh1teagle
thewh1teagle / copy_to_clipboard.py
Last active May 16, 2022 08:23
Python selenium click copy to clipboard button and get text result from clipboard, In a very tricky way
def copy_to_clipboard(driver, button) -> str:
"""
Click 'copy to clipboard button' and return result from clipboard!
args:
driver = Selenium WebDriver
button = WebdriverElement
"""
event_script = """
document.addEventListener('copy', function(e){
var text = window.getSelection().toString()
@thewh1teagle
thewh1teagle / main.py
Created January 19, 2021 23:42
Insert element to list while iterating over it python3
l = ['a', 'b', 'c']
for i, element in enumerate(l):
if element == 'a':
l.insert(i + 1, "surprise after a")
print(element)
@thewh1teagle
thewh1teagle / git_polling.bash
Last active May 16, 2022 08:23
Alternative for github webhook to update the code localy automaticlly
INTERVAL=10 # Seconds
REMOTE="origin"
BRANCH="main"
echo "polling started..."
while true
do
if [[ $(git fetch 2>&1 | grep $BRANCH) ]]; then
git merge $REMOTE/$BRANCH
@thewh1teagle
thewh1teagle / wifi_extender.bash
Last active August 10, 2024 14:42
automaticlly config wifi extender for your PI
#!/usr/bin/bash
# 30/01/2021
# Raspberry pi wifi extender
# Make sure you have 2 wireless interfaces
# Based on https://github.com/mrtejas99/wifi-extender
##### CONFIGURATIONS TO BE CHANGED ####
WLAN0="wlan0"
import io
class FileStream:
def __init__(self):
self.buffer = io.BytesIO()
self.offset = 0
def write(self, bytes):
self.buffer.write(bytes)
self.offset += len(bytes)