Skip to content

Instantly share code, notes, and snippets.

View annashipman's full-sized avatar

Anna Shipman annashipman

View GitHub Profile
@annashipman
annashipman / gist:d3b0533ce26df1e4dd84fbc3001e98dc
Last active September 20, 2021 21:22
Debugging Clojure/Vagrant for 7 concurrency models in 7 weeks
I am trying to replicate an example from this book: https://uk.bookshop.org/books/seven-concurrency-models-in-seven-weeks-when-threads-unravel/9781937785659
Running the below commands in a lein repl.
In the book, the second `parallel-sum` function executes 2.5x as fast as `sum` but on my Vagrant box (which has 4 cores, and demonstrates other parallelised code having a speed up effect) the two functions take pretty much the same time every time. My Vagrantfile is here https://github.com/annashipman/7weeks-concurrency/blob/main/Vagrantfile
This works in a non-Vagrant Clojure environment, i.e parallel-sum runs much faster.
So, what should I do differently in Vagrant to get it to work?
@annashipman
annashipman / Vagrantfile
Last active July 8, 2021 10:39
Vagrantfile for running Ubiquiti controller software
## Vagrantfile for running Ubiquiti controller software
## Requires a folder alongside it called backup
Vagrant.configure("2") do |config|
  config.vm.box = "bento/ubuntu-20.04"
  config.vm.hostname = "unifi"
  config.vm.provider "virtualbox" do |v|
    v.name = "unifi"
  end
[
{ "userName": "alphagov", "repo": "tsuru-terraform" },
{ "userName": "alphagov", "repo": "tsuru-ansible" },
{ "userName": "alphagov", "repo": "tsuru" },
{ "userName": "alphagov", "repo": "multicloud-deploy" },
{ "userName": "alphagov", "repo": "flask-heroku-sample" },
{ "userName": "alphagov", "repo": "flask-sqlalchemy-postgres-heroku-example" },
{ "userName": "alphagov", "repo": "ansible-role-openconnect" }
]
class Bottles
def song
verses(99, 0)
end
def verses(upper_bound, lower_bound)
upper_bound.downto(lower_bound).map { |i| verse(i) }.join("\n")
end
@annashipman
annashipman / gist:5058831
Created February 28, 2013 18:12
BusinessLink URLs missing from TNA
Old Url,New Url,Status,TNA
http://www.businesslink.gov.uk/301_index.html,,410,404
http://www.businesslink.gov.uk/bdotg/action/bafresults?itemid=1075126058&page=4&purposeid=0&viewpersonallist=false,,410,404
http://www.businesslink.gov.uk/bdotg/action/bafresults?itemid=1079889248&page=1&purposeid=0&viewpersonallist=false,,410,404
http://www.businesslink.gov.uk/bdotg/action/bafresults?itemid=1084691083&page=4&purposeid=1&viewpersonallist=false,,410,404
http://www.businesslink.gov.uk/bdotg/action/bafresults?itemid=1086114725&page=4&purposeid=0&viewpersonallist=false,,410,404
http://www.businesslink.gov.uk/bdotg/action/bafresults?itemid=1086114733&page=4&purposeid=0&viewpersonallist=false,,410,404
http://www.businesslink.gov.uk/bdotg/action/detail?&itemid=1073791294&lang=en&topicid=1073936060&type=resources,,410,404
http://www.businesslink.gov.uk/bdotg/action/detail?&itemid=1073791593&lang=en&topicid=1073959001&type=resources,,410,404
http://www.businesslink.gov.uk/bdotg/action/detail?&itemid=1073791751&lang=_e&to
@annashipman
annashipman / gist:5058829
Created February 28, 2013 18:12
BusinessLink FURLs missing from TNA
Old Url,New Url,Status,TNA
http://www.businesslink.gov.uk/berkshire,,410,404
http://www.businesslink.gov.uk/blackcountry,,410,404
http://www.businesslink.gov.uk/blorg.html,,410,404
http://www.businesslink.gov.uk/businesscontinuity,,410,404
http://www.businesslink.gov.uk/changestosupport,,410,404
http://www.businesslink.gov.uk/contacts,,410,404
http://www.businesslink.gov.uk/countydurham,,410,404
http://www.businesslink.gov.uk/creditcrunch,,410,404
http://www.businesslink.gov.uk/crisismanagement,,410,404
@annashipman
annashipman / gist:5058091
Last active December 14, 2015 08:29
A problem with some FURLs on The National Archives
@annashipman
annashipman / gist:5057991
Created February 28, 2013 16:31
Full page response
annashipman$ curl -v 'http://webarchive.nationalarchives.gov.uk/20120823131012/http://www.businesslink.gov.uk/tools/'
* About to connect() to webarchive.nationalarchives.gov.uk port 80 (#0)
* Trying 194.109.159.6... connected
* Connected to webarchive.nationalarchives.gov.uk (194.109.159.6) port 80 (#0)
> GET /20120823131012/http://www.businesslink.gov.uk/tools/ HTTP/1.1
> User-Agent: curl/7.21.4 (universal-apple-darwin11.0) libcurl/7.21.4 OpenSSL/0.9.8r zlib/1.2.5
> Host: webarchive.nationalarchives.gov.uk
> Accept: */*
>