auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
Thursday, January 29, 2015
NGINX Basic Authorization
Wednesday, January 28, 2015
Hot Chicken Salad
Saturday, December 13, 2014
libGL error: failed to load driver: swrast
SOLUTION
when you run the command
ldconfig -p | grep libGL.so
you want the output to look like this:
libGL.so (libc6,x86-64) => /usr/lib/nvidia-331-updates/libGL.so
libGL.so (libc6) => /usr/lib32/nvidia-331-updates/libGL.so
but it doesn't.
go to
cd /etc/ld.so.conf.d
list all of your files in there
ls
check each file
nano filename.conf
if the file has a line pointing to "/usr/lib/i386-linux-gnu/mesa" replace with "/usr/lib32" or delete the file if another file in the directory already has this then:
sudo ldconfig
and check the output of
ldconfig -p | grep libGL.so
attribution: http://askubuntu.com/questions/313173/why-are-my-32bit-opengl-libraries-pointing-to-mesa-instead-of-nvidia-and-how-do
Tuesday, November 25, 2014
Web scraping databases with Ruby
Web scraping databases with Ruby
Introduction
Ingredients
Alternatively to point 2. above you will need the following bundle:Method
- Examine your target database - you can usually search by some identifier number. What range of numbers does the database employ? Does it count up from 1 or 1000? Are there series of numbers associated with a type of record as part of the set you are acquiring (e.g. individual or corporation)? Does the range have zeros prepended?
- Determine the range of numbers you wish to search.
- Divide this up into manageable sub-ranges if the numbers exceed say 10,000 queries. Or if there are 20 million queries, perhaps you do 20 sub-ranges of a million each.
- Test getting to a sample target record in irb with mechanize first. Can you successfully submit the form? Save the result and examine what appears in your browser.
- If you can get to the target record with mechanize then you have two options: save the html for each record and post-process; or process on the fly. Either way you will be using nokogiri and xpath selectors.
- If you can't figure it out with mechanize (usually because there is a whole pile of javascript going on), then you will have to use the webdriver headless option: start off without headless and test with irb. You may well have to process on the fly, so monitor your records as they come through and restart if something is amiss.
- Process your data with nokogiri and xpath selectors. Using Firebug will help you visualise where things are. Remember: nokogiri structures everything into an onion of associative arrays (hashes).
- Changing the xml tags with nokogiri can sometimes be the silver bullet to help you solve a problem of logic in extracting data!
- Conditional statements are your friend. There may be 5 potential rows of data but only four, three or two appear in various records in your range. Can you use conditional statements about label text or distinguishing tags to help you?
- Save your records as one record per file by the number you searched for in json format as a hash mimicking the website record. You can convert this to csv later for presentation in spreadsheets with the following:
require 'csv'
ary = Array.new
Dir.foreach("data") do |f|
next if f == '.' or f == '..'
# put the file into the hash
record_json = File.open("data#{f}", "r").read
record = JSON.parse(record_json)
ary << record
end
CSV.open("data/data.csv", "wb") do |csv|
csv << ary.first.keys
ary.each do |hash|
csv << hash.values
end
end
Wednesday, February 19, 2014
Chilli Chicken Variation # 3 #paleo
Base:
Butter, onion, sambal oeleck, mustard powder, ground coriander.
"Simmer" on low heat as if to caramelise. Add boiling water as required to prevent burning.
Chicken:
Cut strips of thigh and coat in coconut flour.
Cook:
Braise chicken in base - still on low heat. Add very small amounts of boiling water if required. Add small splashes of maple syrup after chicken is mostly cooked. Then continue to braise for a bit longer than you would expect due to low heat. Chicken juices should eventually moisten the base.
Serve:
Boiled baby carrots and baby corn between roquet garnish around edge of plate.
Wednesday, December 04, 2013
Fruit tipple
Fresh Orange Juice
Kiwi Fruit
Rock Melon
In the blender.
Add white rum and ice, makes its own daiquiri!
Sunday, December 01, 2013
Summer has arrived!
And to celebrate I'm posting an old classic:
Prosciutto
Rock Melon
Tooth picks
Wrap the prosciutto around the rock melon and put a tooth pick in it. How easy is that!?
Thursday, November 07, 2013
Another gluten-free dairy-free biscuit - coconut flavoured
1 cup desiccated coconut
1 cup gluten-free all purpose plain flour
3/4 cup caster sugar
1/4 cup icing sugar
Pinch of gluten-free baking powder
60g melted copha
2 beaten eggs
Generous splash of coconut essence
Hint of vanilla essence
Amounts above may be innaccurate.
Bake at 170 C fanforced for 20 mins
Saturday, November 02, 2013
Variation allegretto on Stephanie Alexander's slow-roasted loin of pork with garlic, rosemary and fennel
We had fennel, celery and some starting-to-grow-old granny smith apples from my recently commenced participation in an organic fruit and vegetable bulk buy and split it up type arrangement.
I followed the recipe in Stephenie Alexander's the cook's companion except as follows:
1. Cut of Pork was pork rib roast (no ribs) aka pork roast aka pork centre loin roast -I ended up cutting it open a bit more to smear the oil mixture over a greater area;
2. Cooked at 250 celsius for 15 minutes, then turned heat down to 200 for further 45 minutes;
3. Absolutely molested the skin with salt to create crackling NOTE: remove crust of salt upon beong cooked;
4. No pork rib bones in the vegetables;
5. Substitue potatoes with granny smith apples.
Flat 2 late breakfast
Semi poached eggs (2 cms of water in pan and dash of vinegar)
Grilled bacon
Dark rye toast
Avocado butter: parsley, tomato relish whizzed avocado
Saturday, September 14, 2013
Gluten-Free Dairy-Free Strawberry Friands
1.5 cups pure icing sugar
1.5 cups almond meal
0.5 cup gluten free plain flour
3 eggs
180 g Copha
Fresh strawberries
While Copha is cooling brush your baking holes with some of the Copha.
Mix sifted icing sugar, almond meal and gluten free plain flower. I cheat and don't sift and use a stick mixer to combine.
Create a well in the dry ingredients and add whisked eggs and cooled Copha.
Mix with a wooden spoon to being with and then bring in the stick mixer.
Fill baking holes to the brim with mixture.
Cut strawberries so as to fit in the centre of the holes. And put in slices of strawberries.
Bake for twenty minutes plus at 180 degrees celsius fan forced.
Tuesday, September 10, 2013
Salmone al udon e insalata di alghe
Teriyaki Salmon
Udon Noodles
Salad:
Grated carrot
Grated beetroot
Cob lettuce leaves
Alfalfa sprouts
Continental parsley
Yakinori seaweed shredded
Saturday, August 24, 2013
Kevin Rudd Brunch Plate
I thought his breakfast looked comically like Kevin. The only thing missing is his tatty hair cut. What a buffoon! Anyway the mouth is sirloin pork. The cheeks, eyes and glasses are toast, eggs, salami, amd cherry tomato. The nose is fresh basil (perennial) leaves.
Wednesday, June 26, 2013
Winter's day beach house salad
Freshly baked salmon.
Shallots.
Cherry tomatoes
Continental parsley
Roquet
Spinach
Olive oil and houmous dressing
Monday, June 10, 2013
Monday, May 27, 2013
Burger
The Meat:
Onion Soup Mix; wet bread; salt and pepper; medium grade beef mince so that there is some fat in it; egg.
Caramelised onions.
Melt the cheese on the last turn of the meat.
Lettuce.
Tomato.
Sliced dill pickle.
Hot English mustard and tomato sauce.
Toast the buns in the oven.
Sunday, April 28, 2013
Monday, March 25, 2013
Poached Eggs and Avocado Mash
Poached Eggs
Avocado Mash: mash avocados with a fork; chopped mini roma tomatoes; crushed clove of garlic; squeeze of fresh lime; salt; pepper
Brown bread toast
Sunday, March 17, 2013
Brunch Plate de Burgh
Bacon
Egg
Chilli-con-carne: half a bulb of garlic, 6 small red chillies, fried in olive oil, add spices (smokey paprika, sweet paprika, cumin seeds, ground cumin, ground coriander seeds), fry beef mince, add tomato paste, add red kidney beans, add crushed tomatoes, plus water and simmer for ages.
Salsa: green capsicum, red onion, mini roma tomatoes, lime juice
Croissant
