This document was formed out of the consensus of leaders in software development companies in Cape Town, and proposes some changes to the undergraduate Computer Science curriculum, in order to improve the level of understanding and effectiveness of students, both in order to increase their relevant skills on graduation,
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 | |
"""This is a script for internal use when doing large mail migrations with mbsync | |
See http://isync.sourceforge.net/mbsync.html for more information on the product | |
If IMAP disconnects occur on a large mailbox, the internal .journal file that tracks progress | |
can grow very large in size, though much of the information is not needed | |
This script can be used to reduce the file in size | |
NB: This should be used with caution, and never while mbsync is running | |
It does not replace the file, but can be used to produce a new journal file, |
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 | |
import logging | |
import time | |
import threading | |
import coloredlogs | |
# configured notices that will be displayed with styling by coloredlogs | |
NOTICE = 25 | |
logging.addLevelName(25, 'notice') |
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 | |
boundary="`synclient -l | grep RightButtonAreaTop | sed 's/RightButtonAreaTop//' | sed 's/[ =]//g'`" | |
echo Setting boundary to "$boundary" | |
synclient AreaBottomEdge="$boundary" |
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 | |
echo first uninstall evernote using the wine uninstaller | |
wine uninstaller | |
echo now searching forregistry entry to remove | |
cd ~/.wine/drive_c/windows/profiles/$USER/temp | |
upgrade_code="`grep 'with upgrade code' EvernoteSetup.log | tail -n 1 | sed 's/^.*with upgrade code {\([A-Fa-f0-9-]*\).*$/\1/'`" | |
reverse_upgrade_code="`python -c "x='${upgrade_code}' ; y = x[:18].split('-') ; x = x.replace('-', '') ; z = [a+b for a, b in zip(x[16::2], x[17::2])] ; print ''.join(''.join(reversed(part)) for part in y+z).upper()"`" | |
echo please use regedit to navigate to '\HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes\' and remove the key "$reverse_upgrade_code" | |
wine regedit |
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 | |
import os | |
from lxml import etree | |
import tempfile | |
import sys | |
current_file = sys.argv[1] | |
tree = etree.parse(current_file) | |
root = tree.getroot() |
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 | |
import sqlite3 | |
import logging | |
import shutil | |
# copy | |
shutil.copy2("original.sqlite", "updated.sqlite") | |
original = sqlite3.connect("original.sqlite") | |
backup = sqlite3.connect("backup.sqlite") |
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 cssutils | |
from xml.sax import saxutils | |
from lxml.html import tostring, fromstring, clean | |
from lxml import etree | |
import logging | |
class Cleaner(clean.Cleaner): | |
def clean_html(self, html): | |
if not isinstance(html, unicode): |
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 | |
target_displays="$1" | |
VGA=VGA-0 | |
LVDS=LVDS-0 | |
if [[ "$target_displays" == "auto" || "$target_displays" == "" ]] | |
then | |
xrandr_output="`xrandr -q`" | |
vga_connected=`echo "$xrandr_output" | grep "^$VGA " | cut -d' ' -f2` |
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 | |
import sqlite3 | |
import pprint | |
import datetime | |
import time | |
# install from https://github.com/pmarti/python-messaging/tarball/master - built against 0.5.12 | |
from messaging import sms | |
import pprint |