- 1 1/2 oz Applejack (Lairds Bottled in Bond or homemade, adjust based on ABV)
- 1/2 oz Homemade Grenadine (Morgenthaler recipe)
- 3/4 oz Fresh squeezed lemon juice
Saturday, July 19, 2025
Jacking It, and by It, I mean Cider
Thursday, July 7, 2022
Bad iframe-resizer Attribute Effects
I have a site that uses iframe-resizer. After some code clean-up, every iframe on the app broke in seven different ways. Practically, this was the worst on pages that had infinite scroll or similar events triggered as the page moved. The resizer was triggering a scroll event which was triggering loading which was triggering more scrolling! To make matters worse, the scroll event handle was either non-existent or it was from jquery, and it was absolutely no help.
In the end, we had configured the attributes on the iframe tag incorrectly. The clean-up had caused them all to be null when compiled into the app, so they never got rendered properly. This didn't show up as null in the final HTML, and there were no helpful errors to guide us. It took a long time to root out.
As you modify a system with iframe-resizer and everything goes to hell, make sure any changes to the iframe tag attributes or configuration is actually getting compiled down properly still. It can save a world of headache.
Tuesday, November 17, 2020
AWS Libraries in C# - Hard to Spot Typo in AWS Credentials File
I encountered an error when trying to run a C# command-line utility with `dotnet run`. The AWS package kept throwing an error, and nothing I did to try to fix it made it work. Here's the error:
Unhandled exception. System.TypeInitializationException: The type initializer for 'Amazon.Runtime.Internal.FallbackInternalConfigurationFactory' threw an exception.
---> System.IO.InvalidDataException: Line 14:<arn:aws:iam::{{AWS Acct ID}}:role/{{Role Name}}
> in file C:\Users\{{User Name}}\.aws\credentials does not contain a section, property or comment.
After digging into the environment vars on my Windows box, trying to set things in PowerShell, and unsetting whatever I could, a co-worker helped me take a second look at the error. My credentials file itself had a typo on line 14. I had chopped off the 'role_arn=' from in front of my developer creds at some time in the past, and this util was the first to try to load it. Once I fixed up the creds, it ran like a champ.
Preserving this here because googling that exact error didn't help me.
Friday, July 27, 2018
Testing Encryption - 3 years of Dan Boneh's Online Cryptography Course
- Test the same plaintext multiple times. Does it need to be different each time? How much of the MAC is different each time? It might help to explore the data your hashing function spits out as it can tell you how your hash function does what it does.
- Replay it. How can a user abuse identical MAC'd data if they replay it at a later date? For a different user? Can you add items to the plaintext that will allow you to validate not only the data but the source or timeframe as well?
- Ensure your hashes are detecting changes. Is your MAC rejected if you change the data at various places within the message?
- Rotate the key. Do you need a hash to survive a key change? Usually you can just regenerate the data and re-MAC it, so figure out if you really need to use MACs over long lifetimes. They're easy to compute.
- Generate a bunch at once. Is performance an issue with the service? Most hashes are built for speed, but is yours?
Time and again, the past three years have taught me that cryptography must be easy for it to be used widely. I've stayed with Signal for text messaging because it just works. I can invite friends and not be embarrassed at its user interface. It doesn't tick all the boxes (anonymity is an issue being a centralized solution), but it has enough features to be useful and few shortcomings. This is the key to widespread adoption of encryption for securing communications. Since Snowden revealed the extent of the NSA's data collection capability, sites everywhere have switched on HTTPS through Let's Encrypt. Learning more about each implementation of SSH and TLS in the course was both informative and daunting. I was anxious to get HTTPS enabled without rehosting the site on my own. Early 2018, Blogger added the ability to do just that through Let's Encrypt. It requires zero configuration once I toggle it on. I can't sing its praises enough. The content of this blog isn't exactly revolutionary, but this little move toward a private and authentic web helps us all.
Dan Boneh's Cryptography course continues to inform my testing. The core lesson still applies: "Never roll your own cryptography." And the second is how fragile these constructs are. Randomness is only random enough given the time constraints. Secure is only secure enough for this defined application. Every proof in the course is only as good as our understanding of the math, and every implementation is vulnerable at the hardware, software, and user layers. In spite of this, it continues to work because we test it and prove it hasn't broken yet. I'm looking forward to another three years of picking it apart.
Tuesday, June 12, 2018
Quotes from Dan Kaminsky's Keynote at DEF CON China
Above is Dan Kaminsky's keynote at the inaugural DEF CON China. It was nominally about Spectre and Meltdown, and I thought it was immediately applicable to testing at all levels. Here are some moments that jumped out at me:
On Context:
On Faulty Assumptions:
On Heuristics
On Bug Advocacy
On Automation
On Testing in the SDLC
Ctd. "Testing shouldn't be split off, but it kinda has to have been because people, when they write code, tend to see that code for what it's supposed to be. And as a tester, you're trying to see it for what it really is. These are two different things." 39:05
"[D]evelopers, who already have a problem psychologically of only seeing what their code is supposed do, are also isolated from all the software that would tell them [otherwise]. Anything that's too testy goes to the test people." 39:30
"[Re: PyAnnotate by @Dropbox] 'This is the thing you don't do. Only the developer is allowed to touch the code.' That is an unnecessary constraint." 43:25
"If I'm using an open source platform, why can't I see the source every time something crashes? ...show me the source code that's crashing...It's lovely." 47:20
"We should not be separating Development and Testing... Computers are capable of magic, and we're just trying to make them our magic..." 59:35
Misc
"Branch Prediction: because we didn't have the words Machine Learning yet. Prediction and learning, of course they're linked. Kind of obvious in retrospect." 27:55"You can have a talent bar for users (N.B.: sliding scale of computer capability) or you can make it really easy to fix stuff." 55:10 #HelpDesk
Sunday, June 10, 2018
Postman Masterclass Pt. 2
- Have a Swagger definition you don't trust? Throw it in the tv4 schema validator.
- Have a deep tree of objects you need to be able to navigate RESTfully? Slice and dice with lodash, pick objects at random, and throw it up into a monitor. Running it every ten minutes should get you down onto the nooks and crannies.
If you have even moderate coding skills among your testers, they can work magic on a Postman budget. If you were used to adding your own libraries in the Chrome App, beware: the move to a packaged app means you no longer have the flexibility to add that needed library on your own (faker, please?).
Tuesday, March 20, 2018
Behat AfterScenario, PHP Garbage Collection, and Singletons
The only thing I knew was the object would get cleared at relatively the same time. I had a set of about 50 different tests in a single feature. This would call an API multiple times, run validations on the responses, and then move on to the next test. All the while, it would put information into the storage object. The test would not just fail in the middle of a scenario, it would generally fail near the same part of a scenario every time. it was timing, an async process, or something was clearing a logjam.
While designing the storage object, I had the bright idea to clear it with every scenario. The singleton acts like a global variable, and a clear after each one would ensure data from one test didn't pop up in another. To make sure i was running this at the last possible moment, I put the clear into the __destruct() method of my context class. By putting the clear in the destructor, I gave PHP permission to handle it as it saw fit. In reality, it sometimes left my scenario objects to linger while running the next (due to a memory leak or similar in Behat itself, or a problem in my code; I couldn't tell).
/**
I first stopped clearing the store and the bugs went away. Whew! But how could I make sure I wasn't contaminating my tests with other data and sloppy design? I tried two things:
1) gc_collect_cycles() forces the garbage collector to run. This seems to have the same effect of stopping the crashes, but it was kind of a cryptic thing to do. I had to put it in the constructor of the Context rather than something that made more sense.
/**
2) Putting in an @AfterScenario test provided the same protection, but it ran, purposefully, after every test was complete. I'm not freeing memory with my clear, so relying on garbage collection wasn't a priority. I just needed it to run last.
/**
http://php.net/manual/en/function.gc-collect-cycles.php
http://docs.behat.org/en/v2.5/guides/3.hooks.html
Monday, February 19, 2018
Kill orphaned processes with awk
When the list gets too long, I like to use awk to comb through the list and kill anything that is found. It's easy to search and parse out the tokens like so:
ps -ef delivers a verbose list of processes. This is piped to awk where I can specify a command using awk's scripting language. In this command, I first search for 'behat'. Then I run a command pulls the second token, the process ID from each line of the result and inserts it into the `kill` command.
Sunday, September 17, 2017
Review: Women in Tech
Five years ago, I found my life turned inside out. People asked me deeply personal questions and questioned my basic competence. In the center of the maelstrom, I found comfort in a book with stories of people like me who were successful in spite of the difficulty. The stories were also paired with advice on how others has survived, thrived, and moved past the traumatic events.
In my case, my spouse had come out and I was coming to grips with my future as a straight half of a mixed orientation marriage. The book that helped me through that was The Other Side of the Closet: The Coming-Out Crisis for Straight Spouses and Families. Just knowing that I was not alone had a powerful influence. Therapy had helped; family could be supportive; friends might be weird. Those stories gave me the strength to say, "This too shall pass."
For me, Women in Tech knocks it out of the park in a similar fashion. Concise, varied, authoritative women have lined up to share their experience making it in tech. Some faced abuse while others encountered discrimination. In the end, most felt the creeping fear of being an imposter (poignant in light of the abuse hurled at Equifax's Music Major CISO). For marginalized groups, simply knowing you're not alone can be enough strength for the day-to-day challenges.
The practical advice made it particularly useful for me. Coming to tech by way of tech support, I had no tutelage in interviewing, technical CV's, and salary negotiation. To this end, I've rewritten my resumé, registered a domain for this humble blog, and continue to try to organize a testing meetup in this desert town of mine. I don't know if each step individually will bear fruit, but together they make me feel less vulnerable to a manager's whim. I have a presence online and a skill to sell independent of any one job.
Broadly, Women in Tech has helped me understand the journey many of my co-workers have made. A fantastic tester with 20 years of experience that is comfortable in OpenVMS still expresses a lack of confidence in interpreting 'man words'. A skilled project manager guided countless projects from C-suite dream to customer reality while being a betimes single mom. Being so broadly defined, tech needs diverse voices at all levels, and it particularly needs women and their contributions supported wherever possible.
There are plenty of gems in the book that I can't begin to address. My heart broke when the advice had to find a balance between optimism and reality. Having my spouse, an engineer by trade, transition made me want to learn more about the trans-in-tech experience. The constant refrain of Impostor's Syndrome makes me want to look for research papers. It is clear that Tarah has captured experiences with a depth and variety unavailable elsewhere.
I wouldn't be a hacker if I didn't mention the brain testing crypto puzzles at the heading of each chapter. Themed on famous women in tech, the learning curve is steep. I am currently stuck and, as the book makes perfectly clear, progress can only be made with help from all sides.
Monday, August 18, 2014
RadioShack LED Strip Driver
The fix was to physically reorder the declaration of red/gree/blue variables in the struct declaration. This way, when the information is written to the strip, it is sent in a different (and now correct) order. You can make the fix yourself by changing the file PololuLedStrip.h:
typedef struct rgb_color {
unsigned char red, green, blue;
} rgb_color;becomes:
typedef struct rgb_color {
unsigned char green, blue, red;
} rgb_color;
And here it is on GitHub: https://github.com/RangerDan/RadioShackTricolorLEDStrip
Friday, August 15, 2014
C3BO: Proof of Concept using Timbermanbot Schematic
This is a proof of concept for @JustinEngler's C3BO (https://github.com/justinengler/C3BO) using transistor controlled relays. It was prototyped by modifying Blink from the Arduino sample project.
The schematic was obtained from Timbermanbot (https://github.com/vheun/ArduinoPlays...) as seen on Hackaday (http://hackaday.com/2014/07/26/pwning...).
In the video, You'll notice I've replaced the touchpad for your finger with a wire to the headphone jack's ground as the circuit ground. The two pieces of copper tape were no longer sticky enough to stay by themselves, so I am holding them down. They press two and 5 with about 8 key presses per second.
Wednesday, May 21, 2014
My Github
And my first project:
https://github.com/RangerDan/rainbow-guess
The work in progress shots from the Misc Electronics post are for this repository. Need to restore some changes lost after a kernel panic on my raspberry pi dev station and then it is a hop, skip and jump to release.
Wednesday, May 7, 2014
Arduino and Other Electronics Projects
Make and RadioShack's Drawdio:
Moving my dev environment to Raspberry Pi. The borrowed laptop I was using is going to be repurposed and will live in an inaccessible place. Here is the Pi running the Arduino IDE.
Used Google, and knowledge from a class at SYN Shop, the local Hackerspace, to remove and troubleshoot this module. It is a Blower Motor Speed Controller from my car's AC. I found out the transistor in it is bad, but replacing it would take more effort than it is worth.