Useful Mix

Something useful every once in a while…

Global Average BMI value for both men and women

Global Average BMI value for both men and women

BMI Calories  is a small index off free health and fitness calculators mainly designed to be universally applicable for worldwide usage (each one has a metric system and a standard US measuring system).

The above picture is a screenshot of the interactive geo-chart-map, which displays the average BMI values in 177 countries for both men and women and can be found on the bmi calculator page.

Other calculators available on the site:

  • BMR calculator – for figuring out your basal metabolic rate (or resting metabolic rate, as it is sometimes referred to)
  • A Calorie intake calculator – for figuring out how many calories a day the body requires depending on the physical activity level you undergo. The nice thing about it is that it also has a section with a table of physical activities that span over ~300 or so different types of activities and their associated calorie consumption / expenditure values.
  • Body Fat percentage calculator – the name says it all, however what’s nice about it is that, aside from the actual body fat percentage value calculated, it also provides some insights into fat and lean mass,  body adiposity index (also known as BAI), and a value of the body fat extracted using the BMI – for adults and children alike.

Like with the interesting information from the global average BMI, all other calculators come with a plethora of additional information related to the actual calculation, which makes it a great resource for whenever you need to calculate these values, but also have some time to browse around.

 

 

September 2nd, 2014

Posted In: Webapp

Leave a Comment

Sleep Calculator web app

Waking up refreshed and comfortable consists of getting to bed at the right time. Sleep-calculator.com is a webapp that makes decisions based on our sleep cycles and calculates when you should fall asleep / wake up.

Punch in when you need to wake up and you’ll get 4 best times to fall asleep.

Other scenarios are available as well:

  1. Depending on your situation you might want to know when to go to sleep to wake up at a specified time (in this case go for Scenario 1)
  2. You might want to decide the best times to wake up after having gone to sleep at a specified time (in this case go for Scenario 2)
  3. You might want to simply know the best times to wake up if you were to go to sleep this instant (in this case go for Scenario 3)
  4. If plan to take a power nap it will give you the best time at which you should wake up (in this case go for Scenario 4)

Give it a try to see if you can time your sleep for the best rest.

Sleep-Calculator.com

April 13th, 2014

Posted In: Webapp

Tags: ,

Leave a Comment

If you’re getting 413 Request Entity Too Large errors trying to upload files to your webserver, you need to increase the client body size limit in your nginx.conf configuration file.

Add ‘client_max_body_size xxM’ inside the server section, where xx is the size (in MB) that you want to allow for files upload to your webserver.

The client_max_body_size directive assigns the maximum accepted body size of client request, indicated by the line Content-Length in the header of request.

To edit your nginx configuration, in your terminal type the following:

sudo nano /etc/nginx/nginx.conf
or
sudo nano /usr/local/nginx/conf/nginx.conf
and set the
# set client body size to 2M #
client_max_body_size 2M;

as per the example below:

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server {
client_max_body_size 2M;
listen 80;
server_name localhost;

# Main location
location / {
proxy_pass http://127.0.0.1:8000/;
}
}
}

March 17th, 2014

Posted In: Development, Linux, Nginx, Webserver

Tags: , , ,

Leave a Comment

While trying to install a wordpress theme that was packaged as an .rar archive I got the following error:

The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

This is because I’m trying to unpack a .rar archive and the server doesn’t have rar archive support installed, however you can get around this issue quite easily.

All you need to do is unpack the .rar archive and re-pack it as a .zip archive and re-try the upload. Everything will work as expected after that.

March 17th, 2014

Posted In: Linux, Nginx, Webserver, Wordpress

Tags: , ,

Leave a Comment

Git – delete a local branch:

git branch -d some_example_local_branch

Git – delete/remove a remote branch:

git push origin : some_example_remote_branch

In case of error after trying to remove remote branch, run:

git fetch -p

This is what the error message would look like:

error: unable to push to unqualified destination: some_example_remote_branch
The destination refspec neither matches an existing ref on the remote nor
begins with refs/, and we are unable to guess a prefix based on the source ref.
error: failed to push some refs to 'git@repository_name'

and this is caused due to the fact that perhaps anyone else has already deleted the branch and you need to synchronize your branch list.

March 13th, 2014

Posted In: Development

Tags: ,

Leave a Comment

In order to install Sublime Text 3 on Ubuntu, we first need to add a repository to our sources.

