Skip to content

Instantly share code, notes, and snippets.

View jmeridth's full-sized avatar
:shipit:
coding

Jason Meridth jmeridth

:shipit:
coding
View GitHub Profile
@jmeridth
jmeridth / error.txt
Created August 17, 2014 04:31
error when logging in to edit home page on new django-cms install
AttributeError at /en-us/
'NoneType' object has no attribute 'has_change_permission'
Request Method: GET
Request URL: http://192.168.100.100:5000/en-us/
Django Version: 1.6.5
Exception Type: AttributeError
Exception Value:
'NoneType' object has no attribute 'has_change_permission'
Exception Location: /home/vagrant/.virtualenvs/playworks_cms/local/lib/python2.7/site-packages/cms/templatetags/cms_tags.py in get_processors, line 352
Python Executable: /home/vagrant/.virtualenvs/playworks_cms/bin/python
class AnonObject(object):
def __init__(self, **kwargs):
self.__dict__.update(kwargs)
@jmeridth
jmeridth / create_mac_address_range.py
Last active June 4, 2018 08:34
add default testing mac_address_range to quark
import requests
import json
HOST = "PUT YOUR IP HERE"
API_VERSION = "v2.0"
ADMIN_PASSWORD = "PUT YOUR ADMIN PASSWORD FROM YOUR DEVSTACK LOCAL.CONF HERE"
url = "http://%s:%s/%s/tokens" % (HOST, "5000", API_VERSION)
data = {'auth': {'tenantName': 'admin', 'passwordCredentials': {'username': 'admin', 'password': ADMIN_PASSWORD}}}
headers = {'Content-Type': 'application/json', 'Accept': 'application/json', 'User-Agent': 'python-neutronclient'}
@jmeridth
jmeridth / .env
Created October 16, 2013 01:06
example env file
AWS_ACCESS_KEY_ID=XXXXXXX
AWS_BUCKET=bucket123445
AWS_SECRET_ACCESS_KEY=XXXXXX
RACK_ENV=development
PORT=5000
@jmeridth
jmeridth / database.yml
Created October 16, 2013 01:04
example database.yml
common: &common
adapter: postgresql
host: localhost
username: username
password: password
development:
<<: *common
database: db_development
# create the shared session:
tmux -S /tmp/pair
# fix perms (inside the session):
chmod 777 /tmp/pair
# others connect with:
tmux -S /tmp/pair a

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@jmeridth
jmeridth / .tmux.conf
Last active December 14, 2015 17:49
my ~/.tmux.conf file
# cheat sheet at http://blog.jasonmeridth.com/2013/03/06/tmux-cheat-sheet.html
# use Ctrl+a instead of Ctrl+b for prefix to commands
unbind C-b
set -g prefix C-a
# start window counting at 1
set -g base-index 1
# faster command sequences

If you are using vagrant, you probably-statistically are using git. Make sure you have its binary folder on your path, because that path contains 'ssh.exe'.

Now, modify C:\vagrant\vagrant\embedded\lib\ruby\gems\1.9.1\gems\vagrant-1.0.3\lib\vagrant\ssh.rb to comment out the faulty Windows check and add a real SSH check:

# if Util::Platform.windows?
  # raise Errors::SSHUnavailableWindows, :host => ssh_info[:host],
                                       # :port => ssh_info[:port],
                                       # :username => ssh_info[:username],
 # :key_path =&gt; ssh_info[:private_key_path]
@jmeridth
jmeridth / luhn.rb
Last active December 14, 2015 12:28
Luhn Checksum implementation
#!/usr/bin/env ruby
# longer version with project structure and specs at https://github.com/jmeridth/luhn
require 'optparse'
def help
puts "Usage: luhn [positive number to validate]"
end