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”
Category Archives: Linux
Docker Introduction
Docker is one of the most promising technologies these days. It is a container technology based on Linux. A very lightweight form of virtualization. Docker containers can be as small as 50 MB. Much smaller than traditional VMs. The Docker project was started in March 2013 by dotCloud. In the mean while the makers ofContinue reading “Docker Introduction”
daemon script
This shell script runs forever and checks if the rails worker is running and if not it starts it again:
Linux Tage 2013 in Berlin
Linux Tage 2013 in Berlin is the biggest Linux Conference in Germany. It goes from Wednesday to Saturday. There are all day long sessions & tech talks. And of course a big exhibition hall, where you can meet some of the vendors. It is a place there .com meets .org. I have been there today andContinue reading “Linux Tage 2013 in Berlin”
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”
Bad Gateway with NGinx & Unicorn
I am using NGinx as proxy to load balance the traffic. Behind Nginx their are some unicorn servers. On Friday I did some changes on the server and I realized that I am always running into a Bad Gateway error. The way from Nginx to unicorn worked. But the way back not really. I googledContinue reading “Bad Gateway with NGinx & 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!
Usefull Postgres command
Note for me. Usefull PostgreSQL commands. switch to the postgres user on the linux machine su postgres create a postgres database createdb myFirstDb enter the database with psql psql myFirstDb show all databases \l show all tables in “myFirstDb” \d Delete your first DB. drop database myFirstDb; exit psql \q
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 MongoDB on YDL
MongoDB is a pretty good Document Database. It is NOT a Object Database. Anyway. If you want learn more about MongoDB check out this site: http://www.mongodb.org As far as I know MongoDB is not available over the yum package manager from Yellow Dog Linux (YDL). But it is pretty easy to install. Just download theContinue reading “Installing MongoDB on YDL”
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”
.gitignore
If you want that git is ignoring some files for you you just have to create the “.gitignore” file in your project root. Here you can add all the files you don’t want have in your git repository. For example some meta files from IntelliJ IDEA. *.iml *.ipr *.iws .idea/
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”