Skip to content

Instantly share code, notes, and snippets.

@nellshamrell
nellshamrell / nell_vimrc
Created June 20, 2012 18:04
Nell's vimrc
" Configuration file for vim
" Some additional configs that Nell prefers
set number
syntax on
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=indent,eol,start " more powerful backspacing
@nellshamrell
nellshamrell / Beneath the Surface: Embracing the True Power of Regular Expressions in Ruby
Last active December 3, 2017 16:35
Resources I consulted when preparing my presentation "Beneath the Surface: Embracing the True Power of Regular Expressions in Ruby"
All of these resources were extremely valuable as I researched regex, finite state machines, and regex in Ruby. Check them out, they're full of fantastic information!
Articles
"Exploring Ruby's Regular Expression Algorithm" by Pat Shaughnessy
http://patshaughnessy.net/2012/4/3/exploring-rubys-regular-expression-algorithm
"Finite State Machines and Regular Expressions" by Eli Bendersky
http://www.gamedev.net/page/resources/_/technical/general-programming/finite-state-machines-and-regular-expressions-r3176
"Regular Expression Matching Can Be Simple and Fast" by Russ Cox
@nellshamrell
nellshamrell / gSchool Regex Resources
Last active March 25, 2016 21:49
Regex Resources for gSchool
Beginning Regex
Intro to Regular Expressions by Michael Fitzgeral
http://www.amazon.com/Introducing-Regular-Expressions-ebook/dp/B008K9OGDA/ref=sr_1_2?ie=UTF8&qid=1374171971&sr=8-2&keywords=Regular+Expressions
Using Regular Expressions in Ruby: Part 1 by Nell Shamrell
https://www.bluebox.net/insight/blog-article/using-regular-expressions-in-ruby-part-1-of-3
Intermediate Regex
* package[apache2] action install (up to date)
* service[apache2] action start (up to date)
* service[apache2] action enable (up to date)
* execute[a2dissite default] action run (skipped due to only_if)
* template[/etc/apache2/sites-available/clowns] action create (up to date)
* execute[a2ensite clowns] action run (skipped due to not_if)
* directory[/srv/apache/clowns] action create (up to date)
* template[/srv/apache/clowns/index.html] action create (up to date)
* template[/etc/apache2/sites-available/bears] action create (up to date)
* execute[a2ensite bears] action run (skipped due to not_if)
@nellshamrell
nellshamrell / gist:a6b9269d98945d7bc198
Last active August 29, 2015 14:09
Nell's Tmux conf
# act like vim
setw -g mode-keys vi
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind-key -r C-h select-window -t :-
bind-key -r C-l select-window -t :+
unbind [
bind ` copy-mode
" Configuration file for vim
set nocompatible " be iMproved, required
filetype off " required
"set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
" "call vundle#begin('~/some/path/here')
@nellshamrell
nellshamrell / gist:0745564772c4d0454c9d
Created May 27, 2015 18:40
Omnibus install error
[Software: version-manifest] I | Resolving manifest entry for version-manifest
[NullFetcher: version-manifest] I | Fetching `version-manifest' (nothing to fetch)
/home/vagrant/.gem/ruby/2.1.5/gems/ruby-progressbar-1.7.5/lib/ruby-progressbar/progress.rb:58:in `progress=': You can't set the item's current value to be greater than
the total. (ProgressBar::InvalidProgressError)
from /home/vagrant/.gem/ruby/2.1.5/gems/ruby-progressbar-1.7.5/lib/ruby-progressbar/base.rb:156:in `block in update_progress'
from /home/vagrant/.gem/ruby/2.1.5/gems/ruby-progressbar-1.7.5/lib/ruby-progressbar/output.rb:38:in `with_refresh'
from /home/vagrant/.gem/ruby/2.1.5/gems/ruby-progressbar-1.7.5/lib/ruby-progressbar/base.rb:155:in `update_progress'
from /home/vagrant/.gem/ruby/2.1.5/gems/ruby-progressbar-1.7.5/lib/ruby-progressbar/base.rb:99:in `progress='
from /home/vagrant/.gem/ruby/2.1.5/bundler/gems/omnibus-9d387525a335/lib/omnibus/fetchers/net_fetcher.rb:173:in `block in downloa
@nellshamrell
nellshamrell / gist:6502904fa35cc9534ac9
Created June 12, 2015 19:02
Setting up Supermarket Manually
## Setting up a private Supermarket manually
### Provision a Supermarket server
Go ahead and spin up a new Ubuntu 14-04 server for your Supermarket install. (This will work with other Operating Systems as well, but these examples will for Ubuntu).
### SSH into your Private Supermarket Server
```bash
$ ssh root@your_private_supermarket_server_ip
Let's say you have a working, running Chef Server. And let's also say you have a working, running, brand new Supermarket you just spun up. Everything appears to be working fine.
BUT - when you click the "Sign In" link in the upper right hand corner of your Supermarket view in your browser, you suddenly see an error that looks like this:
502 Bad Gateway
openresty/1.17.10.1
Oh noes!!!!
This is due to a known issue with the latest version of Chef Server (https://github.com/chef/chef-server/issues/375). A patch has been merged into the main code base for Chef Server, but it has not yet been released. Until then, here is a workaround.
Greetings!
I am happy to report that we have just released Supermarket 2.0.0! The Supermarket - both the public and private versions - continues to evolve to the needs of the Chef community.
As you might guess from the major version bump, this version contains a potentally breaking change. This only occurs on private Supermarkets - those that use the supermarket-omnibus package for their installs. We have added in the ability to to disable ssl through a new environmental attribute: [‘ssl’][‘enabled’].
New Supermarket installs will have [‘ssl’][‘enabled’] set to true by default. However, if you are using an existing Supermarket install and wish to continue using ssl when you upgrade to Supermarket 2.0.0, you will need to explicitly set [‘ssl’][‘enabled’] to true.
With this change, we are now using the Supermarket omnibus install to run the public Supermarket site as well as private Supermarkets. The Supermarket omnibus install is the only officially supported way to run a private Supermarket. Irv