Skip to content

Instantly share code, notes, and snippets.

View aheadley's full-sized avatar

Alex Headley aheadley

View GitHub Profile
@aheadley
aheadley / warm-cache.sh
Created December 4, 2012 18:56 — forked from fbrnc/gist:3418992
Magento Cache Warming
#!/bin/bash
BASE_URL=http://example.com
SITEMAP_PATH=/sitemap.xml
TMP_URL_FILE=sitemap-urls.txt
curl -s "${BASE_URL}${SITEMAP_PATH}" | \
xpath /dev/stdin '/urlset/url/loc/text()' 2>/dev/null | \
sed 's~http:~\nhttp:~g' > "$TMP_URL_FILE"
HIT: afy.me
HIT: ahz.me
HIT: aih.me
HIT: akf.me
HIT: akq.me
HIT: akv.me
HIT: aky.me
HIT: aqg.me
HIT: aqh.me
HIT: aqn.me
ASRock Z77 Pro3 LGA 1155 Intel Z77 HDMI SATA 6Gb/s USB 3.0 ATX Intel Motherboard
http://www.newegg.com/Product/Product.aspx?Item=N82E16813157297
Intel Core i7-3770 Ivy Bridge 3.4GHz (3.9GHz Turbo) LGA 1155 77W Quad-Core Desktop Processor Intel HD Graphics 4000 BX80637I73770
http://www.newegg.com/Product/Product.aspx?Item=N82E16819116502
(2x) G.SKILL Ripjaws X Series 8GB (2 x 4GB) 240-Pin DDR3 SDRAM DDR3 1600 (PC3 12800) Desktop Memory Model F3-12800CL9D-8GBXL
http://www.newegg.com/Product/Product.aspx?Item=N82E16820231428
EVGA 02G-P4-2678-KR GeForce GTX 670 FTW 2GB 256-bit GDDR5 PCI Express 3.0 x16 HDCP Ready SLI Support Video Card
c.b.a.root
@aheadley
aheadley / 0800271375c4.pxe
Created October 5, 2012 00:01 — forked from robinsmidsrod/_INSTALL.md
Trying out the native iPXE menu feature with Ubuntu 12.04 preseed install working (and also pxe-dispatcher menu default set)
#!ipxe
echo
echo Booting UbuntuVM
set menu-default ubuntu
chain --replace --autofree default.pxe
@aheadley
aheadley / unconnected-regions.py
Created October 1, 2012 22:52
Python script to find unconnected regions
#!/usr/bin/env python
import networkx
import glob
import os.path
def get_subgraphs(regionset_path):
graph = networkx.Graph()
graph.add_nodes_from(get_nodes(regionset_path))
add_node_edges(graph)
$ dd if=/dev/zero of=zero.file bs=1M count=8k
8192+0 records in
8192+0 records out
8589934592 bytes (8.6 GB) copied, 30.8781 s, 278 MB/s
** HIGH LOAD: [email protected] **
$ dd if=zero.file of=/dev/null
16777216+0 records in
16777216+0 records out
8589934592 bytes (8.6 GB) copied, 98.0553 s, 87.6 MB/s
@aheadley
aheadley / gist:3649930
Created September 6, 2012 02:11
dump for git-hub ideas

Usage

git hub <verb> <options>

Examples

  • create repo: git hub repos:create some-project
  • list repos for your user: git hub repos or git hub repos:list
  • list repos for another user: git hub repos other_user
  • fork repo: git hub repos:fork source_user source_repo
@aheadley
aheadley / wrap_text.py
Created August 29, 2012 18:12
ST2 plugin to wrap selected text to 80 chars
import sublime, sublime_plugin
import textwrap
import re
class WrapTextCommand(sublime_plugin.TextCommand):
def run(self, edit, *args):
for region in self.view.sel():
if not region.empty():
m = re.match(r'^(\s*)', self.view.substr(region))
if m:
#!/usr/bin/env python
import packagetrack
import sys
packagetrack.carriers.__carriers = {}
packagetrack.carriers.register_carrier(
packagetrack.carriers.dhl_interface.DHLInterface,
packagetrack.configuration.NullConfig())