Sunday, April 4, 2010

Custom APN for iphone 3G OS > 3.0 (for me Airtel India)

First enable Custom APN: http://www.troublefixers.com/how-to-enable-gprsedgeapn-settings-in-jailbroken-iphone-3gs/

Now go to: Settings->General->Network->Cellular Data Network->
Change APN of Cellular Data to your APN (Airtel: airtelgprs.com).

Restart

Friday, March 19, 2010

Lovd by Less on Ruby on Rails on Ubuntu

1. install ubuntu 8.04 -> LAMP+SSH

2. sudo aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev

3. RubyGems. Normal way: sudo apt-get install rubygems.
BUT WE CANNOT DO THIS AS 1.3.6 gives error, so we will install 1.3.5 manuall.
Download 1.3.5 from http://rubyforge.org.
Unzip and run:
a) sudo apt-get install ruby-full
b) sudo ruby setup.rb
c) sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
NO UPDATE!!!!!!!!!!!!!!!!!

4. sudo gem install rails

5. Test: go to home-> rails (mkdir!): rails test -d mysql
Something happens and no error? :D

6. sudo apt-get install libmysql-ruby libmysqlclient-dev (this might ask you to install libmysqlclient15-dev)

7. sudo gem install mysql

8. sudo gem install passenger

9. sudo apt-get install apache2-dev (suggestion: apache2-threaded-dev) libapr1-dev libaprutil1-dev

10. sudo passenger-install-apache2-module
do as the script says: update /etc/apache2/apache2.conf and VirtualHost stuff

11. sudo a2enmod rewrite

12. sudo /etc/init.d/apache2 restart

AT THIS POINT YOU HAVE RUNNING RUBY ON RAILS!

Now to Lovd by Less

13. Follow Quick Setup from README of LovdByLess
I had to comment out in config/environment.rb, RAILS_GEM_VERSION to use the latest version installed.

14. Missing gems:
gem install hpricot
rflickr
rmagick (requires: sudo apt-get install imagemagick libmagick9-dev)

15. After Quick -> start with step 6 i n README (or whatever it says!)

16. flickr - problem with hpricot version. The README says 0.6.. and I got 0.8.2.
SO - update version in config/environment.rb

17. rake ts:start might give error first time. Ignore and carry on.

18. ./script/server is not executable. Make it executable!

MAYBE begin
19. I got database config error. I had to enter in config/database.yml, values for production.

20. Then I got "uninitialized constant ApplicationController" -> go to app/controllers and do: mv application.rb application_controller.rb
MAYBE end

21. Finish the README steps

22. It only works on ipaddress:3000 (development mode?). But I want it to run in apache!

Sunday, November 29, 2009

Change default webapp in tomcat

- leave your war file in CATALINA_BASE/webapps, under its original name
- turn off autoDeploy and deployOnStartup in your Host element in the server.xml file.
- explicitly define all application Contexts in server.xml, specifying both path and docBase. You must do this, because you have disabled all the Tomcat auto-deploy mechanisms, and Tomcat will not deploy your applications anymore unless it finds their Context in the server.xml.

Note that this last method also implies that in order to make any change to any application, you will have to stop and restart Tomcat.

server.xml: Context path="" docBase="ihzh"

Friday, November 6, 2009

URL redirect

http://yost.com/computers/apache-redirect/index.html

Host multiple websites

http://wiki.gandi.net/en/hosting/using-linux/tutorials/ubuntu/virtualhosts

Friday, October 2, 2009

Automatically set "svn:needs-lock" property

http://www.svnforum.org/2017/viewtopic.php?t=8506

Saturday, September 19, 2009

Moving VirtualBox to a new machine

1) Copy the hard disk to the new machine.
2) Register it in VB (File->Virtual Medial Manager)
3) Create a new machine with the same name AND select the above HD for it and check settings (I had to change System-Processor->Enable PAE/NX + Network to Bridged).
4) If eth0 is gone!
Edit the file /etc/udev/rules.d/70-persistent-net.rules
Delete the line with eth0 and change eth1 to eth0.
Restart :)