This file contains hidden or 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 | |
| import readline | |
| import os | |
| import re | |
| import sys | |
| # This will tab-complete from the working directory, starting from /, and going | |
| # through the sub-directories, but it doesn't behave quite the way you expect. | |
| # For instance, it chooses for you if there are two partial matches. |
This file contains hidden or 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/python | |
| """ | |
| This script should be used once to initialize your desktop/command line | |
| application with a oauth access key and access secret. | |
| Your first step is to login, via the web, to your identi.ca account | |
| and authorize your application. Click Edit next to your username | |
| to edit your profile settings. Then click Connections on the left | |
| side bar. Then, in the right sidebar, click |
This file contains hidden or 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
| <html> | |
| <body> | |
| <p>This is my blog about jurisprudence.</p> | |
| <script type='text/javascript' src='http://statatat.ws/widget/ralphbean/embed.js?width=400&height=55&duration=1600&n=10&topic=73360ab012f73b09d6da94787737c058'></script> | |
| <footer>Have a nice day.</footer> | |
| </body> | |
| </html> |
This file contains hidden or 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 | |
| # The above line indicates that this is a python script. | |
| # Author: Ralph Bean <[email protected]> | |
| # This line imports python objects from the scapy module | |
| from scapy.all import sendp, TCP, IP | |
| # Can we get scapy to talk with netcat? | |
| # http://stackoverflow.com/questions/12062781/how-to-make-netcat-display-payload-of-packet | |
| # Run "nc -l 9001" |
This file contains hidden or 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 | |
| import zmq | |
| context = zmq.Context() | |
| publisher = zmq.Socket(zmq.PUB) | |
| # Say I normally have a passive subscriber listening on 9876. | |
| # In the event that that process crashes, and there is nothing listening at | |
| # 9876, I would like to raise an exception/be notified. Can I check for that? |
This file contains hidden or 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 | |
| # Livestream gource to the browser (almost). | |
| # Author: Ralph Bean <[email protected]> | |
| # I'm so sorry. Select the X id of the gource window | |
| xid=$(xwininfo -root -tree | grep Gource | awk '{print $1}' | head -1 | xwininfo -id 0x260000f -children | grep xwininfo | awk '{print $4}') | |
| # Use that as a gstreamer capture source | |
| SRC="ximagesrc xid=$xid use-damage=false" |
This file contains hidden or 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
| @patch("sys.argv", new_callable=lambda: ["pythong", "--snap"]) | |
| def test_that_snap_makes_directory(self, mock_argv): | |
| # TODO, you may want to change the pwd temporarily to /tmp/ or something. | |
| pythong.create_project() | |
| assert(os.path.isdir(THAT_DIR_YOU_WANT)) |
This file contains hidden or 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
| class directory(object): | |
| """ pushd/popd context manager. | |
| Use like: | |
| >>> with directory("/tmp/"): | |
| ... pass # do some stuff | |
| """ | |
| def __init__(self, newPath): |
This file contains hidden or 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
| class directory(object): | |
| """ pushd/popd context manager. | |
| Use like: | |
| >>> with directory("/tmp/"): | |
| ... pass # do some stuff | |
| """ | |
| def __init__(self, newPath): |
This file contains hidden or 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
| """ check_supybot_plugin -- ensure that a plugin is loaded by supybot. | |
| Run like: | |
| check_supybot_plugin --target fedmsg | |
| check_supybot_plugin --target koji --debug | |
| """ | |
| import argparse |