Ir al contenido principal


Simple server load test with cron and ab (Linux)

Load testing "refers to the practice of modeling the expected usage of a software program by simulating multiple users accessing the program concurrently. As such, this testing is most relevant for multi-user systems; often one built using a client/server model, such as web servers." I've found many articles online explaining how ApacheBench lets you "load test" with a single command from a Linux terminal, but is this a realistic load test? A single execution of ab is a very limited simulation of what actually happens when multiple users try to access your web application. A server may perform well if it has to work hard for a 30 seconds (possible execution time of an  ab command), but what happens when 20000 extra requests hit your web app after it's already been stressed for hours? Apache HTTP server benchmarking tool (ApacheBench) is a simple yet great tool which was "designed to give you an impression of how your current Apache installati
Entradas recientes

Dockerize your Django App (for local development on macOS)

I'm writing this guide on how to containerize an existing (simple) Python Django App into Docker for local development since this is how I learned to to develop with Docker, seeing that the existing django images and guides seem to focus on new projects. For more complete (production-level) stack guides you can refer to Real Python's Django Development with Docker Compose and Machine or transposedmessenger's Deploying Cookiecutter-Django with Docker-Compose . Pre-requisites An existing Django app which you can run locally (directly or in Virtualenv ). We will run the local dev server with runserver . A requirements.txt file with the app dependencies, as is standard for Python projects; including  MySQL-python . Working local MySQL server and existing database. (This guide could easily be adapted for other SQL engines such as Postgres.) Install Docker.  You can see Docker as a virtual machine running Linux on top of your OS ("the host"),

How to root, unblock bootloader & install TWRP custom recovery on Verizon LG G2 VS98027A

Apparently Verizon made it particularly tricky with their VS980 27A version (on bloated/stock 4.4.2 KitKat) to free your smart phone... But with these tips you'll be on your way to flash custom ROMs in no time! Tools that don't seem to work as of today: iroot (to root) FreeGee (to unlock bootloader) ClockworkMod Recovery (CWM) in general TWRP Manager (to install TWRP) How I did it ...and over the air! No ADB/ USB Drivers or PC connection required B) * Download and install Stump Root from directly on your device. (You may need to allow installing unsigned packages in your security settings.) The specific version that worked for me is Stump-v1.2.0.apk . * Apparently the bootloader can't be unblocked! However, there's an exploit called loki which is included in some TWRP builds and gives you the same abilities as an unlocked bootloader (: * To install Tim Win Recovery Project (TWRP), download and

How to Book Airbnb in Cuba

Currently (January 2016), you can only book a casa particular through Airbnb from the USA ( not even from Cuba itself). Payment has to be made with a US-based method as well. The process however, is not as simple as with any other places they offer listings in. In fact you're not really supposed to book there unless you're a " licensed US traveler ", but you still can ;) Here are some important tips after having to figure all this myself -- which would've been hard without writing/speaking Spanish, I recon. The truth is either in Spanish or English, the info. about this topic is extremely lacking out there... UNTIL NOW Or are they? In Cuba you can't just put your house up for Airbnb! Only government permitted bed-n-breakfast ( arrendador divisa , see right figure) didn't help create a new market it Cuba like in other parts of the world, it just helps people in the US (for now) find these places without having to pay an expensive guide on-th

I don't git it.

A lot of people praise git. I liked it at first, now I don't geet it . Some weird stuff I've found in git, in no particular order: You can pretend to be anyone. Just change your [user] name and email in .git/config and commit away. As long as when you push you use valid credentials, the commits will be recorded as from someone else. (At least this is possible on GitHub, I know git doesn't implement any specific user access control.) * I guess you could try to enforce signing commits but as anything besides the basics, that gets pretty complicated on git. Steep learning curve that keeps getting steeper . Ok: git init, git add, git rm -r, git commit -am, git remote add, git fetch, git merge -ff, git push and pull -u of course, git checkout -b, git reset --mixed, git revert HEAD ... Those are just some of the basics ... Ever tried to incorporate git subtree pull -P prefix --squash > into your workflow? I have, it's not fun (keep reading). Its super complicated

ISO 3166-2 region list for PHP

Thanks to Jerome Mouneyrac for  pointing out  that the  iso-codes package in Debian  is a good source for this data, as well as the script to turn it from XML to PHP. This particular list comes from the 3.52 release of the package, which can be found  online here . To make your own list out of a newer release get the XML file by clicking on iso-codes-[tag] on that page, then tree > iso_3166_2/iso_3166_2.xml ; and then use this script (fixed/improved from Jerome's). <php /* Copyright Notice This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You shou