Tuesday, September 24, 2013

Pickle Tickle

There’s no shortage of info and articles about pickling on the lovely internet. Why am I bothering to write one too? Well, all too often, I see a common misconception, where people make pickling seem a lot harder than it should. Perhaps it’s just that some people are misinformed and haven’t bothered experimenting and exploring, and perhaps it’s some desire to make it more “professional” than it truly is. The reality is that pickling stuff can be really easy and quick. You can have a nice jar of pickled cucumbers with just 10 minutes of work, and 4 days of waiting (not 3 months or a year, as some would lead you to think).
 
What pickles a cucumber or other things involves is the combination of the various chemicals, temperature and time. The “what” is available in every supermarket, and the time factor is, as I said above, only a matter of days. What you need for a pickling session is:
 
Hardware:
1. Coffee Kettle (to boil water)
2. Pickling Jars (available at any supermarket, often in a pack of 9 or 12)
3. Knife, to cut things down to size.
 
Ingredients for pickling cucumbers:
1. Cucumbers
2. Water
3. Salt
4. Vinegar
5. Hot peppers
6. Mustard Seeds
7. Black Pepper (dry whole peppercorns)
8. Garlic
9. Dill
 
You can’t really put a 12” cucumber in a jar, so it’s best to seek out small cucumbers. These are rarely available at stores, but can usually be found in Farmer’s markets during the summer. Typically, these are very cheap – around 2$ a pound. Another type of cucumbers that are suitable for pickling are sometimes available at QFC and Costco. These average about 6” in length, so 5-6 of them fit nicely inside a standard 1 Qt pickling jar. It’s also possible to cut regular large cucumbers to slices or strips and pickle those.
 
The hot peppers and Garlic are optional – they are mostly for taste, and if you don’t like this particular taste or prefer another, that’s perfectly fine. Some people like to add lemon wedges to the jar, and others like other spice combinations. Depending on your preferred spiciness level, you might like to use Serrano or Jalapeno peppers (like me), or something stronger like Habanero or even Ghost peppers.
 
Mustard seeds should also be available in any supermarket, usually in a little can or jar that would last for many pickling sessions. The Dill needs to be fresh, and that’s often sold in bunches that would be enough to 3 or more jars. Some people say you need to use the flowering dill bunches, but that’s not true, and any regular dill would do. The vinegar is important, but it can radically affect the taste. If you use White vinegar, that’s OK if you don’t put too much in…but I recommend a milder type like Rice vinegar. A typical $3 pack of dill suffices for 4-5 jars.
 
The process:
1. Put a teaspoon of mustard seeds in the jar.
2. Put a teaspoon of peppercorns in the jar.
3. Put the cucumbers in the jars, and try to pack them as much as you can*, leaving about ½ inch at the top for the dill.
4. Optionally, add garlic cloves, hot peppers, lemon etc. I recommend slicing whatever you add to enhance the flavor.
5. Boil water in a kettle – you’ll need at least a cup per every jar you’re pickling.
6. Add salt to water (1 teaspoon per cup of water) and stir well.
7. Pour into pickling jar slowly until everything is covered. If you pour it too fast, the glass might crack. You might also consider warming the jars ahead of time with warm tap water to reduce the risk of this happening.
8. Fold a bunch of Dill and place on top of the covered cucumbers.
9. Close the jar tightly
10. Let stand for 4 days inside the house, in a place that doesn’t get cold.
11. Open and taste. If the cucumbers are ready (to your taste and opinion), put the jar in the fridge to stop the pickling process.
12. After a day in the fridge, you can move the jars to a cabinet or some other storage place, where they should be fine for many months (in theory, even years).
 
I personally feel the pickles are enjoyable even after 3 days, but an extra day makes them a tad better. Heat facilitates the pickling process, which is why we use boiling water. On the other hand, cold stop it, so make sure the jars are stored indoors. If you are in a hot area, you can also place them outside in the sun – this makes the pickling go even faster…as fast as a single day!
 
