This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A PySide2 script to open selected VirtualBox VMs. | |
It shows a list of VirtualBox VM's and that is filtered on every key press (without pressing enter). | |
When enter is pressed, we launch or switch to the first matching VirtualBox machine. | |
Later the filter query is cleared ready for the next interaction. | |
VirtualBox's own GUI doesn't clear it's search box after using it. | |
This annoyed me so I wrote this for my Linux box. | |
It depends on PySide2, wmctrl, and VBoxManage. | |
""" | |
from PySide2.QtWidgets import ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
pingy_meter_now.py is a Python script that shows how reliable your Internet connection is. | |
It graphs how long it takes 8.8.8.8 to respond to ping requests. | |
It depends on plotille. | |
It runs on all Unix systems that support Python 3. | |
Unacceptable ping attempts are marked in red, passes are green, response time is shown in milliseconds. | |
""" | |
try: | |
import plotille |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Saves icons for open X windows to a folder. | |
Pypanel inspired me, by showing that Python can get icons with Xlib. | |
This does that in a more simple and uses PIL to save them too :) | |
""" | |
from PIL import Image | |
from Xlib import X, display, error, Xatom | |
DIRECTORY = "/home/user/icons/" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import sleep | |
from subprocess import check_output | |
from os import system as run | |
def shell(command): | |
return check_output(command, shell=True) | |
def display_count(): | |
return str(shell("xrandr -q")).count(' connected') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Adjust these variables as desired: | |
quality=80 | |
density=200 | |
convert -density $density "$1" -background white -alpha remove -alpha off -compress none BMP3:_temp_conv_file%02d.bmp | |
for f in _temp_conv_file*.bmp; | |
do | |
cjpeg -quality $quality -outfile "$f.jpg" "$f"; | |
done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Something like this: | |
mkdir -p $HOME/.local/share/gnome-shell/extensions/customcorner@eccheng.gitlab.com | |
cd ~/Downloads/ | |
wget https://extensions.gnome.org/extension-data/customcorner%40eccheng.gitlab.com.v3.shell-extension.zip | |
restart | |
unzip customcorner@eccheng.gitlab.com.v3.shell-extension.zip -d $HOME/.local/share/gnome-shell/extensions/customcorner@eccheng.gitlab.com | |
# restart your window manager sesson, for the Wayland window manager this may require logging out, sorry! | |
gnome-tweaks | |
# enable the extension and set the hot spot regions as desired | |
# if you want to lock the computer, this command can help: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# With Termux installed, something like this should work | |
# to type less, you might be able to copy and paste this, | |
# or use Curl / wget | |
# First enable file access permission: | |
termux-setup-storage # accept file access as prompted | |
pkg install clang cmake python openssh libsodium | |
SODIUM_INSTALL=system pip install pynacl # skip building bundled version | |
pip install magic-wormhole | |
sshd | |
wormhole ssh invite # follow directions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from os import system as run | |
from random import random | |
import requests | |
from time import sleep | |
def reconnect_wifi(): | |
run("nmcli d connect wlp3s0") | |
run("firefox http://bbc.co.uk/?"+str(random())) | |
def are_we_connected(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function simulate_input_event(element) { | |
var event = new Event('input', { bubbles: true }); | |
element.dispatchEvent(event); | |
} | |
document.forms[0][0].value='username'; | |
simulate_input_event(document.forms[0][0]); | |
document.forms[0][1].value='password'; | |
simulate_input_event(document.forms[0][1]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credit to https://stackoverflow.com/a/22722889/122364 | |
import uuid | |
import tkinter as tk | |
from tkinter import ttk | |
def json_tree(tree, parent, dictionary): | |
for key in dictionary: | |
uid = uuid.uuid4() | |
if isinstance(dictionary[key], dict): |