Before we add the required repository to our sources, we need to make sure to have the add-apt-repository package available. If you don’t start with step1, otherwise proceed to step2.

Step 1: install the add-apt-repository packages providing the command:

for Ubuntu version <= 12.04

sudo apt-get install python-software-properties

for Ubuntu version >= 12.10

sudo apt-get install software-properties-common

Step2:

sudo add-apt-repository ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install sublime-text-installer

First the repository is added, then a update to find the new packages is made and finally you’re installing sublime text 3.

March 11th, 2014

Posted In: Linux

Tags: , , ,

Leave a Comment

This is how you clear your cache and cookies on all major browsers without navigating through the entire menu and options to find the caching section.

Typically on most Firefox versions the caching & cookies section is under:

Firefox Menu > Options > Options > Privacy Tab > clear your recent history (link) but that’s too many clicks.

In Chrome:

Customize and Control Google Chrome button > Tools > Clear Browsing data.

In Internet Explorer:

Tools > Internet Options > General tab > Browsing history section > Delete

So, here’s the only Windows keyboard shortcut you need: CTRL+SHIFT+DELETE – this brings up the Clear All History window on all browsers.

If you’re running Windows on a mac pc, then the shortcut would be: CTRL+SHIFT+FN+DELETE – same result as above.

The CTRL+SHIFT+DELETE shortcut works on all versions of Firefox, perhaps most Internet Explorers and Google Chrome.

March 11th, 2014

Posted In: Browsing, Firefox, Google Chrome, Internet Explorer, Windows

Tags: , , , ,

Leave a Comment

MRI – Matz’s Ruby Interpreter

1. We need curl on a fresh install if it so happens that it is not present:

sudo apt-get update
sudo apt-get install curl

2. Download and run the RVM installation script

2.1 Installing the stable release version:

user$: curl -sSL https://get.rvm.io | bash -s stable

2.2 To get the latest development state:

user$: curl -sSL https://get.rvm.io | bash

3. Reopen terminal and run:

rvm install ruby-2.1.0

or paste this in the current terminal and then install ruby: source ~/.rvm/scripts/rvm

4. If you’re getting the “RVM is not a function” message you need to enable login shell (optional):

With the the terminal window open go to:

Terminal > Edit > Profile Preferences > Title and Command > Run command as a login shell (make sure this check-box is enabled)

February 10th, 2014

Posted In: Linux

Tags: , ,

Leave a Comment

1. Reference: https://github.com/Homebrew/linuxbrew

2. Installation

2.1 Pre-requisites:

2.1.1 Debian or Ubuntu:

sudo apt-get install build-essential curl git ruby libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev

2.1.2 Fedora:

sudo yum groupinstall 'Development Tools' && sudo yum install curl git ruby bzip2-devel curl-devel expat-devel ncurses-devel

3. Homebrew Install:

git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew

4. Edit .bashrc ( sudo nano ~/.bashrc ) or .zshrc and add the following 2 lines at the end of the file:

export PATH="$HOME/.linuxbrew/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.linuxbrew/lib:$LD_LIBRARY_PATH"

5. and restart the terminal.

6. Usage:

basic package install with brew:

brew install $WHATEVER_YOU_WANT

7. Full example help/usage:

brew [info | home | options ] [FORMULA...]
brew install FORMULA...
brew uninstall FORMULA...
brew search [foo]
brew list [FORMULA...]
brew update
brew upgrade [FORMULA...]
brew pin/unpin [FORMULA...]
Troubleshooting:
brew doctor
brew install -vd FORMULA
brew [--env | --config]
Brewing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
open https://github.com/Homebrew/homebrew/wiki/Formula-Cookbook
Further help:
man brew
brew home

8. Available packages to be used with brew:

- you can browse the formula directory on GitHub
– or type brew search for a list (in the terminal window)
– or visit braumeister.org to browse packages online.

February 10th, 2014

Posted In: Linux

Tags: , ,

Leave a Comment

zip -9 -y -r -q file.zip folder/

-9 Indicates the slowest compression speed (optimal compression, ignores the suffix list)
-y Store symbolic links as such in the zip archive, instead of compressing and storing the file referred to by the link
-r Travel the directory structure recursively
-q Quiet mode
folder Refers to the folder to be zipped

zip package needs to firstly be installed:

sudo apt-get install zip

February 10th, 2014

Posted In: Linux

Tags: ,

Leave a Comment

Next Page »