Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, 31 July 2012

Story of Compiling Kernel for Linux VServer

So I've been having a fun week.

This is my first time compiling a kernel and It should be straight forward as there are some helpful websites available on just this topic:

pre-requisites:
Patience. This will take an hour (or more) on a decent quad core machine.
gcc-<version>-plugin-dev
fakeroot
make-kpkg
libncurses5-dev

On compiling the kernel with the VServer patch
http://linux-vserver.org/Installation_on_Linux_2.6
On compiling a general kernel
http://www.howtoforge.com/kernel_compilation_ubuntu
On using your complete kernel
http://www.centos.org/docs/2/rhl-cg-en-7.2/buildkernel-bootloader.html

I was running the commands on a Ubuntu12.04 virtualbox machine, following the Vserver instructions and while running make, it kept running out of disk space.
A quick google tells me the result should be about 500MB at most, and doesn't even tell you what the result should be. My attempts kept running out of space after about 40 minutes and after hitting 8GB used space, of which almost all the room was taken up by vmlinux (2.9GB) and vmlinux.o (4.9GB)
Apparently this is not normal.
Eventually after making a virtual hd with a size of 100GB (of which the result was just short of 9GB itself) it appeared to say a build of bzimage in /arch/boot/x86 folder was completed. This I could never find anywhere in the folder.

I am currently compiling using the howtoforge.com link so we will see how much success I shall have later on.
Currently I am getting GCC error "array subscript is above array bounds" quite a lot but it appears to be ignoring it.

#Edit
Its been 2 hours. I didn't set CONCURENCY_LEVEL= because of fear of it crashing. Starting to wonder if it was a mistake given how long this is taking. It is still compiling and it has just moved from ./drivers to ./fs. My favourite file list, sudo du --max-depth=1 -h | sort -rh , reports file is at 7.9GB and growing.


7.9G .
4.8G ./drivers
689M ./net
602M ./fs
316M ./arch
259M ./sound
126M ./kernel
76M ./security
58M ./crypto
41M ./mm
34M ./lib
31M ./include
19M ./Documentation
17M ./block
13M ./.tmp_versions
6.8M ./firmware
6.2M ./ipc
5.0M ./grsecurity
4.7M ./init
4.1M ./tools
3.8M ./scripts
2.8M ./virt
2.0M ./debian
156K ./samples
92K ./usr

Sunday, 22 April 2012

Slim Rails Environment V2

Install Ubuntu Server with whatever settings you like (Default for me)

Remember that when using the xOrg system (xinit), you make it run from terminal with 'xinit' or 'startx'
You can open programs including the terminal from the right click menu in fluxbox.
You cannot copy-paste easily within xOrg unless you use terminator.

Update 24/06/12: !If you are using Bruce Scharlau's vm_template virtual box, and cannot Sudo apt-get anything due to 407 error, /etc/apt/apt.conf has the proxy defined in it and you can simply remove/replace the line as needed.

#System
sudo apt-get install xinit
sudo apt-get install fluxbox
sudo apt-get install build-essential
#Node.js  Rails will not run without a Javascript Engine
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
#Rails
sudo apt-get install ruby1.9.1-dev
sudo gem install rails
#Using these three will install all the generic gems
#rails new cookbook
#cd cookbook
#bundle install

##Gem Specific
#Sqlite3
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3

#Cucumber-rails
sudo apt-get install libxml2-dev libxslt-dev
sudo gem install cucumber-rails

#Postgresql gem
#Even if you do not use postgresql on your development machine, by just listing the gem anywhere in your gemfile, you need the libraries to make postgres work for bundle install. This is needed for Heroku.
sudo apt-get install libpq-dev #Note libpq NOT libpg

##Other Programs
#Terminator (Better terminal)
sudo apt-get install terminator

#Google Chrome (web Browser)
sudo wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

#sqlitebrowser (SQLite3 browser)
sudo apt-get install sqlitebrowser

#git
sudo apt-get install git



