Skip to content

Instantly share code, notes, and snippets.

View abutcher's full-sized avatar

abutcher

  • Raleigh, NC
View GitHub Profile
@abutcher
abutcher / gist:1971139
Created March 4, 2012 07:35
AndrewsTimeRelativeFuckStoppedDown
def AndrewsTimeRelativeFuckStoppedDown(data):
what_i_care_about = []
# Gather what I care about...
for tweet in data[u'results']:
tweet_date = datetime.datetime(*time.strptime(tweet[u'created_at'],
"%a, %d %b %Y %H:%M:%S +0000")[0:6])
tweet_text = tweet[u'text']
what_i_care_about.append((tweet_date, tweet_text))
@abutcher
abutcher / Keeping this...
Created March 16, 2012 17:29
Something I have to do all the time.
cd /var/www/html/knowledge; drush cc all; drush fra -y; drush fr kcs_settings -y; drush updb -y; drush cc all
@abutcher
abutcher / cjesop
Created June 18, 2012 23:40
cjesop
<abutcher>@(lovecoo)[~/rhat/juicer/juicer/admin] 19:39:21 (juicer-admin⚡)
$ juicer-admin create-user --name "Colonel Jesop" --login cjesop --password cjesop
Successfully created user `Colonel Jesop` with login `cjesop`
<abutcher>@(lovecoo)[~/rhat/juicer/juicer/admin] 19:39:30 (juicer-admin⚡)
$ juicer-admin show-user cjesop
{"_id": "34252863-fb1e-4395-bcbd-7d5d9b3cff0d", "name": "Colonel Jesop", "roles": [], "_ns": "users", "login": "cjesop", "id": "34252863-fb1e-4395-bcbd-7d5d9b3cff0d"}
<abutcher>@(lovecoo)[~/rhat/juicer/juicer/admin] 19:39:39 (juicer-admin⚡)
$ juicer-admin delete-user cjesop
Successfuly deleted user with login `cjesop`
def __upload(self, path, offset, uuid, bufsize):
f = open(path)
f.seek(offset)
while(1):
buf = f.read(bufsize)
if buf:
self.__append(uuid, Bytes(buf))
else:
break
f.close()
...
def upvote
@tweet = Tweet.find(params[:tweet_id])
@tweet.goodvotes = @tweet.goodvotes + 1
@tweet.save
redirect_to :root
end
def downvote
@tweet = Tweet.find(params[:tweet_id])
@abutcher
abutcher / diff
Created July 24, 2012 16:24
Code Walk Results
diff --git a/docs/man/man1/juicer-admin.1.asciidoc.in b/docs/man/man1/juicer-admin.1.asciidoc.in
index 8cf0b0b..10b01d8 100644
--- a/docs/man/man1/juicer-admin.1.asciidoc.in
+++ b/docs/man/man1/juicer-admin.1.asciidoc.in
@@ -5,6 +5,8 @@ juicer-admin(1)
:man version: %VERSION%
:man manual: Pulp repos and release carts
+## WTF IS GOING ON IN HERE?
+
@abutcher
abutcher / butts.diff
Created August 20, 2012 15:19
Juicer Scrum 08/20/2012
diff --git a/juicer/admin/JuicerAdmin.py b/juicer/admin/JuicerAdmin.py
index fc4aabe..f081a6e 100644
--- a/juicer/admin/JuicerAdmin.py
+++ b/juicer/admin/JuicerAdmin.py
@@ -29,6 +29,8 @@ class JuicerAdmin(object):
(self.connectors, self._defaults) = juicer.utils.get_login_info()
+ # vvv THIS IS BAD. WE SHOULD NOT BE EXITING EVAR. PLZ2 Exception.
+
@abutcher
abutcher / ose-migrate.sh
Last active December 19, 2015 06:58
Openshift ose gear migration script to be run from broker...
#!/bin/bash
set -e
OPTS=`getopt -o hdt:f:x: --long help,dry-run,to-host:,from-host:,exclude: -n 'parse-options' -- "$@"`
usage(){
echo "Usage: $0 --help --dry-run --to-host [HOST] --from-host [HOST] --exclude \"[UUID [UUID] ...]\""
exit 1
}
#!/usr/bin/env python
import argparse
import gzip
from BeautifulSoup import BeautifulStoneSoup
import urllib2
import uuid
"""
Looks for duplicate package listings in yum meta-data and prints those
. ./hacking/setup-env
Prefixing PYTHONPATH with /home/abutcher/rhat/juicer:/home/abutcher/rhat/juicer/Juicer/:/home/abutcher/rhat/juicer/JuicerAdmin/
Prefixing PATH with /home/abutcher/rhat/juicer/bin
Prefixing MANPATH with /home/abutcher/rhat/juicer/docs/man
if [ "false" = "true" ]; then \
./hacking/tests | tee /tmp/juicer_tests.log; \
else \
./hacking/tests; \
fi
/home/abutcher/rhat/juicer/juicer/tests