Thursday, September 26, 2013

Great place to learn Drupal 7

Install a contact me form on Drupal

These instructions helped me out.

Enabling the Contact Module in Drupal 7:
  1. Log into your Drupal 7 dashboard
  2. Go to Modules
  3. Find the “Contact” module, place a check mark next to it and click "Save configuration"
    drupal_contact_1
  4. Close the overlay by clicking the “X” in the right corner
  5. Now that your contact form is enabled, you’ll have to change the permissions so everyone can use it. Click “People” in the top admin menu bar
  6. Click the the “Permissions” Tab in the right corner
    drupal_contact_2
  7. Scroll down to the contact section and check the boxes you want to apply to the permissions. If you want everyone to be able to use your form, set Use the site-wide contact form to both ANONYMOUS USER and AUTHENTICATED USER.
    drupal_contact_3
  8. Click “Save Permissions” at the bottom of the overlay
Your default contact form is now ready to use. However, there’s no link on your website for it. For more information on configuring the contact form and adding a link in your menu to it, please see our other articles.
Now that you have installed the “contact” module in Drupal 7, it’s time to create and configure the contact form.
  1. Log into your Drupal Dashboard
  2. Go to Structure >> Contact form
  3. Click Edit next to the default Website feedback category
    drupal_contact_config_1
  4. Fill in the fields appropriately.

    CategoryEnter a category (more like a title) for your feedback form.
    RecipientsEnter the email addresses that you would like the results of the form emailed to. If sending to more than one email address, put each email address on its own line.
    Auto-replyIf you would like an auto reply message sent, enter it here. For example, some users prefer to get an email similar to, "We have received your feedback and will get back to you soon."
    WeightOn pages that list the available forms, you can change where this form is listed by adjusting the weight here.
    SelectedIf you would like this to be the default form, set Selected to yes.

    drupal_contact_config_2
  5. Now you can see if the form is created. If you need to edit the form in the future, simply click “Edit” from this screen or if you want to permanently delete the form click “Delete
    drupal_contact_config_3
The form will be available if you visit yourdomain.com/contact but will not show up on your website until you add it to the navigation. For more information on adding the contact link to your website’s navigation, please see our article.

Before being able to add the contact form into your main menu, you should have already installed the contact module and configured the settings. Now, you need to create a way for your website’s visitors to actually find and access the form. You can add a contact link to your main menu via the Drupal dashboard.
  1. Log into your Drupal 7 Dashboard
  2. Go to Structure >> Menu
  3. Click Edit Menu next to Main Menu
    drupal_contact_nav_1
  4. Click on the List Links tab in the top right
  5. Ensure you are on the LIST LINKS tab (tabs are shown in the top right) and then click Add Link in the top left
  6. Fill out the desired fields with the appropriate data.

    Menu link titleThis is going to be the actual text the users click on in the menu to get to this page.
    PathAs the contact form by default is located at http://domain.com/contact, entercontact as the path.
    DescriptionThe Description field will display its contents when using the mouse to hover over the menu link.
    EnabledThe Enabled box must be checked for the menu item to be visible.
    Show as expandedIf this menu item has children, always show the children.
    Parent linkParent Link is for use if you want to place the menu under another menu item as a child. By default, this is set to <Main Menu> so it is on the top level.
    WeightWeight is a numerical designation for where the item will display in the menu. The lower the number, the higher or more to the left the menu item is placed.
    drupal_contact_nav_2
  7. Click Save

    Now, when you visit your website, you’ll see that there is now a link to your contact from in the menu bar. 
    drupal_contact_nav_3




Drupal Installation

10:30 PM Sep 26, 2013 , Zigatala, Dhaka

Downloaded tasksel and downloaded lamp

But phpmyadmin is not working.

Let's see What we can do about it. Well I just went to this URL
http://localhost/phpmyadmin/
Surprise Surprise it simply works.



May be a restart was required!

Ok now I am read to go to the next step of installing drupal.

http://munix.dk/tutorials/computers/install-lamp-web-server-and-drupal-ubuntu

Now the above is a great site which documents LAMP and Drupal installation. It's very comprehensive and I actually did not follow all the steps. But I got to the stage where I can install drupal.

But I am thinking whether I should follow the steps to the core.
Actually I did every step to stay in the safe side!

11:30 PM Oooooooo uh! Done with Drupal installation, ah! great

What to do next?

Top ten things to do after Drupal installation

http://www.rundrupal.com/tutorials/top-9-things-do-after-you-install-drupal

http://www.onextrapixel.com/2011/10/06/from-design-to-live-15-must-do-steps-after-installing-drupal/

http://www.devsaran.com/free-drupal-theme

Nice post from the author of YCM

Building Vim plugin from Sources

Well, the following link gives some information on how to build gvim from sources and along with important info on how to build from sources in general:

http://aufather.wordpress.com/2010/08/15/building-gvim/

Now I seem to go back to the following link:

https://github.com/Valloric/YouCompleteMe/issues/1

I did not find any link which says how to build a plugin from sources. So what should I do? Let me go to github page of YCM (YouCompleteMe) and see whether I can get the source file.

