Ubuntu enforce memory freedom

Sometimes it occurs that a device runs full with memory. Simply deleting the files on the device doesn’t help. Ubuntu stills shows that the device is 100% full, even if there are no files on it anymore. This command usually helps to give free the memory. sudo tune2fs -m 0 /dev/sda5 If it doesn’t helpContinue reading “Ubuntu enforce memory freedom”

Capistrano + Rails + Unicorn + NGinx + RVM

Capistrano is a ruby based deployment tool which executes commands in parallel on multiple remote machines, via the SSH protocol. With Capistrano you can deploy your application on N server with one single command from your dev machine. You don’t need to login via SSH to your server. If you don’t deploy your app onContinue reading “Capistrano + Rails + Unicorn + NGinx + RVM”

Rewriting URLs with Nginx

Rewriting URLs with Apache HTTPD can be pretty ugly. With Nginx it is a breeze. Take a look to this example: server { listen 80; server_name my_old_domain.com; rewrite ^/(.*) https://www.my_new_domain.com/$1 permanent; } This will not just redirect your old URL to your new URL. It passes all the parameter to your new URL, too. IfContinue reading “Rewriting URLs with Nginx”

Load balancing with Nginx And Unicorn

Nginx is a pretty awesome lightweight Web Server for Linux. You can use it to deliver static web content. But you can use at as a load balancer, too. If you have a Ruby on Rails Application running on multiple unicorn servers, than Nginx can do the load balancing for the unicorn servers. Just addContinue reading “Load balancing with Nginx And Unicorn”

Running Unicorn as a Service on Debian Linux

Unicorn is a very fast app server for Ruby on Rails. You just have to go to the APP_ROOT and type in “unicorn_rails”. And your app is running. The problem with that is, if your server reboots your app is down. And you have to start it again by hand. That is not so cool!Continue reading “Running Unicorn as a Service on Debian Linux”

Installing Ruby 1.9.X on Debian Linux

It is pretty easy to install Ruby on Debian. Just execute this as root: apt-get install ruby1.9.1 That’s it! Depending on that GEMs you want to install you should install this here, too. apt-get install make bcrypt libxml-ruby1.9.1 libxml2-dev libxslt-dev libpq-dev g++ Your GEMs are at “/var/lib/gem/1.9.1/”. You should add this here your path: /var/lib/gem/1.9.1/bin That’s it.

Access PostgreSQL from outside

After you installed PostgreSQL on a debian server, by default it is not accessible from outside. From other servers! It is just accessible from localhost. To change that you need to make it listen to a special ip address and port. On Debian 6 you have to switch to this directory: /etc/postgresql/8.4/main Here are theContinue reading “Access PostgreSQL from outside”

Setting password for PostgreSQL

After a standard installation of PostgreSQL on Debian linux, there is no password set for the default user postgres. You can set the password by login in as postgres user. If you are root, just type in that: su postgres Than you can start the postgres client: psql And now execute this command here toContinue reading “Setting password for PostgreSQL”

screen

How can somebody be so stupid to choose “screen” as product name? I mean the word “screen” has already a meaning! A very strong meaning! That means it is very difficult to google for the product “screen”. So you have to add more keywords into your search. It is a nightmare!

custom_require>:29:in `require’: no such file to load — mkmf (LoadError)

Today I installed Ruby 1.9.X on a Debian Linux Server. Worked pretty smoothy with “apt-get install ruby1.9.X”. After “gem1.9.1 install rails” I got this Exception: custom_require>:29:in `require’: no such file to load — mkmf (LoadError) If you get this error you have to install two more things: apt-get install ruby1.9.1-dev apt-get install make After thisContinue reading “custom_require>:29:in `require’: no such file to load — mkmf (LoadError)”

Install bash-completion

If you are working with Debian Linux you have to the package manager “apt-get” to install packages. What is pretty cool. 1 mil. times better the the shitty RPM System from Red Had. If you want to have autocompletion for apt-get install the package “bash-completion”. apt-get install bash-completion and than add this lines to yourContinue reading “Install bash-completion”

Installing Nginx 1.0.2 on Yellow Dog Linux

I just got an Yellow Dog Linux (YDL) up and running on Amazon EC2. YDL is based on Red Hat. The installation tool is called “yum”. It is similar to debians “apt-get” tool, but it is based on RPMs. Anyway. You can install nginx via yum with this command: sudo yum install nginx But thisContinue reading “Installing Nginx 1.0.2 on Yellow Dog Linux”

psql client for PostgreSQL

psql is a command line client for the PostgreSQL Database Engine. If you install postgreSQL on Debian psql is installed by default. After you switched to the postgteSQL user: su postgres you can access the client with this simpel command: psql and you can exit with this command: \q You can set a password withContinue reading “psql client for PostgreSQL”