Skip to content

Instantly share code, notes, and snippets.

@mattrose
mattrose / gist:ab689f450e3fee33fe286d49b3d78945
Created September 17, 2020 18:06
attempt at vte with background image
from gi.repository import Gtk, Gdk, GdkPixbuf,Vte,GLib
import cairo
win = Gtk.Window()
terminal = Vte.Terminal()
terminal.spawn_async(
Vte.PtyFlags.DEFAULT,
None,
["/bin/zsh"],
# pyinstaller --windowed --noupx -d all -y minivte.py
63 INFO: PyInstaller: 4.1.dev0
63 INFO: Python: 3.8.3
70 INFO: Platform: macOS-10.15.6-x86_64-i386-64bit
71 INFO: wrote /Users/mattrose/Code/minivte/minivte.spec
73 INFO: UPX is not available.
75 INFO: Extending PYTHONPATH with paths
['/Users/mattrose/Code/minivte', '/Users/mattrose/Code/minivte']
86 INFO: checking Analysis
927 INFO: checking PYZ
@mattrose
mattrose / gist:89ad7e6be29b0fc703f63c54f84b0b15
Created September 2, 2020 16:06
mac crash reporter output
Process: minivte [3767]
Path: /Users/USER/*/minivte
Identifier: minivte
Version: ???
Code Type: X86-64 (Native)
Parent Process: zsh [52804]
Responsible: iTerm2 [50222]
User ID: 501
Date/Time: 2020-09-02 12:05:47.775 -0400
mattrose@rome minivte % ./dist/minivte/minivte
minivte.py:3: PyGIWarning: Gtk was imported without specifying a version first. Use gi.require_version('Gtk', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, Gdk,GdkPixbuf,Vte,GLib
minivte.py:3: PyGIWarning: Vte was imported without specifying a version first. Use gi.require_version('Vte', '2.91') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, Gdk,GdkPixbuf,Vte,GLib
objc[3011]: Class GNotificationCenterDelegate is implemented in both /Users/mattrose/Code/minivte/dist/minivte/libgio-2.0.0.dylib (0x10e6322e0) and /usr/local/opt/glib/lib/libgio-2.0.0.dylib (0x113a8f2e0). One of the two will be used. Which one is undefined.
objc[3011]: Class GdkQuartzView is implemented in both /Users/mattrose/Code/minivte/dist/minivte/libgdk-3.0.dylib (0x10eea89b0) and /usr/local/opt/gtk+3/lib/libgdk-3.0.dylib (0x114b489b0). One of the two will be used. Which one is undefined.
objc[3011
@mattrose
mattrose / register_ottawa.sh
Created March 6, 2018 03:22
See if the ottawa swim registration page is responding
#!/bin/bash
### Requires MacOS Mavericks or later (for the notification stuff)
### Pretty useless, just lets you know when the page doesn't respond with that stupid "We are busy" page.
### If anyone in ottawa has any idea on how grab some kind of session id from that, i'd appreciate knowing it!
set -x ;
while [ 1 ] ; do
if curl -s 'https://apps102.ottawa.ca/Start/Start.asp?LanguageId=1&LanguageIndex=1' | grep 'We are busy processing registrations!' ; then
sleep 5
if [ x"$CVSDATE" != x ] ; then
DATEOPT="-D "$CVSDATE""
else
DATEOPT=""
fi
cvs -d $CVSROOT -Q co $BRANCHOPT $DATEOPT $REPOSITORY
@mattrose
mattrose / getstats.sh
Created July 22, 2011 16:07
Get the Stats from the Laurier street bike lane monitoring system
cat << EOF > /dev/null
Alex deVries @mattrose the key is to use an AMF client like pyamf.
Jul 20 22:08:18 in reply to
>> Matt Rose @alexthepuffin I'll give it a shot. It may just be "automating the
hack" but I'll see what I can come up with based on yr description
>>>> Alex deVries For http://t.co/oCb5uZ1 , I need a couple of volunteers to do
one 2min task once per day. On vacation next week. #ottbike apply within
http://twitter.com/#!/alexthepuffin/status/93864847850225665
EOF
rm -rf /tmp/getstats
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAinlDyRIocOIq2lWHAKCHSQAgJO08nQlIhQhpGa0kLcZjCKHdt5Hdu4N+WOkFVOfDJvAJEkWoD5FeYPJlVlHQ+7gTx8p0UFjRx38bj1daSNNmnpN1lURW85dANc+l8QYy/Up/JfkxXLxVJDfV27Ii61s4ZIDrsJYtZHfxpX+3vr8= rsa-key-20100119
p1 = open("passwd").read.split("\n")
s1 = open("shadow").read.split("\n")
s1.delete_if { |ent| ent.split(":")[1] !~ /^\$1\$/ }
shash = Hash[*s1.collect { |e| [e.split(":",2)[0],e.split(":",2)[1]]}.flatten]
phash = Hash[*p1.collect { |e| [e.split(":",2)[0],e.split(":",2)[1]]}.flatten]
newpasswd = open("/tmp/passwd").read
phash.each { |k,v|
unless newpasswd.split("\n").include?(k + ":" + v)
if shash.has_key?(k)
I am not a Buddhist but in the great Well tradition I'll say what I think:
Buddhism is very logical and the first first two noble truths are
provable.
How many people are perfectly content with every single aspect of their
lives? Anyone who might be content about their own life will be discontent
about the state of the economy, the environment, poverty or something
else. Or if they're content today something will disturb it tomorrow.