#Komodo ~Broken
~I have not yet got this working on xinit. Use Nedit or nano instead.
Edit: Or if you are using Ubuntu in a VM, start up a shared folder and run Komodo outside the VM

Aded 24/06/12:

My Workflow


Since this is useful and interesting to people, here is how I work:

When working, I have the virtual machine open on 1/3 of my screen. In it I have terminator open, with a tab for all git commands, a tab for all rails, system and developement commands, a tab for running rails s if I am testing in chrome, and a tab for running guard in (guard is a gem that automatically runs all rails tasks on file change) I will open a chrome window at the bottom of this area if I need to look at my app outside testing.

The only two changes I have made to Bruce's VM is I have made a symlink from /media/sf_vm_shared to ~/shared so it is in my home folder, and I have removed the proxy line in /etc/apt/apt.conf since I do not bring my desktop onto campus.

The remaining 2/3 of my screen has komodo edit running in the windows environment which edits the files through the shared c:/vm_shared folder.

Friday, 20 April 2012

Komodo Edit and Chrome on Ubuntu 11.10

Komodo Edit and Chrome have different methods of installing to anything you can get from the apt repository.
I am using Ubuntu 11.10 64bit on a VM Virtual box with guest additions.
The dates in my links are the dates I saw them, as things change over time like the differences of Rails since 2006.

Firstly for Google Chrome:
My source is How to open source (as on 03/04/12)
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - from Google Linux Repositories (as on 03/03/12)
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable

To find the newest Komodo Edit version, browse around http://downloads.activestate.com/Komodo/releases/
For Komodo Edit 7.02 x64
Download using chrome: http://downloads.activestate.com/Komodo/releases/7.0.2/Komodo-Edit-7.0.2-9923-linux-x86_64.tar.gz
tar -xvzf Komodo-Edit-7.0.2-9923-linux-x86_64.tar.gz
Then make a .desktop file.
Source: http://www.ubuntugeek.com/how-to-create-desktop-launchers-in-ubuntu-11-10oneiric.html (on 20/04/12)

sudo apt-get install --no-install-recommends gnome-panel
gnome-desktop-item-edit ~/Desktop/ --create-new
This will make a popup where you can set the Icon and App location. The icons to use are in the Share folder, and the application is in the Bin folder.

Thursday, 5 April 2012

Generic Gem Install Error Solving


Installing pg (0.13.2) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.


/usr/bin/ruby1.9.1 extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***

I highlighted the interesting bit. If you are on Ubuntu, the header is generally related to the package you are missing.
If you type libpq in a terminal, it helpfully tells you to try sudo apt-get install libpq
That will deal with this problem and many others like it.

Other variants of the problem are similar to the stack overflow problem: http://stackoverflow.com/q/10198002/193785
Here it is not a .h file but as some other kind of generic library. checking for main() in -lopenal... no

1:Sudo apt-get install openal
2:Sudo apt-get install openal-dev
3:Sudo apt-get install libopenal

One of these three solutions will probably work.

Tuesday, 28 February 2012

My exact RoR environment (Code Only)

sudo apt-get install xinit
sudo apt-get install fluxbox
sudo apt-get install ruby1.9.1-dev
" permission denied - /var/lib/gems " if not using 'sudo' for gem install
sudo gem install sqlite3
if "Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
        ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb " then sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install rspec
if "make
sh: make: not found " then sudo apt-get build-essential
sudo gem install rails
sudo gem install rspec-rails
sudo gem install cucumber-rails
if "libxml2 is missing." then sudo apt-get install libxml2-dev
if "libxslt is missing." then sudo apt-get install libxslt-dev
if "could not find gem 'jquery-rails (>=0) ruby' in any of the gem sources listed in your Gemfile."
"/var/lib/gems/execjs-1.3.0/lib/execjs/runtimes.rb:50:int 'autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)" then
sudo add-apt-repository ppa:chris-lea/node.js
if "the program 'add-apt-repository' is currently not installed."
sudo apt-get install python-software-properties
sudo apt-get install nodejs
startx
Add editor of choice and done.