Skip to content

Instantly share code, notes, and snippets.

# Install WireGuard client on RaspberryPi
# 1 # download config file from web ui, for example ~/Downloads/client.conf
# 2 # Install pivpn and Wireguard client for RaspberryPi
sudo -i
apt update
apt dist-upgrade -y
curl -L https://install.pivpn.io | bash
# non interactive installation manual: https://docs.pivpn.io/install/
version: '3.4'
services:
vpn:
image: weejewel/wg-easy
container_name: vpn
restart: always
environment:
- WG_HOST=[IP ADDRESS OF YOUR SERVER]
- PASSWORD=[PASSWORD FOR WEB UI]
import maya.OpenMaya as om
def resolve_file_path_callback(retCode, fileObject, clientData):
old_path = fileObject.rawFullName()
new_path = resolve_path(old_path) # fome resolve function
if new_path:
print('Resolved path {} => {}'.format(old_path, new_path))
fileObject.setRawFullName(new_path)
om.MScriptUtil.setBool(retCode, True)
from PySide6.QtWidgets import *
from PySide6.QtCore import *
from PySide6.QtGui import *
class CourseWidget(QWidget):
def __init__(self):
super().__init__()
self.setWindowFlags(Qt.FramelessWindowHint | Qt.Tool)
from pytube import Playlist, YouTube, Stream
import re
from pathlib import Path
PLAYLIST_URL = 'https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXX'
SAVE_PATH = Path('~/yt').expanduser()
skip_chars = r"""!"#$%&'()*+,./:;<=>?@[\]^`{|}~"""
from PySide2.QtWidgets import *
from PySide2.QtCore import *
from PySide2.QtGui import *
class TransparentWidget(QWidget):
def __init__(self):
super().__init__()
self.setAttribute(Qt.WA_TranslucentBackground, True)
self.setWindowFlags(Qt.FramelessWindowHint)
from pymel.core import *
class CopyOffset(object):
def __init__(self):
self.offs_mx = None
with window():
with verticalLayout():
button(label='Copy', command=Callback(self.copy))
button(label='Paste', command=Callback(self.paste))
import tarfile
import hashlib
import timeit
import os
from pathlib import Path
# create random test files
files_to_archive = []
for i in range(5):
from PySide2.QtGui import *
from PySide2.QtCore import *
from PySide2.QtWidgets import *
def create_icon(text, bg_color, text_color='white', size=64):
pix = QPixmap(QSize(size, size))
pix.fill(Qt.black)
painter = QPainter()
from PySide2.QtCore import *
from PySide2.QtGui import *
from PySide2.QtWidgets import *
from pymel.core import *
text = '''<h2>Title</h2>
Some text
<a href="https://google.com">Help</a>