Posts

Showing posts from 2018

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]

Why $1 shared hosting might not be a great idea for your web site

Image
In the world of web hosting, there's mainstream providers like Wix , GoDaddy , and SquareSpace , and then there's bottom dollar shared web hosting, which ranges from free to a few bucks a year. I was intrigued by a few Black Friday/Cyber Monday 2017 deals that offered cPanel shared hosting for $1 a year. That's only $0.08 a month! How can it be possible? I'm here to tell you that it's not, at least not without significant performance and downtime issues. Also, note that these deals may no longer be available. I gave them a try and also ended up on their marketing e-mail lists for their other products (this is their upsell game). You could wait until the next Black Friday event, or sign up earlier if you need a plan sooner. Let's look at some uptime graphs I captured using StatusCake , which I highly recommend (I'm not affiliated with them, just a satisfied user). Here are the providers I compared, along with their price points. I'm not inc

Upgrading Ubuntu 14.04 / Debian 8 "jessie" with CMake 3.x, gcc-5, and g++-5

Ubuntu 14.04 and Debian 8 "jessie" are still relatively popular, especially considering the Ubuntu 14.04.5 LTS release that isn't considered end-of-life until April 2019. Many low-end VPS providers still have Ubuntu 14.04 as a common OS image. Of course I much prefer Ubuntu 16.04, but when that isn't an option, you have to make do. These two resources helped greatly, and I will quote them in case they disappear or I can't find them in the future: Install gcc-5 and g++-5 (from gcc 5 on ubuntu 14.04 ): sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt-get update sudo apt-get install gcc-5 g++-5 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 Install CMake 3.x (from How to install cmake 3.2 on Ubuntu ): sudo apt-get install software-properties-common sudo add-apt-repository ppa:george-edison55/cmake-3.x sudo apt-get update sudo apt-get install cmake

xmr-stak won't compile on 32-bit Linux

For anyone wondering if xmr-stak will compile on 32-bit Linux for Monero/Aeon CPU mining, the short answer is no. I spent considerable time trying to force it to work on an old Ubuntu 14.04 laptop as well as on a VPS. Two earlier hurdles were getting CMake 3+ and gcc-5/g++5 installed. Those can be added via Debian/Ubuntu ppa's (for those of you on 64-bit, check out Upgrading Ubuntu 14.04 / Debian 8 "jessie" with CMake 3.x, gcc-5, and g++-5 ), but then when you go to actually build xmr-stak, there's a funny Easter egg in the make output: In file included from /home/user/xmr-stak/xmrstak/backend/cpu/minethd.cpp:24:0: /home/user/xmr-stak/xmrstak/backend/cpu/crypto/cryptonight_aesni.h:36:2: error: #error You are trying to do a 32-bit build. This will all end in tears. I know it. #error You are trying to do a 32-bit build. This will all end in tears. I know it. There's somewhat of an alternative for those of you who still want to do some low-power CPU mining

How to receive e-mail notifications when someone logs into your Synology DSM Diskstation NAS

Image
I wanted to keep tabs on who logs into my Synology DSM NAS (version 5.2+). There's a Synology forum thread that outlines this, but with screenshots, it's much clearer. First, you'll need to set up e-mail notifications if it isn't set up yet. I use a Gmail account. Definitely send a test e-mail to check that you have that part working. Then, you'll need to go to DSM's Log Center. It's unusual that it isn't just in the DSM Control Panel itself! Use the top left icon that looks like four squares: Finally, you'll want to trigger the alert when the logs contain the keyword "logged". You can also configure the other criteria. I had to tweak the "No. of logs per second exceeds" because it would fire whenever I copied a large number of photos to the NAS from my local PC. Apply the changes, then log out of Synology DSM and log in again. You should have an e-mail notification!