Grok is no longer supported in Plone 5.2 (the first Plone to run on Python 3). Every grok statement can be easily expressed with ZCML. This guide shows how to change code to register ZCA components using ZCML instead of grok.
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
#!/bin/bash | |
# Use this script to set up a stable diffusion web GUI on a vast.ai machine. Invoke it like this: | |
# run: | |
# | |
# wget -q -O - https://gist.githubusercontent.com/silviot/bdf1d0d68901419935463e8d74bc0cd6/raw/vast.ai.sd.setup.sh | bash | |
AUTOMATIC1111_VERSION=${AUTOMATIC1111_VERSION:-master} |
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
#!/bin/sh | |
set -e | |
wget -O- https://getmic.ro | sh | |
sudo mv micro /usr/local/bin/ | |
echo 'export EDITOR="micro"' >> ~/.bashrc | |
echo 'export VISUAL="$EDITOR"' >> ~/.bashrc |
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
#!/bin/bash | |
# This PR lays unmerged, so we apply it with this script: | |
# https://github.com/jsdom/jsdom/pull/3073 | |
find node_modules/ -name xhr-utils.js -exec patch -N -r- {} ./jsdom.patch \; |
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
#!/bin/sh | |
# Script to migrate a zodb from python 2 to python 3 | |
# Needs to be run inside a buildout directory | |
# It is meant to automate the procedure documented here: | |
# https://docs.plone.org/manage/upgrading/version_specific_migration/upgrade_zodb_to_python3.html | |
BUILDOUT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
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 logging | |
import sys | |
import termios | |
fd = sys.stdin.fileno() | |
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(fd) | |
lflag |= termios.ECHO | |
new_attr = [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] | |
termios.tcsetattr(fd, termios.TCSANOW, new_attr) |
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
#!/usr/bin/env python | |
"""Monitor signal strength of wifi deauthentication packets | |
""" | |
from ascii_graph import Pyasciigraph | |
from ascii_graph.colordata import hcolor | |
from ascii_graph.colordata import vcolor | |
from ascii_graph.colors import Blu, Red, Yel, Gre | |
from scapy.all import Dot11, sniff | |
from datetime import datetime | |
from itertools import groupby |
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
# After way too many attempts, this one seems to really work all the time | |
- name: Reboot server | |
shell: sleep 2 && reboot | |
async: 1 | |
poll: 0 | |
failed_when: false | |
become: true | |
- name: Wait for server to initiate shutdown |
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
#!/usr/bin/env python | |
from dns import resolver # dnspython | |
from dns import reversename | |
from dns import rdatatype | |
from ntplib import NTPClient # ntplib | |
from ntplib import NTPException | |
NTP_NAME = '0.europe.pool.ntp.org' | |
NTP_NAME = '0.us.pool.ntp.org' |
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
#!/bin/bash | |
HOST=$1 | |
METRIC=$2 | |
if [ "x$HOST" = "x" ] || [ "x$METRIC" = "x" ]; then | |
exit 1 | |
fi | |
curl "http://$HOST:9200/_cluster/health?format=yaml&pretty=1" 2> /dev/null | grep $METRIC | cut -f2 -d ' ' | sed -e 's/"//g' |
NewerOlder