Skip to content

Instantly share code, notes, and snippets.

View stefanor's full-sized avatar

Stefano Rivera stefanor

View GitHub Profile
cd /dev/shm
git clone --single-branch ~/git/yola/sitebuilderui
git remote rm origin
git update-ref -d refs/tags/pre-template-component-purge
git filter-branch --index-filter '
git ls-files -s \
| sed "s|\t.*/nabtext\.js$|\tnabtext/nabtext.js|" \
# final_package, package, min_rev, max_rev
('python-pysnmp4', 'pysnmp', None, 278),
('python-pysnmp4', 'pysnmp4', 279, 513),
('python-pysnmp4', 'python-pysnmp4', 514, None),
('genshi', 'markup', None, 1463),
('genshi', 'genshi', 1464, None),
# Not actually a rename, but python-cherrypy is gone
('cherrypy3', 'python-cherrypy', None, 1646),
('cherrypy3', 'cherrypy3', 1647, None),
('python-decorator', 'decorator', None, 2111),
@stefanor
stefanor / pycon-wifi.py
Last active August 29, 2015 14:18
PyCon Wifi
#!/usr/bin/env python
import argparse
import logging
import platform
import subprocess
import time
import requests
from requests.exceptions import ConnectionError, ReadTimeout
def relocateable_ve(ve_dir):
log.debug('Making virtualenv relocatable')
virtualenv.make_environment_relocatable(ve_dir)
# Make activate relocatable, using approach taken in
# https://github.com/pypa/virtualenv/pull/236
activate = []
with open(os.path.join(ve_dir, 'bin', 'activate')) as f:
for line in f:
line = line.strip()
======================================================================
FAIL: CheckOpcodeCount (sqlite3.test.hooks.ProgressTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/«BUILDDIR»/pypy-2.3+dfsg/lib-python/2.7/sqlite3/test/hooks.py", line 165, in CheckOpcodeCount
self.assertTrue(first_count > second_count)
AssertionError: False is not true
----------------------------------------------------------------------
Ran 233 tests in 0.469s
#! /usr/bin/perl -W
use strict;
use FileHandle;
use Fcntl qw(:DEFAULT O_DIRECT);
use POSIX;
#use Sys::Mmap;
use integer;
# we have several drives in the array, in different states each
# we keep in in @drv, in no particular order
diff --git a/lib/Map.py b/lib/Map.py
index 1ed1685..28895e8 100644
--- a/lib/Map.py
+++ b/lib/Map.py
@@ -51,7 +51,7 @@ class Map():
def loadMap(self, filepath):
- f = open(filepath)
+ f = open(filepath, 'U')
##########################################################################
#
# Copyright (c) 2005 Imaginary Landscape LLC and Contributors.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
@stefanor
stefanor / worker.py
Last active December 19, 2015 07:49
#!/usr/bin/env python
import os
import threading
import time
class Job(object):
def __init__(self, name, dependants=None):
self.name = name
5.4T total
645G /srv/ftp/pub/linux/ubuntu
499G /srv/ftp/pub/linux/scientific
332G /srv/ftp/pub/bsds/openbsd
329G /srv/ftp/pub/linux/ubuntu-unofficial-packages-dvd
318G /srv/ftp/pub/linux/fedora
270G /srv/ftp/pub/bsds/freebsd
240G /srv/ftp/pub/linux/debian
196G /srv/ftp/pub/FreeBSD/ports
190G /srv/ftp/pub/linux/debian-isos