Setup New repo
init git:
git init
init git annex:
git annex init local
Add S3 Remote named public-s3
git annex initremote public-s3 type=S3 encryption=none bucket=tyler.zone chunk=0
Add file to git annex
git annex add [big-file]
copy current directory to public-s3 remote
git annex copy --to public-s3
remove local copy—will only remove if already in remote—nothing lost
git annex drop [file]
Commit
git -a -m 'initial commit'
Setup NFS as remote using Rsync over ssh
Add Rsync as unencrypted remote
git annex initremote nas type=rsync rsyncurl=nfs.blazeyandltyler.com:/volume1/homes/tyler/PicturesAnnex encryption=none
Add file to nas
git annex copy --to=nas
Pull down photos
eval (~/.amazonrc)
git annex enableremote public-s3
git annex get [whatever]
Make available to the public (after public s3 setup):
git annex addurl --file [filename] "http://tyler.zone/$(git annex lookupkey [filename])"
List remotes and remote info
Show remotes
git annex enableremote
Show remote info
git annex info [remote-name]
git annex info tylercipriani-raw
Finding info about files
Find a file:
git annex whereis [filename]
Adding a file to http://tyler.zone
eval $(~/.amazonrc)
git annex copy --to=photo-site [file]
git annex addurl --file [file] "http://tyler.zone/$(git annex lookupkey [filename])"
Configuration management software is nice because it lets you be a little dumb. Puppet, Chef, Ansible, and Salt have all managed to smooth down many of the rough edges that were ubiquitous in the terrible bash and perl scripts used for old-time, ad-hoc configuration management.
My main problem with configuration management software is that I’m still dumb. I’m still dumb and there are now new, non-obvious, ways to be dumb.
One non-obvious example is below:
package { 'apache':
ensure => installed,
require => File['/etc/apt/sources.list.d/some_source.list']
}
file { '/etc/apt/sources.list.d/some_source.list':
notify => Exec['apt-get update'],
source => ...
}
exec { 'apt-get update': }
On the surface, this little contrived example seems fine: Apache
requires a special source, adding that source triggers an
apt-get update
. Therefore, before Apache is installed, our
sources list should be up-to-date, right? Wrong.
The problem here is subtle: the
notify => Exec['apt-get update']
in the file resource
means that the file "/etc/apt/sources.d/${name}.list"
has
to exist before apt-get update
is run. Adding
require => File['/etc/apt/sources.list.d/some_source.list']
to the Apache package means that it will be installed only after
"/etc/apt/sources.d/${name}.list"
gets added.
HOWEVER, the Apache package, currently, has no
relationship with apt-get update
. This means Puppet may try
to install the Apache package after adding
/etc/apt/sources.d/some_source.list
, but before
running apt-get update
.
While the short example above is not a problem in isolation, it
can be a problem in a larger manifest. Puppet will succeed with
some packages, fail in others, then create unresolvable
dependency conflicts on the next run (after
apt-get update
has run).
Edit—2016-03-20
This relationship is easier to see when you take advantage of puppet’s
--graph
ability:puppet apply --graph test.pp dot -Tpng /var/lib/puppet/state/graphs/relationships.dot -o Pictures/relationships.png
https://gorails.com/setup/ubuntu/14.04
Check setup
- ruby -v
- gem list selenium
- gem install selenium-webdriver
- Firefox
- IRB
Ruby install
❯ curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | \
rbenv install --patch 2.2.3
~ 6m 50s
❯ rbenv global 2.2.2
~
❯ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
~
❯ echo "gem: --no-ri --no-rdoc" > ~/.gemrc
~
Selenium webdriver
require "selenium-webdriver" https://code.google.com/p/selenium/wiki/RubyBindings
driver.class http://www.rubydoc.info/gems/selenium-webdriver/Selenium/WebDriver/Driver
Core tests
[mw-core]/tests/browser/features/create_account.feature
Schenario Outline can be passed variable
Scenario: [English text] # Just a comment, nothing is parsed
Given [this thing] # Sets up the test
When [other thing] # Action that is part of the test
And
But
Bundler
cd [mwcore]/tests/browser
bundle install
bundle exec cucumber features/create_account.feature:14
Important
export BROWSER=firefox
export MEDIAWIKI_ENVIRONMENT=mw-vagrant-host