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/[email protected] | |
cd ~/Downloads/ | |
wget https://extensions.gnome.org/extension-data/customcorner%40eccheng.gitlab.com.v3.shell-extension.zip | |
restart | |
unzip [email protected] -d $HOME/.local/share/gnome-shell/extensions/[email protected] | |
# 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
# 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
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
"""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
""" | |
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
""" | |
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
// We already have a system that allows creating templates with empty placeholder sections for pages of sites as JSON. | |
// We need to take JSON that looks like this and turn it into editable real JSON Schema: | |
template = { | |
"name": "Great Example", | |
"domain": "great.example", | |
"websitemodel": [ | |
{ | |
"uuid": "44c2f597-79ef-49ed-9769-681f72f6b15e", | |
"name": "About and 404 pages", | |
"pagemodel": [ |
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
# xuuid.py | |
""" | |
xuuid 0.1.1 -- Extended Universally Unique Identifiers | |
Extremely large UUIDs that are: | |
more certainly unique, | |
descriptive, | |
supported by tooling for short local reference. | |
There is a distinction made between "hard" and "soft" data for an identifier. |
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
import sys | |
import time | |
import json | |
import os | |
import hashlib | |
from PySide2.QtCore import * | |
from PySide2.QtGui import * | |
from PySide2.QtWidgets import ( | |
QApplication, | |
QTabWidget, |
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 Flask server to echo HTTP request headers as JSON to investigate issues with a CORS proxy. | |
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return jsonify(dict(request.headers)) |