sleep-calculator.com – Calculates the Best Time to Go to Sleep So You Wake Up Refreshed

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

Nginx Error – 413 Request Entity Too Large Fix

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/;
}
}
}

WordPress theme upload error “PCLZIP_ERR_BAD_FORMAT (-10)”

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.

Git – How to delete a local branch or remote

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 '[email protected]_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.

Install Sublime Text 3 on Ubuntu Linux

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.