Skip to content

Instantly share code, notes, and snippets.

@hatchetation
hatchetation / gist:8720601
Created January 30, 2014 21:47
S3 - restricted bucket (by prefix) template
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::{{bucket}}"
],
@hatchetation
hatchetation / s3-bucket-ro-restricted.json
Created January 30, 2014 21:49
S3 - restricted bucket (by prefix) read-only template
{
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::{{bucket}}"
],
@hatchetation
hatchetation / nova-shell.py
Created April 22, 2014 18:16
A minimal example of using pyrax to get an interactive shell for interacting with Rackspace openstack servers
#!/usr/bin/env python
from os import environ
from IPython import embed
import pyrax
if environ['OS_PASSWORD'] and environ['OS_USERNAME']:
pyrax.set_environment(environ['OS_USERNAME'])
pyrax.set_credentials(environ['OS_USERNAME'], environ['OS_PASSWORD'])
@hatchetation
hatchetation / fs-flavors.txt
Created September 27, 2014 02:22
rackspace flavors
$ nova flavor-list
+------------------+-------------------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID | Name | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+------------------+-------------------------+-----------+------+-----------+------+-------+-------------+-----------+
| 2 | 512MB Standard Instance | 512 | 20 | 0 | 512 | 1 | 80.0 | N/A |
| 3 | 1GB Standard Instance | 1024 | 40 | 0 | 1024 | 1 | 120.0 | N/A |
| 4 | 2GB Standard Instance | 2048 | 80 | 0 | 2048 | 2 | 240.0 | N/A |
| 5 | 4GB Standard Instance | 4096 | 160 | 0 | 2048 | 2 | 400.0 | N/A |
| 6 | 8GB Standard Instance | 8192 | 320 | 0 | 2048 | 4 | 600.0 | N/A |
| 7 | 15GB Standard Instance | 15360
@hatchetation
hatchetation / build_pixelpulse2.md
Last active August 29, 2015 14:18
Building pixelpulse2 for OS X

Building Pixelpulse2

OS X

Prerequisites

  1. Install Qt 5.4 https://www.qt.io/download-open-source/
  2. Install libusb: brew install --build-from-source libusb
  3. Get qt in your path: export PATH="${HOME}/Qt/5.4/clang_64/bin:${PATH}"
@hatchetation
hatchetation / gist:4741189
Created February 8, 2013 19:06
Exception received after successfully registering client w/server using ipa-client-install on Ubuntu 12.04, FreeIPA 3.1.2
Configured /etc/krb5.conf for IPA realm int.example.com
Traceback (most recent call last):
File "/usr/sbin/ipa-client-install", line 2360, in <module>
sys.exit(main())
File "/usr/sbin/ipa-client-install", line 2346, in main
rval = install(options, env, fstore, statestore)
File "/usr/sbin/ipa-client-install", line 2126, in install
api.Backend.xmlclient.connect()
AttributeError: 'NameSpace' object has no attribute 'xmlclient'
$ git fsck
Checking object directories: 100% (256/256), done.
error in commit 66ee656155aa2cd8e1ae7445e94cdd918e5cb976: invalid author/committer line - bad date
error in commit 8d36f03f830351c36ee2852ace50310ffac0fc1d: invalid author/committer line - bad date
error in commit d15ad0f26a8ec4282e400f76b84bbaf91e1dfebc: invalid author/committer line - bad date
error in commit c0ae2b2f85cd5460d9239cbf2f13b899686c34c3: invalid author/committer line - bad date
error in commit 0b36ce6dcbfc8d7e6cda632e06a09c369428a2db: invalid author/committer line - bad date
error in commit 19bdd1f166ac6a05aa1ca9611a9b3dbfc5776319: invalid author/committer line - bad date
error in commit 679343594d86d57c85d1a6bb5333c83ca8bacd78: invalid author/committer line - bad date
error in commit 7ace2ba951a648cfb59218ff0ebcacdc87c5492e: invalid author/committer line - bad date
@hatchetation
hatchetation / gist:5093559
Created March 5, 2013 19:45
/etc/ryslog.d/20-ufw.conf on default ubuntu
:msg,contains,"[UFW " /var/log/ufw.log
#& ~
@hatchetation
hatchetation / ermergerd
Created March 6, 2013 18:14
Problem with Berkshelf upload (1.2.0 and v1.1.6)
vagrant@chef-server14:/vagrant/chef$ berks upload rsyslog
Installing rsyslog (1.1.1) from github: 'josephholsten/opscode-cookbooks-rsyslog' with branch: 'sm' over protocol: 'git'
Uploading rsyslog (1.1.1) to: 'http://bjork:4000/'
Ridley::SandboxUploader crashed!
Faraday::Error::ConnectionFailed: Connection refused - connect(2)
/usr/lib/ruby/1.9.1/net/http.rb:762:in `initialize'
/usr/lib/ruby/1.9.1/net/http.rb:762:in `open'
/usr/lib/ruby/1.9.1/net/http.rb:762:in `block in connect'
/usr/lib/ruby/1.9.1/timeout.rb:54:in `timeout'
/usr/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
@hatchetation
hatchetation / berks-dep.md
Last active December 15, 2015 19:38
Berkshelf troubleshooting

Berksfile

#!/usr/bin/env ruby
site :opscode

[...]
cookbook 'chef-client'
cookbook 'cron'