Well It's  official page has all the information of how to recompile YCM:

https://github.com/Valloric/YouCompleteMe

I was such a fool not to read it through. Here are the specific instructions from above link:

Remember: YCM is a plugin with a compiled component. If you update YCM using Vundle and the ycm_core library API has changed (happens rarely), YCM will notify you to recompile it. You should then rerun the install process.

Install development tools and CMake: sudo apt-get install build-essential cmake

Make sure you have Python headers installed: sudo apt-get install python-dev.

Compiling YCM with semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe
./install.sh --clang-completer
 
 
Compiling YCM without semantic support for C-family languages:
cd ~/.vim/bundle/YouCompleteMe
./install.sh

Building Vim from sources

It was required to build Vim from sources since plugin like YouCompleteMe requires newer version.

Download the source files from the following link:

ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2

This is given in official download page of Vim:

http://www.vim.org/download.php#unix

hg clone method produced error. So I went to uncompressed folder of the above tar file and followed the following procedure:

cd vim
./configure --with-features=huge \
            --enable-rubyinterp \
            --enable-pythoninterp \
            --with-python-config-dir=/usr/lib/python2.7-config \
            --enable-perlinterp \
            --enable-gui=gtk2 --enable-cscope --prefix=/usr
make VIMRUNTIMEDIR=/usr/share/vim/vim74
sudo make install

The above instruction has been taken from the following site:

https://github.com/Valloric/YouCompleteMe/wiki/Building-Vim-from-source

But then it produces an error that whenever GVIM runs it says YCM needs to be built from the source.

Here someone is trying to do that but encountering problems:

https://github.com/Valloric/YouCompleteMe/issues/1

So search google for ways to build a plugin from source.

Wednesday, September 25, 2013

Summarizing my experience with Linux

I had some torrid time with Linux installation. Ubunut 13.04 and it's derived distros like LUBUNTU, XUBUNTU  all had  "buffer overflow" error in R while installing new packages. After much trial and tribulations I settled down with Ubuntu 12.04 LTS. After a week, I am quite happy with it. R works just fine but it had the problem of resuming from suspension. The same problem I had in MINT 15.  Following patch from here worked out just great. I am ever grateful for that. Otherwise I would have been still in limbo.

Fix Suspend

From “unziberla” in the comments below:
Guys, i fixed suspend on my AO751h with 12.04 starting from old patch for 11.10 from which i removed one quirk.
Open a terminal and use the following commands:
gksu gedit /etc/pm/config.d/gma500
Add in one of the following codes and save the file (apparently one “-” works for some and others need two “--” in front of “quirk-vbemode-restore”):
ADD_PARAMETERS='-quirk-vbemode-restore'
ADD_PARAMETERS='--quirk-vbemode-restore'
This has been a life changer. No doubt about that.

Sunday, September 22, 2013

Pathogen from github seems faulty

In one of my previous post I described how to download pathogen for vim. But downloading it from github gives all kinds of errors. Better method is to go to the vim scripts archive , download pathogen.vim file to the autoload folder. I have no idea why this would happen but it just happened .

Installing Dropbox in Ubuntu

I think the best way to download is by wget as mentioned in dropbox official site.

Installing pathogen for vim in Ubuntu

Copy and pasting from the link here: 

Slighty modified the url of github:

mkdir -p ~/.vim/autoload ~/.vim/bundle;
curl -Sso ~/.vim/autoload/pathogen.vim https://github.com/tpope/vim-pathogen/tree/master/autoload
If the above doesn’t work because you don’t have curl installed, that is easy to remedy


sudo apt-get install curl
If you are new to vim and do not have a .vimrc file, create one with vim:
vim ~/.vimrc
and paste the following lines in a minimal .vimrc file 

" Pathogen
execute pathogen#infect()
call pathogen#helptags() " generate helptags for everything in 'runtimepath'
syntax on
filetype plugin indent on

Changing Computer's name in linux

You have to change the computers hostname as well.
Edit the hostname file and replace the name
gksudo gedit /etc/hostname
also change the name in hosts
gksudo gedit /etc/hosts
Leave the other stuff there untouched.
For the username, it would be cleaner if you deleted the old user and created your new one.

Ubuntu 12.10 fails too

As expected Ubuntu 12.10 also fails to load the screen. This is not surprising at all since  other ubuntu based distro like Xubuntu and Lubuntu also failed in similar fashion.

Opensuse and Fedora

Opensuse could not even boot and Fedora I have just started let's see how far I can go! Fedora gives me the same shit as Opensuse.

Horrific start with Lubuntu and Xubuntu 12.10

After installation, I do not get any GUI desktop at all. Stuck in the terminal.  Same with Xubuntu 12.10. I guess I will end up with the same in Ubuntu 12.10. 

Damn! Where Do I go?

Saturday, September 21, 2013

One last ditch effort with R in Lubuntu 13.04

I just want to see whether it works or not. After all the updates  and upgrades, I am going to remove R and reinstall it to see whether it works or not. I am almost certain it won't make any difference but still.

