Skip to content

Instantly share code, notes, and snippets.

View aodj's full-sized avatar
⌨️

Alexander O'Donovan-Jones aodj

⌨️
  • Reykjavik, Iceland
View GitHub Profile
@aodj
aodj / create_virtualenv.bat
Last active August 29, 2015 14:05
step #1
:: extract source
call bsdtar.exe xvzf virtualenv-1.11.6.tar.gz
:: switch directories
cd virtualenv-1.11.6
:: make the virtualenv
python virtualenv.py ..\%1
:: install the dependencies
@aodj
aodj / create_virtualenv.bat
Last active August 29, 2015 14:05
step #2
:: extract source
call bsdtar.exe xvzf virtualenv-1.11.6.tar.gz
:: switch directories
cd virtualenv-1.11.6
:: make the virtualenv
python virtualenv.py ..\%1
:: install the dependencies
@aodj
aodj / create_virtualenv.bat
Last active August 29, 2015 14:05
step #3
:: http://www.robvanderwoude.com/ntregistry.php
echo Checking registry for existing Python install path under "HKCU\Software\Python\PythonCore\2.7\InstallPath"
:: query the registry, parse it's output and if we get anything, save it as %installpath%
:: delims is a TAB followed by a space
for /f "tokens=2* delims= " %%A in ('reg query "HKCU\Software\Python\PythonCore\2.7\InstallPath"') do set installpath=%%B
:: if we've got a value in %installpath%, save it out to disk for restoration later
if not "%installpath%"=="" call reg export "HKCU\Software\Python\PythonCore\2.7\InstallPath" installpath.reg && echo Found existing InstallPath, saving to installpath.reg
:: update the registry with the path to our virtualenv
@aodj
aodj / create_virtualenv.bat
Last active August 29, 2015 14:05
step #4
:: extract source
call bsdtar.exe xvzf virtualenv-1.11.6.tar.gz
:: switch directories
cd virtualenv-1.11.6
:: make the virtualenv
python virtualenv.py ..\%1
:: install the dependencies
@aodj
aodj / requirements.txt
Created August 22, 2014 16:57
Output from pip freeze
(venv) C:\testvenv> pip freeze
Jinja2==2.7.3
MarkupSafe==0.23
Pillow==2.5.1
PyYAML==3.11
beautifulsoup4==4.3.2
coverage==3.7.1
docopt==0.6.2
mock==1.0.1
nose==1.3.3
@aodj
aodj / create_virtualenv.sh
Last active August 29, 2015 14:05
step #1
#!/bin/sh
tar xvzf virtualenv-1.11.6.tar.gz
cd virtualenv-1.11.6
sudo python virtualenv.py ../$1
@aodj
aodj / create_virtualenv.sh
Last active August 29, 2015 14:05
step #2
#!/bin/sh
tar xvzf virtualenv-1.11.6.tar.gz
cd virtualenv-1.11.6
sudo python virtualenv.py ../$1
cd ..
source $1/bin/activate
sudo pip install -r mac_requirements.txt
rm -rf virtualenv-1.11.6
deactivate
#!/bin/sh
tar xvzf virtualenv-1.11.6.tar.gz
cd virtualenv-1.11.6
sudo python virtualenv.py ../$1
cd ..
# activate the virtualenv, install the requirements
source $1/bin/activate
sudo pip install -r mac_requirements.txt
@aodj
aodj / ec2metadata.toml
Created August 10, 2015 14:03
Example Heka configuration to get some metadata items from the `ec2metadata` tool
[ec2_metadata]
type = "ProcessInput"
ticker_interval = 10
decoder = "ec2_metadata_decoder"
[ec2_metadata.command.0]
bin = "/usr/bin/ec2metadata"
args = ["--ami-id", "--instance-id", "--instance-type", "--local-ipv4"]
[ec2_metadata_decoder]
{
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"analyze_wildcard": true,
"query": "_type:logs"
}
},