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 :)

Wednesday, September 9, 2009

Setting apache in front of tomcat

1) install apache, tomcat, php5 (not required for this, but is good), mod_jk (sudo apt-get install libapache2-mod-jk)

2) create workers.properties file with
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

3) add in httpd.conf
JkWorkersFile /etc/apache2/workers.properties

JkMount /ihzh/* worker1
OR
in the sites-available/webapp (if in tomcat)
JkMount /* worker1

Now if apache can be accessed on: http://host/
ihzh (running on tomcat) can be accessed on: http://host/ihzh/ (last "/" is important!).

Monday, April 27, 2009

using mutt with gmail - google apps account

It was easy to set up gmail app account on mutt to fetch email, but sending was a pain.

The problem was user id containing "@" symbol. For example exampleuser@exampledomain.com and gmail requiring smtp authentication for sending emails. Mutt config file gives no option to set user for smtp seperately. So it has to be passed in "smtp_url" variable.

set smtp_url = "smtp://exampleuser@exampledomain.com@smtp.gmail.com:587"

But this gives error cause mutt tries to find domain exampledomain.com instead of smtp.gmail.com.

The solution was to use the variable "imap_user".
set smtp_url = "smtp://$imap_user@smtp.gmail.com:587"

Hope that helps.

Thursday, November 13, 2008

PdaNet version 1.4 - DO NOT UPDATE

DO NOT update from version 1.33 to 1.4. It told me that my trial was over and I could only use http connections (no https). Alright. But there is no friggin way to register it!!!!!

So I uninstalled it and installed again. And - "SIZE MISMATCH". Now I don't have any pdanet on my phone!

What crap.

I mean, it's the best s/w on iPhone - but the process of update s*cks.

No solution yet.

Thursday, September 25, 2008

Gmail - google mail - push on iPhone alternative - forwarding only inbox emails - free solution

Gmail push does not work on iPhone.

So I thought of having a notifier for it - well kind of.

This requires two problems to be solved. Forwarding only inbox emails (so skip the ones that are filtered and sent into other folders (labelled)). And getting a push email account :).

What we need for it.
1. A yahoo account (free push email).
2. Set up a filter in your gmail (to forward ONLY inbox emails).
3. Set up gmail and yahoo on your iPhone.

1.
Create (if you already don't have one) a yahoo account. Say account1@yahoo.com.

2.
Open gmail (account2@gmail.com).
Create new filter (Settings-Filters-Create new) - with the condition - Has the words = "in:inbox". No quotes.
You will get a warning, ignore it.
In the next step, forward the email to account1@yahoo.com.

3. Set up both accoungs on iPhone using the given gmail and yahoo wizards.

That's all!

Test sending mails to account2@gmail.com and you should get instant notification in your yahoo mail. All you need to do now is open gmail account on the iphone to retrieve it.

Advantage:
You can switch off fetching of email and set it to manual. Saves battery and hassle of checking email for nothing.

Disadvantage:
The mail icon on the phone will show you new mails even if you have read all mails on gmail - simply because these mails still exist on your yahoo mail. What I do is, I delete all yahoo mails after every couple of hours. For me it's not a big hassle. Atleast I get instant gmail notifications.

Cheers