RSSAmplifier

Blog

Cory Klein

Cory Klein blogs about technology.

coryklein.comRSS feed ↗10 posts

Latest posts

Simple, Quick, and Professional Annotated Screenshots in macOS

Annotating screenshots like this immediately draws attention to the object of interest in a professional manner and seriously levels up what is today becoming a vital communication skill. Although this guide may make the process appear long, with practice it can take less than 15 seconds from start to finish (yes, I timed it) to add one of these annotations to any given screenshot. Make The…

Utah Orchid Flask Group Buy - Spring 2020

Contributions have closed! If you’ve come looking to contribute to the Spring 2020 buy, the contributions are now closed. If you’d like to be notified of the next time we do a group flask buy, then you can share your email address and I’ll ping you when the next one is happening. Subscribe for updates Disclaimer: Flasked orchids are very small and require a particular environment and care to grow…

Scammers Game Amazon A-Z Policy By Replacing iPhones With Clay

This morning I discovered some rather anomalous 1-star reviews on Amazon for the Apple iPhone 6s 128 GB . About 17% of the reviews for that product are 1-star reviews, and many of those are claims (with picture evidence!) that the seller shipped them an iPhone box full of clay, or some other odd object. My first response was confusion. Occasionally here and there a seller might try to ship a box…

Deep Introspection of MySQL Network Connection Packets With Wireshark

Introduction At Domo we recently needed to inspect the network connection between a service and MySQL on a low-level where individual TCP packets could be inspected. We found that when our database went down the connection on the service side would remain for up to 2 hours and wanted to gather more information about why so we could create a targeted fix that we knew would address root cause.…

Monitor Remote Network Traffic With Wireshark Over SSH

SSH Tunelling Wireshark is an extremely useful tool in monitoring and debugging network traffic. However, sometimes you want to view the network traffic on a remote device where using Wireshark’s windowed UI is not feasible. Wireshark does have a command-line interface for doing this, but I find the UI much more approachable. Fortunately, there is an easy way to route the network traffic over SSH…

Custom Configuration of TCP Socket Keep-Alive Timeouts

This post is a modified and improved version of an answer I recently posted on StackOverflow . Introduction TCP connections consist of two sockets, one on each end of the connection. When one side wants to terminate the connection, it sends an RST packet which the other side acknowledges and both close their sockets. Until that happens, however, both sides will keep their socket open indefinitely.…

Using Ansible To Install Headless Google Chrome for Selenium

This last week I needed to install Google Chrome on a headless Ubuntu 14.04 server for use with rendering web assets in via Selenium’s Chrome WebDriver. The configuration took a bit of testing and work to get it all together, so I wanted to share it here. I’ll first go over the general method of how everything is installed, then I’ll share the actual Ansible scripts used to do it. Overview Xvfb…

Recover From Git Force Push

Have you done a git push --force and overwritten some work that you don’t have backed up anywhere else? I just experienced this today but I was able to recover my work. Fortunately, git is pretty good about not throwing away anything, so it is possible your work still exists on the server. In my case, I used git push --force to erase some work on the server knowing that I still had the work on a…

Using Scala's RegexParsers to create a grammar for interpreting a REST data query

Introduction Say we want to provide a way for users to find all brown bunny rabbits under the age of 3 whose name contains the letter c. This is one way we could make such a request via a RESTful api. GET bunnies.com/bunnies?filter=age < 3, name ~ 'c', color == brown In this post, I will explain how to use Scala to create a grammar representing this query that could be used to produce the specific…

Overloading the 'or equals' operator globally for an enum

Here is how to overload the |= operator globally for an enum in C++. class MyClass { public: enum Property { NoProperty = 0 , Flat = 1 , Orange = 2 , Soft = 4 }; //...// }; inline MyClass :: Property & operator |= ( MyClass :: Property & a , MyClass :: Property const b ) { a = static_cast < MyClass :: Property > ( static_cast < int > ( a ) | static_cast < int > ( b )); return a ; }