Posted by Dhaval Parikh on Oct 3, 2011
Hi all
Was updating one server with rails 2.2.2 to rails 2.3.8. I upgraded ruby from 1.8.6 to 1.8.7 and also rubygems to 1.3.4 version from a source. When i did ruby script/server to start the server I got this error no such file to load — openssl
After a 15 mins R&D i found that this usually happens on an Ubuntu machine (which it was in my case). The solution is as follows
First install libssl using
sudo apt-get install libssl-dev
Than go to the source of ruby and go to the following path
cd ext/openssl
Run the command one after the others.
ruby extconf.rb
make
sudo make install
Now try to do ruby script/server again……and boooooooom! solved.. Even after trying this you are stuck let me know I shall help you out.
Thanks
Tags: open ssl error, openssl + ruby, openssl + ubuntu, openssl error
Posted by Dhaval Parikh on Sep 12, 2011
Hi all
sometimes VNC is really useful when you want to access the remote server. Though every thing can be done via command prompt but sometimes a GUI is useful (Atleast I find it useful).
Now if you want to do that here are the steps you need to follow. As you know that most or all servers dont come with Gnome installed. So thats the first step you need to do
Start with the following command
sudo apt-get update
Than install the Gnome-Core components using
sudo apt-get install gnome-core
Now install a virtual desktop using
sudo apt-get install vnc4server
Now setup a password to login using the following command. It will prompt to setup a password and verify it
vncpasswd
Than run the vnc server using
vncserver :1
Now before you proceed kill it once using
vncserver -kill :1
Now open the config file from .vnc/xstartup or ~/.vnc/xstartup
using nano .vnc/xstartup (I perfer nano you may use vim or vi)
Than uncomment the line which says
unset SESSION_MANAGER
And add sh to the line below it like this
exec sh /etc/X11/xinit/xinitrc
Exit the file and run the command as below
vncserver :1 -depth 16 -geometry 1028×1024
Than download tightVNC from http://www.tightvnc.com/download.html
connect using ip:1 (:1 is for the vnc server window)
You might see a dialog box with error and a delete option. Click delete and done
You now have GUI access to your server.
You may want to install synaptic using
apt-get install synaptic
Thats all.. Hope this article helps. If you get stuck do write to me.
Tags: vnc + ubuntu, vnc on ubuntu, vnc server on ubuntu, vnc server ubuntu
Posted by Dhaval Parikh on Sep 8, 2011
Every came across a task where in you get a task to insert 1 million + records in few hours? than the answer is NOSQL
Use Tokyo Cabinet. Here are the installation steps for the same.
First of all download the latest version of tokyocabinet via the following url
wget http://fallabs.com/tokyocabinet/tokyocabinet-1.4.47.tar.gz
tar xvf tokyocabinet-1.4.47.tar.gz
cd tokyocabinet-1.4.47
./configure
make
make install
Next step is to install the ruby library which you can download from the url below
wget http://fallabs.com/tokyocabinet/rubypkg/tokyocabinet-ruby-1.31.tar.gz
tar xvf tokyocabinet-ruby-1.31.tar.gz
cd tokyocabinet-ruby-1.31
ruby extconf.rb
make
make install
Now to verify you installation go to irb
irb(main):001:0> require ‘rubygems’
=> true
irb(main):002:0> require ‘tokyocabinet’
=> true
Done. If you get any errors while doing this please free to comment. Thanks
Tags: tokyo cabinet, tokyo cabinet + rails, tokyo cabinet + ruby, tokyo cabinet + ubuntu
Posted by Dhaval Parikh on Aug 8, 2011
I was trying to install omniauth and was getting error for nokogiri libxslt is missing. If you are facing the same issue you may solve it using the following command. I have tested it with ubuntu and it worked for me. Its not tested on Fedora but should work.
on Ubuntu 10
sudo apt-get install libxml2 libxml2-dev libxslt libxslt-dev
on Ubuntu 11
sudo apt-get install libxml2 libxml2-dev libxslt1-dev
On fedora
sudo yum install libxml2-devel libxslt-devel
If you still face issues do write to me.
Thanks
Tags: libxslt error, libxslt nokogiri, libxslt2 errpr
Posted by Dhaval Parikh on Jul 1, 2011
Today one of my team mate accidently gave chmod -R 777 on all folders. So he was not able to do sudo su and login as a root user.
Now as a normal user it wont allow you to change the rights. This is a big headache. Ultimately I found the solution to this issue. Restart ur pc and press shift key which will give u an option to start your system in recovery mode.
Select that and you will get an option to login as root with command prompt. Now change the rights of /etc/sudoers to 0440 by using the command chmod 0440 /etc/sudoers. Exit and restart your system.
Now start your terminal and try sudo su to login as a root user. Ah! finally the problem got solved.
If you are still not able to solve this issue. Just write back to me and I shall help you out.
Njoi
Tags: sudo chmod, sudo recovery, sudoers chmod
Posted by Dhaval Parikh on Jul 1, 2011
As i mentioned in my previous post that I will let u know how to generate self signed certificates here is the procedure for it.
First of all install ssl-cert using
sudo aptitude install ssl-cert
Next step is to create a private key using the command below.
openssl genrsa -des3 -out myssl.key 1024
Now create a CSR where you need to provide details such as Country, State, City, Orgainzation name, Unit Name, Common Name and Email id
openssl req -new -key myssl.key -out myssl.csr
And the last step is the actual certificate
openssl x509 -req -days 365 -in myssl.csr -signkey myssl.key -out myssl.crt
Thats it. So its just 3-4 steps. Now start configuring it with nginx using the link below
http://blog.dhavalparikh.co.in/2011/06/configure-self-signed-certificates-with-nginx-and-rails/
If you have any doubts please feel free to ask.