sudo apt-get  --purge remove r-base
sudo apt-get autoremove

Well R still shows the same error! So good bye 13.04!

Lubuntu 13.04 Synaptic PM and results after updates through it

Synaptic PM needed  to be configured manually the proxy setting. It did not take it from the system. I did it and now I can download two image updates. Let's see whether  the problem with R goes away with this.

After all the updates and upgrades, I get the same old error in R. So I am officially closing this 13.04 distros as not working for me. Now time to move on to Lubuntu 12.10.

Results with Lubuntu 13.04 updates and upgrades

In the last post, I have detailed how to get apt-get work.  It required a system reboot which is surprising.
 Anyway, after all these updates and upgrades R is still showing  "buffer overflow" problem. This is mind boggling.

What I am going to do now is this:  Try to get updates from Synaptic Manager. If that does not work, then try Lubuntu 12.10 and see whether it works.
Brand new week, brand new morning but my woes with Linux installation continues. I tried all sorts of distros but failed to get a working OS.  Finally it seemed that in my machine, Ubuntu versions 13.04 gives "buffer overrun"  problem. I tried all the variants of 13.04.



First I try to update the Lubuntu 13.04. Yeah, back to it again:

I reinstall cntlm  and try to get it working following the instructions from here:

http://zipizap.wordpress.com/tag/cntlm/

9:28 am:  Done installing cntlm.

What I am doing now is just do this to see whether apt-get works:

sudo  nano /etc/apt/apt.conf  and add the following line:

Acquire::http::Proxy  "http://rushadf:0302@127.0.0.1:3128";

 Now I put the command:
sudo apt-get update

show 0% waiting for headers and just hangs up there
Does not work. So I close the terminal and try again.

It's still not working. Now let's try this:

sudo vi /etc/bash.bashr

Add your proxy server details in the following format

export http_proxy="http://username:password@proxyhost:port/"

export ftp_proxy="http://username:password@proxyhost:port/"

It's still not working.

I close the terminal and try again to see what happens. NO! still not working!

Now I try this:

Some releases sudo is configured in such a way that all environment variables all cleared when running the command. To keep the value for your http_proxy and fix this, you need to edit /etc/sudoers, run:

visudo 

Then find a line that states:

Defaults env_reset

and add this after it: 

Defaults env_keep = "http_proxy ftp_proxy"
  Now try apt-get again. Nah still not working.
Let me have a system reboot and check. After system reboot it is working. So does it seems that it might have worked right after the first step? who knows!
 

Tuesday, September 17, 2013

Building R from Sources in Lubuntu

Whenever I tried to install packages in R I got error  "buffer overflow detected" or something like that. Somebody suggested to build R from sources and it was a real pain run the configure file:

Step 1:
Get the compressed R installer from CRAN, untar to a folder and go to that folder.

Step2:
run ./configure --with-readline=no. It will give error, fortran has to be installed by the following command:

sudo apt-get install fort77

Another error comes up which says:
checking whether mixed C/Fortran code can be run

Then put: 
$ sudo mv /usr/lib/libf2c.so /usr/lib/libf2c.so_backup
$ sudo ln -s /usr/lib/libf2c.a /usr/lib/libf2c.so

Then:

sudo apt-get install libX11-dev
sudo apt-get install libxt-dev

Then :
make 
make install etc.


All About Texlive in Lubuntu


It seems that using


sudo apt-get install texlive

is a bad idea. Rather use the procedure from the following link:
Following is a comprehensive guide for installing texlive in linux:

http://tex.stackexchange.com/questions/1092/how-to-install-vanilla-texlive-on-debian-or-ubuntu


Now, this is very crucial if we want to avoid  recommended packages: this might be good for large doc files such as texlive-extra-doc etc

sudo apt-get --no-install-recommends install lyx


This is how to manually install a particular individual tex-live package:

http://tex.stackexchange.com/questions/38978/how-can-i-manually-install-a-latex-package-debian-ubuntu-linux


Here is how to remove texlive:

sudo apt-get remove texlive
sudo apt-get autoremove
sudo apt-get remove tex-common
Then download and install directly from TUG. You can choose your operating system there. This has a bunch of packages and is much more complete than other distributions. Much better than sudo apt-get install latex.
 
Following code is to dowload it directly:
wget http://mirror.ctan.org/systems/texlive/Images/texlive2012.iso
sudo mount -o loop texlive2012.iso /mnt
cd /mnt
sudo ./install-tl
 
 
Some issues related to installation was discussed here. Specially take note of
sudo apt-get purge command.
 
Here is a great way to find information about latex package:
 



I advise to recur to an installation by hand of a tex package only when such tex package is not available in an ubuntu package.
Searching for it with
apt-file -x search '/textcomp.sty$'
I obtain the following results:
texlive-latex-base: /usr/share/texmf-texlive/tex/latex/base/textcomp.sty
and it say the tex package you look for is contained in the ubuntu package whose name is texlive-latex-base, so install it, if not already installed.
By the way, apt-file is a command to install separately from the apt-get package, and only a convenient and alternative way to search into the repositories the same way ashttp://packages.ubuntu.com/.