* Packing the cucumbers is not mandatory, but if you don’t, you’ll need a lot more water to fill up the jar.

Tuesday, September 10, 2013

Are you sleeping?

When running a server with a large number of sites and using our new Dynamic Worker-Process Page-Out, an administrator might need to figure out what’s going on with the sites for tracking and resource optimization reasons. The simplest way to know of a site going into hibernation is by visiting the event viewer. When IIS puts a site to sleep, it logs an event ID no. 2310, which looks like this:

clip_image002

By querying the event log (with powershell, for example), you can produce a report that lists which sites are getting suspended often. Another type of information you might need is knowing how many of your sites are actually suspended throughout the day. This info can be achieved by examining the Private Working Set Size, which indicates how much memory a process is using. A site that is suspended will typically consume 2-6 MB, while an active site would consume at least 8 MB.

By using WMI to examine the memory usage of all the sites, you can create a data file with this information, which you can later import into something like Excel. Here’s a script for such a thing:

const iForWriting = 2
const iForAppend = 8
iHibernating = 8000000 'Hibernation threshhold
sReportFileName = "SiteReport.csv"
Set oFileObj = CreateObject("Scripting.FileSystemObject")
Set fSaveFile = oFileObj.OpenTextFile(sReportFileName,iForWriting,true)
fSaveFile.Writeline "Date,Time,Active,Hibernating"
fSaveFile.Close
do
set oProcessList = GetObject("winmgmts:{impersonationLevel=impersonate}\\.\root\cimv2").ExecQuery ("Select * From Win32_PerfRawData_PerfProc_Process")
iHibernatingCount = 0
iActiveCount = 0
for each pProcess in oProcessList
if instr(pProcess.name,"w3wp")<> 0 then
if clng(pProcess.WorkingSetPrivate) < iHibernating then
iHibernatingCount = iHibernatingCount +1
else
iActiveCount = iActiveCount +1
end if
end if
next
sResult = date & "," & time & "," & iActiveCount & "," & iHibernatingCount
wscript.echo sResult
Set fSaveFile = oFileObj.OpenTextFile(sReportFileName,iForAppend,true)
fSaveFile.Writeline sResult
fSaveFile.Close
wscript.sleep 60000
loop

This script runs in a loop, checking and counting how many sites are suspended and how many aren’t, and dumping the result into a CSV file every minute. After this runs for a certain amount of time (ideally, at least 24 hours), you could double-click the CSV file to open it in Excel, and use the graph functions to produce a graph, like this:

clip_image004

Based on these figures, you can establish your performance data for peak and off-peak hours, and plan your expansion and hardware budgeting properly.

Good luck!

Blog post written by Erez Benari and Ahmed ElSayed

Monday, September 9, 2013

Hacking doors

A few weeks ago, my 2.5 year old son learned to open doors by twisting the doorknob. Joyous day? Not so much. We still had plenty of places in the house we didn’t want him going into. Naturally, we went to Lowers and got some of the plastic doorknob proofing add-ons, like this:

clip_image001

These are pretty simple – they are composed of two parts, which snap together around the doorknob. This rotates freely, so the kid cannot open the door by twisting it, and to actually twist the knob, you need to insert your fingers through the side-holes and apply pressure. A child doesn’t have large enough hands for this, so that worked pretty well…for a few days.

Indeed, it only took a few days for my junior hacker to figure out that by tugging on this, he was able to unclasp the plastic latches that keep this thing together, and as a result, it comes apart, revealing the knob and allowing him to open the door. What to do?

Lucky for me, I was able to figure out a way to outsmart the smartypants. The latches that hold this thing closed are small, but large enough so I could put a small screw through them, keeping the thing “locked”. I used a small drill-bit to drill through (to make sure the screw doesn’t crack the plastic) and put in very small screws, right there:

clip_image003

Since then, no more break-ins…or break-outs!