Vitalie Lazu old blog

Another blog about ruby, rails, debian and system administration. Other useful staff for developers and system administrators.

Tuesday, June 07, 2011

This is an old blog

Hello,

I will not write anything here anymore, I have another blog where I write in Romanian.

http://vitalie.webng.md

Monday, July 13, 2009

Install google chrome on debian testing/sqeeeze

* Download development version of Chrome
* Install ia32-libs-gtk and lib32nss-mdns packages from testing(squeeze)
sudo aptitude -t testing install ia32-libs-gtk lib32nss-mdns

* Install chrome with
dpkg -i google-chrome-unstable_current_amd64.deb


Happy browsing!

Monday, December 01, 2008

Rake tasks to help you with family photos

Yesterday while I tried once again to download photos from my camera with digikam, it gave me a SIGABRT crash, I'm using kde 4.1.3, so I tried to build new deb package for digikam 0.10.beta6 and I did not succeed, many kde dependencies and I could not want to break my installation.

So as quick solution I wrote a small Rakefile to help me download photos from my camera and arrange them in folders by photo date (Like I used digikam). I want to share this rake tasks, maybe it will save time to other people. Currently it only support jpeg files. Bonus: it can rotate photos based on exif information related photo information.


rake ph:get # Get photos from camera to current folder
rake ph:delete # Delete all photos from camera
rake ph:arrange # Arrange photos in folders by date
rake ph:rotate # Rotate photos from exif info
rake ph:list # Show photos info


Here is a source code: http://gist.github.com/30716

Labels: , , , ,

Friday, November 28, 2008

New release for Assembla.com

Today I released a new version of Assembla.

Mostly I spent time on preparing git branch for release and review code and rails migrations.

This release contains most bug fixing, but and a few improvements:
* New look and feel for space stream tab


* Ajax for posting messages on Message tab


* Export time records for a space



More feature will come shortly, check our roadmap

Please help us improving the site by posting your feature requests at http://feedback.assembla.com

Labels: , ,

Wednesday, November 12, 2008

How to setup a runit service for grails

Today I had a task to setup continuous integration for grails on EC2 server. I asked Google for a solution and it returns no results, so I want to share my experience., maybe it will be helpful for other system administrators.

Below is a little script that do all automatically, you will need just to start the service with:
sv start grails


You can also add a hourly cron job to update grails application from git or subversion.


setup_grails_runit.sh

#!/bin/sh
#

apt-get install runit

sv_dir=/etc/sv/grails
mkdir -p $sv_dir/log

cat - > $sv_dir/run <<EOF
#!/bin/sh

export JAVA_HOME='/opt/jdk1.6.0_10'
export PATH=${JAVA_HOME}/bin:$PATH

export JIBX_HOME='/opt/jibx'
export PATH=${JIBX_HOME}/bin:$PATH

cd /opt/apps/my_project
exec grails -Dserver.port=80 run-app
EOF

cat - > $sv_dir/log/run <<EOF
#!/bin/sh

set -e
# use /mnt, because on EC2 a bigger disk is mounted to /mnt
LOG=/mnt/log/grails

test -d "$LOG" || mkdir -p -m2750 "$LOG" && chown nobody:adm "$LOG"
exec chpst -unobody svlogd -tt "$LOG"
EOF

chmod 755 $sv_dir/run $sv_dir/log/run

# add service
update-service --add $sv_dir

Labels: , ,

Monday, November 05, 2007

Apache process hangs in memory with mode operation L.

I have a heavy loaded website with 12req/second and I use apache 2.2.6 with mpm_event_module, because threaded and prefork modules suck already. Apache server with 5 mongrels in cluster: 3 on the same server and 2 remote. MYSQL is also remote. Memcached runs on the same server. NFSD also running. Below is apache tuning for mpm_event module:

StartServers 1
MaxClients 150

MinSpareThreads 15
MaxSpareThreads 25
ThreadsPerChild 25
MaxRequestsPerChild 0
It works great, with some exceptions: some apache processes hangs in memory with mode operation L (logging request to disk)
Mod status says that pid 31159 hangs for 1278 seconds (20 minutes) and it wastes system resources, making website to load slower. I had to kill hanging processes manually for some time, but in last weekend I wrote a simple ruby script that use hpricot gem to parse mod status and detect hanging processes wit h status L, then it kill them. I put it in a cron job to run every 10 minutes and i forget about the problems.

Labels: , , ,

Wednesday, October 31, 2007

Assembla Free svn hosting: how to setup your project

Assembla offers FREE Trac and svn hosting for a long time, here is a quick way how to setup your project with tools provided by assembla.com services:
  1. Login or create an account.
  2. Go to "Spaces" tab and click "Create a new space"
  3. Fill you space name and URL name for friendly url
  4. Check "Software developers" option.
  5. Optional: adjust security, wiki settings, appearance and invite new team members.
  6. Click next to create your space.
You have your trac and svn tools ready to use, on Trac tab of the new space you will find the information how to access new created tools: trac and svn.


If you have troubles with these steps, please take a look at this video.

Why Assembla is better:
  • You have no limit on team members like other service providers enforce.
  • You get 200Mb for free for your open source or private projects. 2Gb is just for 50$/month.
  • Students and open source projects can get more free space.
  • You have a lot of tools to play with: Scrum, Mephisto Blog, Staffing, Mercurial, Image Annotations, Chat. Take a look at assembla.com features for more info.

Assembla Free svn hosting: how to setup your project.

Assembla offers FREE Trac and svn hosting for a long time, here is a quick way how to setup your project with tools provided by assembla.com services:
  1. Login or create an account.
  2. Go to "Spaces" tab and click "Create a new space"
  3. Fill you space name and URL name for friendly url
  4. Check "Software developers" option.
  5. Optional: adjust security, wiki settings, appearance and invite new team members.
  6. Click next to create your space.
You have your trac and svn tools ready to use, on Trac tab of the new space you will find the information how to access new created tools: trac and svn.


If you have troubles with these steps, please take a look at this video.

Why Assembla is better:
  • You have no limit on team members like other service providers enforce.
  • You get 500Mb for free for your open source or private projects. 2Gb is just for 19$/month.
  • Students and open source projects can get more free space.
  • You have a lot of tools to play with: Scrum, Mephisto Blog, Staffing, Mercurial, Image Annotations, Chat. Take a look at assembla.com tour for more info.

Labels: , , ,

Wednesday, October 24, 2007

Free mercurial hosting for open/private projects

Today Assembla launched new tool: Trac&Mercurial. Every developer can create a mercurial repository for development with few clicks.

1. Login/register to Assembla.
2. Open mercurial catalog page and click "Select this" button to create a space from template with trac/mercurial and other tools.
3. You can browse your trac at http://trac-hg.assembla.com/url_name and clone/push your mercurial repository at http://hg.assembla.com/url_name

Update: below video is old, but can be used.
You can watch this video about my experience setting mercurial at assembla.

About mercurial:
Mercurial is a new open source version control system based on the distributed model. In Mercurial, as in Subversion or CVS, developers work on a local working directory. However, unlike centralized solutions, Mercurial also stores a copy of the entire project history on each developer's machine. In this way, developers can work in parallel, even without a network connection.

Labels: ,

Thursday, August 30, 2007

Force FreeBSD ports to use python24

I use python 2.4 with trac, mod_python, but when i updated ports collection, it started to install new software with python2.5 as dependency.

By reading /usr/ports/Mk/bsd.python.mk , I found that I need to set PYTHON_DEFAULT_VERSION=python2.4 in /etc/make.conf and new software will be installed with python 2.4

After that new ports will use your existing python2.4.

Labels: , ,