Posts

How to block the Admiral anti ad-block detection message

Image
I don't mind seeing the occasional banner or text ad while browsing web sites. What I do mind is malvertising, auto-playing videos (despite steps taken by browsers to stop auto-play) and excessive ads that slow down my browser to the point where it affects the user experience. This is on a modern quad-core desktop PC with 16 GB of RAM.  To that end, I gave in and installed uBlock Origin a few years ago. If ads and third-party tracking hadn't gotten so bad, I would not have had to resort to an ad-blocker. These days, sites are fighting back. They're using ad-block detection scripts in order to request that you whitelist their site. In some cases, I am happy to do this. Recently, I've seen a new one with the logo "Powered by Admiral", which pops up a modal and asks you to whitelist.  These are usually on sites that have a ton of auto-play videos and Taboola ads ("Doctors hate this one weird trick!"). I get it. Sites need ad revenue to fund thei...

Nested switch in PHP 5.6 syntax

I had a bit of trouble with nested selects in PHP 5.6 (not sure of the differences for other versions).  I went down the wrong path of thinking my problem was with global vs. local variable scope, but that wasn't the case. The PHP documentation doesn't go enough detail for nested switches as far as having multiple default outcomes, but this works.  Example: $color = "red"; $size = "large"; switch ($color) { case "blue": $sku = "5327"; break; case "white": $sku = "5328"; break; case "red": switch ($size) { case "small": $sku = "5329-1"; break; case "medium": $sku = "5329-2"; break; case "large": $sku = "5329-3"; break; default: $sku = "5329"; break; }; break; default: $sku = "0"; ...

Black Friday and Cyber Monday - Web Hosting, VPS, and Dedicated Hosting deals

Image
Turnkey Internet is out with their Black Friday / Cyber Monday 2019 deals. You can get shared web hosting for $1/mo. (this is far cheaper than GoDaddy, Bluehost, Hostgator, etc.), or a KVM VPS for as low as $4.99/mo as well as other tempting dedicated hosting deals. I have personally used their shared web hosting plan for multiple years, and it is rock solid. For the $4.99 KVM VPS, they are doubling the CPU and Disk to 4 GB RAM and 40 GB of SSD space, which is quite good. And likewise you can get a massive 8 GB RAM and 80 GB SSD KVM VPS for $9.99/mo. Compare to OVH/Hetzner for $13.99, Vultr for $20, Linode or Ramnode for $40 (albeit with a 160 GB SSD). A bonus for me is that they own their own data center in upstate New York, and it uses clean hydro power from Niagara Falls. This lets me feel better about how my servers are powered. FTC Disclosure: this is an affiliate link.

Bank of America 3% online stores - which ones worked?

Some Bank of America credit cards started allowing you to choose a 3% cash back category starting in 2019. For me, it was a no-brainer to elect to earn for Online Shopping, since I have other cards that have higher cash back percentages for gas, groceries (American Express Blue Cash Preferred), etc. But there's been some questions around which online stores actually qualify. I was most disappointed to see that a large eBay purchase did not qualify, as I could have used my Citi Double Cash card to effectively earn 2% on that purchase instead! I will be periodically updating this list. Broadly speaking, it looks like online apparel and travel booking are working so far. This will be a good reference list - if anyone has any others to add, please comment! Received 3% bonus from online purchases: Expedia.com Fandango.com Gap.com Loft.com Alaska Airlines (alaskaair.com) Hawaiian Airlines (hawaiianairlines.com) Southwest Airlines (southwest.com) Newegg.com (ver...

How to log into web UI for LaView or Hikvision doorbell cam

Image
When I first installed my LaView doorbell cam, setup was fairly straightforward with the LaView Connect app. But I also wanted to be able to view the doorbell stream from my PC. I could never log into the admin app despite following the limited instructions with the cam as well as this ipcamtalk thread . In the year 2018-2019, I thought that I would at least be able to authenticate using Chrome or FireFox like I can with my other IP cams, but the key for the doorbell cam is to use Microsoft IE. There may also be an IE plug-in you can use in Chrome (see above ipcamtalk thread). I was successful logging in with IE11. Here are the steps, with screenshots: Obtain the verification code from the doorbell cam (behind the security cover). For example, assume the code for mine is FQWERT - most of the documentation online uses ABCDEF: Next, in Internet Explorer, access the login screen. You'll need to find the doorbell cam's IP address in your wi-fi router's device lis...

Docker command line cheatsheet

From the host machine, you can list all docker containers: $ docker container ls CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a23456 mydocker/hello-world:latest "sh -c /run.sh" 1 day ago Up 1 day 32867 ecs-hello-world a12345 amazon/amazon-ecs-agent:latest "/agent" 3 months ago Up 3 months ecs-agent Then, to access a running Docker container's shell: $ docker exec -it a23456 /bin/sh We can get a list of processes running inside the container by using the "ps" command. But Busybox (common, very minimal Linux OS) inside Docker container shell doesn't show the full command (display is truncated), and ps auxwww doesn't work. The solution is to set th...

How to serve a file from the docroot using Akamai Property Manager

Image
In some cases you might not have access to your web server (origin) docroot. This could be due to a variety of reasons, such as a Web Content Management (WCM) or Content Management System (CMS) that doesn't allow files to be served from the root path, or you may simply not have access due to content being controlled by another group. But if you control the Akamai config, you can effectively serve any file from the docroot! If you use Akamai's Property Manager, you can create a rule as outlined below. We had a case where we needed to place a Google site verification file for proving ownership in the Google Search Console (previously called Google Webmaster Tools). You can do this with other special files, like robots.txt. Here's how we created that rule: Criteria: If Path matches one of [ your desired web context path, for example: /google12345.html ] Behavior: Construct Response Response Body: [content of the file] ...