WTF Elastic X-Pack License - How to uninstall X-Pack

If you found this article through a search engine, you probably feel the same resentment toward X-Pack that I do. At first I thought X-Pack was a free, handy plugin, so I installed it on both Elasticsearch and Kibana. Then 30 days later a message appeared saying the license had expired and I needed to “renew the license key,” otherwise I couldn’t log into Kibana. Up to that point I still assumed I just needed to register an account to get a new license key. But after browsing the official site for a long time, I couldn’t find any text about licensing, pricing, or purchasing (later I found out it does exist — in tiny print… do you people even want to make money?). In the end I only found the pricing page through a Google search. ...

January 16, 2017 · 3 min

Setting Up User Authentication for Elasticsearch and Kibana

After you install Elasticsearch and Kibana, you will quickly run into a serious problem: “Wait, where are the username and password?” That’s right, Elasticsearch and Kibana don’t come with the usual user management module. You can only restrict access by binding them to an internal IP or port. But if you’re like my company and don’t have a fixed IP, or you want to set up several accounts, keep reading. This post shares how to set up basic user authentication for Elasticsearch and Kibana using HTTP Auth. ...

January 15, 2017 · 4 min

Siege - A Handy Tool for HTTP Load Testing

As a backend engineer, it’s no surprise that I sometimes want to run a load test on a website. Load testing helps us understand how stable our server architecture is, and to some extent lets us observe how well our code performs. Common tools include ab and JMeter. I don’t think anyone runs load tests by hand (lol). Today I’m going to introduce Siege, a fairly complete yet simple HTTP load testing tool. It runs from the command line and helps you measure how well a website or API handles load. But keep in mind that performance testing involves many layers, and passing a load test doesn’t mean you’re bulletproof! ...

January 6, 2017 · 3 min

How to Make a Dashboard on a TV

The TV hanging in our office has been sitting empty for a long time, and that is not a good use of it. So I recently started planning to show some important numbers on it, such as conversion rate, traffic, and live visitors. I originally thought a dashboard would be a simple request: two or three days of backend work to organize the data, then D3.js on the front end to draw the charts. Or I could make it even simpler and use custom reports in Google Analytics. But once I started researching, I found the problem was not so simple. Let me walk you through it. ...

December 23, 2016 · 8 min

How to Hook SSH Login and Send Notifications (Email or Others)

When you first log in to Google or Facebook, they send you a notification email to improve security. I think many IT people wonder, “How can I do the same thing for SSH?” If every SSH login sends a notification to the system manager, that helps security. ...

July 30, 2016 · 2 min

uWSGI

Introduction uWSGI is a protocol, and it is also a program. Why is it so complicated? Let’s start with the program. uWSGI was originally designed so that web applications written in Python could communicate with web servers such as Nginx and Apache. It uses its own uwsgi communication protocol. It also supports other protocols such as CGI, FastCGI, and sockets, so besides serving Python, it can also integrate with programming languages such as PHP and Go. ...

July 24, 2015 · 8 min

Notes on Handling a Lost Amazon Web Services Multi-Factor Authentication (MFA) Device

This is a record of how to handle a lost AWS MFA device. I enable multi-factor authentication on my AWS accounts, which means that when I log in, I have to enter my password plus a verification code from my phone. But I once accidentally deleted the authenticator app, which locked me out of AWS. Oddly, most online services that offer two-step verification let you receive the code by text message, but AWS only offers codes generated by a phone app! After reading a few articles, I finally got out of this jam. ...

January 15, 2014 · 4 min

Compiling and Installing a PHP Extension Manually (Linux)

If you want to install an extension for PHP, what should you do? Many people will answer Pecl. That is indeed a very convenient way to install extensions. But what if your server does not have Pecl? And what if, for some reason, you cannot install Pecl? Then you have no choice but to compile and install the extension manually~ This post shows you how to manually compile a PHP extension on Linux. ...

January 26, 2012 · 2 min

MongoDB Security Settings: Account Setup and Login IP Restrictions

By default, MongoDB has no protection at all. Anyone can log in remotely without any account, which is really dangerous if you use it for programming. So in this post, I’ll show you how to add account settings to MongoDB, so that logging in requires a username and password, and I’ll also show you how to restrict logins by IP address. ...

January 25, 2012 · 6 min

How to Manually Install Python on Linux Without Breaking yum

I previously wrote a program that automatically backs up important data on Linux and uploads it to Google Storage. It was written in Python 2.7, but the Python built into Linux is 2.4, and even if you upgrade with yum, the newest version it gives you is 2.4. So if you want a newer version of Python, you have to compile it yourself. Below, I’ll use Python 3.2 as the example. ...

August 19, 2011 · 2 min