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.

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.

Install MRI 2.1.0 on Ubuntu 13.04

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)

Install an experimental fork of Homebrew for Linux

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.