Search This Blog

Monday, 11 June 2012

Change the Grub Boot Order Ubuntu


GRUB can be configured using the /etc/default/grub file. Before you make any changes to it, it may be a good idea to back it up by creating a copy:sudo cp /etc/default/grub /etc/default/grub.bak
You can restore the copying the backup over the original:sudo cp /etc/default/grub.bak /etc/default/grub
Open the file using the text editor with root privileges:gksu gedit /etc/default/grub
The line GRUB_DEFAULT=0 means that GRUB will select the first menu item to boot. Change this to GRUB_DEFAULT=saved . This change will make it easier to change the default item later.
Save and close the file. Run this command to apply your changes to GRUB’s configuration:sudo update-grub
The configuration change we made allows the grub-set-default and grub-reboot commands to be used at any time. These allow you to change the default boot item permanently or only for the next boot, respectively.
Run grub-set-default or grub-reboot (with sudo) with the number of the menu item to boot (the first item is 0). This command will change the default to the second item:sudo grub-set-default 1
In the screenshot above, Windows Vista is menu item 5. If you want to select an item from a submenu like Previous Linux Versions, you can specify the position in the main menu, followed by a greater-than sign (>), followed by the position in the submenu. You can also name an entry instead of giving its position. There’s a Forum post about how this works. The Ubuntu Wiki also has more details on configuring GRUB.

Friday, 18 May 2012

VMware, a changing beast .. VMUG 17/5/2012

Attended the London VMUG yesterday which turned out to be a particularly interesting agenda.

UG have previously been very infrastructure specific. Servers, hardware, software releases, storage, heated network debates and third party vendors touting their wares.

This one had a slight deviation into some of the new VMware initiatives. First a short, but nice presentation on vFabric and vApp. Both things I'm interested in due to my employer recently jumping on the VMware/Spring stack. tcServer, Gemfire and even big brother EMC rolled in with a couple of Greenplum racks.

The second break from tradition was a slot given over to Neil Mills (@MillsHill_Neil) of Mills Hill Recruiting.

The pre-amble by Simon Gallagher (@vinf_net) very much set the tone on how the traditional VMware geek needed to, or should start to become way more holistic in their approach to technology and solutions.

Neil followed this up with his presentation setting the vision for the 'Cloud Angel' and the next 5 years.

Cloud Angel: Someone who's no longer constrained by the silos of technology, someone who's adept with the cloud harp and can transfix the business with their melodic musings of an automated data centre with apps and services flowing from the fingers of devs out to consumers with no more than a man and a dog.

Being a VMUG it was a VMware centric presentation, VCP will be/already is expected, push your VMware and storage, VMware and security, VMware and <insert technology>, you get the idea. On the journey home this poked a few brain cells.

Together the two presentations got me wondering about the future and how much of an angels tool box will contain the VMware we know today, 5 years is a long time.  Can they continue to be this dominant? I think something missed, maybe for controversial reasons, is to consider some of the alternatives.

VMware acquisitions are taking them up into the app layers while the new kids on the block are starting to get rowdy, OpenStack, Piston, Eucalyptus, AWS etc.  The trend is also towards infrastructure as a commodity, vBlock, Flexpod, wheel it in and wheel it out, bursting into public clouds, moving into public clouds.

Its the new things that will keep them in this market, I guess that's an obvious statement! But will it also become the direction at the expense of the more traditional. vApp is a great example that just happens to run on vSphere, but does it have to?! I wonder if theres a secret lab where virtual pixies are plugging the next generation of solutions into other API's and one day we'll might even see vSphere being given away.

VMware were undoubtedly a game changer in this industry but we're starting to see the next evolution. It will be interesting to see how they, and the Angels adapt.

I hope they do, I already buried Netware and that was traumatic enough.

Wednesday, 16 May 2012

I can't click on the flash plugin 'Allow/Deny'

Ubuntu, Chrome & Firefox both had this.  IM app tried to invoke a flash URL to launch a video share service.  The Flash 'allow/deny access to your camera' dialogue box would pop up but nothing was active, no clicky mouse.


Go to :

http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager09.html

and it displays the flash global settings for your workstation.  Set the site you want to allow to 'don't prompt' and all is well.

Tuesday, 1 May 2012

Backtrack Chromium

Chromium can be installed from the repo's but by default won't run - root error

Follow the steps below :

1. apt-get install chromium-browser
You can also use synaptic and select the chromium-browser.

2. cd /usr/lib/chromium-browser

3. Replace geteuid to be getppid using hexedit with the following command :

hexedit chromium-browser

Then press tab to switch to the mode string. Then press ctrl+s and type geteuid. Replace geteuid to be getppid then press ctrl+x to exit!

4. Finished

EDIT 9/11/2012

This same process works for the Google Chrome.  File to edit is /opt/google/chrome/chrome

Saturday, 14 April 2012

Alfa AWUS036H/RTL8187L on OSX 10.6

The drivers on the Alfa site only support up to OSX 10.5.  I found various blogs, which were all EXACT copies of each other and none of which worked.

Eventually stumbled this article which got me close.

This post will just extend that blog with the things I found.
  1. Download the 10.5 driver from the Alfa download site
  2. Install, ignore the corrupt warning & reboot
  3. Open a terminal and type :
  4. sudo kextutil /System/Library/Extensions/RTL8187l.kext
    Notice: /System/Library/Extensions/RTL8187l.kext has debug properties set.
    /System/Library/Extensions/RTL8187l.kext has problems:
    Authentication Failures:
    File owner/permissions are incorrect (must be root:wheel, nonwritable by group/other):
    /System/Library/Extensions/RTL8187l.kext/Contents/Resources
    /System/Library/Extensions/RTL8187l.kext/Contents/Resources/English.lproj
    /System/Library/Extensions/RTL8187l.kext/Contents/Resources/English.lproj/InfoPlist87l.strings
  5. You now need to :
sudo chmod go-w [The File]
eg : 
sudo chmod go-w /System/Library/Extensions/RTL8187l.kext/Contents/Resources
sudo chmod go-w /System/Library/Extensions/RTL8187l.kext/Contents/Resources/English.lproj
sudo chmod go-w /System/Library/Extensions/RTL8187l.kext/Contents/Resources/English.lproj/InfoPlist87l.strings

Now this is where it goes a little off piste.  Following the reference article you should now just run the Realtech util and off you go.  For me that didn't work and the app wouldn't even run.

I restarted again and ran :
sudo kextutil /System/Library/Extensions/RTL8187l.kext

It reported no file permission errors but at the same time I was both prompted with OSX's "found a new network interface" and the RealTech app launched and allowed me to configure the NIC.

UPDATE 12/11/2012 : These drivers are 32bit.  Apple has removed the ability to do anything in 32bit with the Mountain Lion release.  So far I can't find anyway to get the 8187L working on ML. <sad face>

Thursday, 5 April 2012

apt-get Proxy Issue

Testing out Security Onion and apt-get update was failing.  The server is behind a proxy.

Added proxy settings to all the regular places :

/etc/environment    
export http_proxy=http://proxy.domain:port
/etc/apt/apt.conf    
aquire::http::proxy "http://proxy.domain:port/"; 
/etc/apt/apt.conf.d/80proxy    
aquire::http::proxy "http://proxy.domain:port/";

None of which worked.  In the end the command :

http_proxy='http://proxy.domain:port/' apt-get update
and because I always forget how to do this :

#!/bin/bash
http_proxy='http://proxy.eu.rtdom.net:8080/' $1 $2 $3

Friday, 9 March 2012

MAC Keyboard with anything other than OSX

My friend @coringrieves recently posted a picture of his desktop. Which is a Windows PC (he is averse to anything other than Windows) and a wired MAC keyboard. After mocking him furiously I then went and did the same myself.

Still persevering with Ubuntu it has an English (UK, Macintosh)keyboard layout which works great.

Not so the VirtualBox Windows 7 VM I run nor the Win64 alternative OS I sometimes boot into (Never did find a decent/working H.232 Linux video client).

Trawling around it seems the options are mostly based on installing Apples bootcamp.  Which is huge, I'd rather have gone and bought a Mac looky likely kb than install that bloat-ware.

Stumbled across another suggestion of using Microsofts keyboard layout tool to create your own, or in this case someone else kindly did it.

http://www.logikdev.com/2010/02/18/apple-uk-keyboard-layout-for-windows/

Installed, VirtualBox VM and vanilla OS all work fine.

Wednesday, 7 March 2012

Friday, 2 March 2012

Ubuntu/Backtrack eth0/wlan0 Missing

My good deed for the week was to offer my laptop as a replacement for one with a screwed VGA port.

'Yeah just switch the disks' - Linux is clever, it will work it out. #FAIL

Dual boot with Ubuntu 11.10 & BackTrack (Ubuntu).  Both failed to connect to the network and had created eth1 & wlan1 interfaces.

Google took me to http://www.orzeszek.org/blog/2010/07/25/fix-missing-eth0-when-cloning-ubuntu-vmware-virtual-machines/

Its discussing the same problem, but in a virtual environment.  The conclusion is the same in that the MAC address has changed and Ubuntu stores this as a reference in :

/etc/udev/rules.d/70-persistent-net.rules
Delete the file, reboot, problem fixed.

Tuesday, 21 February 2012

I think I broke Google

A tweet from @MarkMaceSmith asking :
 Why have you got hundreds of my images on your website Paul Regan?
Had me wondering what the hell !?

A quick look and he was right (kind of).. But not just his images, EVERYONES!

http://www.paulregan.co.uk/m/viewAlbum?uname=110372774069389594216&aid=5492124562868999953&start=0

Shows his gallery on my domain.  Note the the Picasa Mobile URL (/m/) which also gave me the answer.

I have masked the Picasa URL using an Apache rewriteRule on my site :
RewriteRule   ^m/(.*)   http://picasaweb.google.com/m/$1   [NC,P,L]
It appears the Google spiders came along and followed this all the way through Picasa's structure.  I don't know how deep but Google site:www.paulregan.co.uk/m/ currently returns >250K links and every one of them works!

I can probably fix this with robots.txt, but ..

  • Should I?  
  • Have I inadvertently discovered SEO gold? 
  • Will I be struck off and sent to web-master jail/gaol? (I probably should be)

#twitter

Monday, 20 February 2012

Linux Clonezilla "Error: no argument specified"

Ubuntu 10.04 LTS cloned from an identical friend using Clonezilla.

When you boot theres a quick flash of an error, in this case SSD disks so too quick to read, and your presented with the GRUB menu.

Selecting the current kernel threw out :

Error: no argument specified
All the grub config files appeared correct.

Fix :

  1. apt-get remove grub-pc
  2. apt-get remove grub-common
  3. rm /boot/grub/grub.cfg
  4. apt-get install grub-common
  5. apt-get install grub-pc
    • Install grub to the disk to contain MBR, in my case /dev/sda / 


Wednesday, 15 February 2012

Puppy Linux Full Install


  1. Download and create the Puppy linux LiveCD/LIveUSB
  2. Boot the PC using #1
  3. Follow the options to configure the screen res and then the locale options
  4. Prepare the disk, if you need.  Menu -> System -> GParted.  Delete/create the partitions as you need and restart the PC.  Don't save settings
  5. Install the files to disk.  Menu -> Setup -> Puppy universal installer. Follow the prompts to select your local disk.
  6. Install Grub. Menu -> System -> Grub legacy boot loader.  Follow the prompts and when asked select your local disk, eg /dev/sda1 and make sure you select destination to MBR.
Puppy Linux installed on 9 year old Sony Vaio.  I thank you.  

Wednesday, 8 February 2012

Crowbar and OpenStack Pt Deux

As a follow up to part 1 which left me with an 'installed' environment but no networking I thought I should post a follow up.

Since I last messed around a new version of crowbar (1.2) had been released so that was used.  A nice addition is rather than research/guess the OpenStack barclamp install order they are now nicely arranged on the Crowbar admin panel.

I also came to the conclusion that my networking 'issues' were a result of both me trying to install on vSphere, which has no support for native VLAN's and by complicating things by trying to shoe horn the networking into my corp range.

So I build a little lab which consisted of anything not nailed to a desk, I could find lying around, or that no-body would notice missing.


Switch - vlans created with SVI ports as needed for default gateways and all ports 802.1q to the nodes.

Crowbar install went fine using Pt1 to fill in the missing details.

The Swift install failed until I added some more storage (those cutting edge USB disks on top) and restarted the Crowbar install from scratch.

My first attempt at building a instance failed.  The instance remained in status of 'building'.

To debug

Use the Nova console to check which node the image has been deployed to and then grep the local /var/log/nova/nova-compute.log for ERROR.

2012-01-13 02:52:59,933 ERROR nova.compute.manager [-] Instance '5' failed to spawn. Is virtualization enabled in the BIOS? Details: internal error no supported architecture for os type 'hvm'

This is a result of the crappy hardware I'm using so I changed the nova barclamp to 'qemu' and bingo,   deployed instance - well, sometimes.  It seems pretty hit and miss, which I can't yet trace.  I suspect I could still be suffering from the Heath Robinson lab I've put together.  Pt.3 :)


Some useful bits I picked up and am keeping here for the moment

nova uid and password : admin / crowbar

Deployed nova/images instance path - on nodes :
  /var/lib/libvirt

sudo nova-manage service list

mysql -u<user> -p<password>

Log entries of instance deploy and destroy.

2012-01-13 09:02:57,736 INFO nova.virt.libvirt_conn [-] instance instance-00000007: deleting instance files /var/lib/nova/instances/instance-00000007

2012-01-13 09:02:58,462 INFO nova.virt.libvirt_conn [-] Instance instance-00000007 destroyed successfully.

2012-01-13 09:07:29,306 INFO nova.virt.libvirt_conn [-] Instance instance-00000009 spawned successfully.

Monday, 6 February 2012

Windows Killed my MBR

Having recently acquired a SSD and some more geebees I re-installed Ubuntu x64.  The SSD already had a OEM Windows partition and I (foolishly) decided to just resize it 50/50 and put Linux on the back end.  With a mind to come back and build the Windows OS as a dual boot.

Well this morning I went back, built the Windows OS and then fried my GRUB boot loader.  Bye bye Ubuntu, insert sad face.

Recovering it wasn't so bad although as usual there is LOTS of conflicting documents and ways to get yourself out of this mess.  This method worked for me :
  • Boot Ubuntu DVD in live mode.
  • Jump into a terminal and switch to sudo -i and run parted -l to establish which partition you need to rebuild the MBR for.
~$ parted -l
Model: ATA SAMSUNG SSD PM83 (scsi)
Disk /dev/sda: 128GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number  Start   End     Size    Type      File system     Flags
 1      1049kB  106MB   105MB   primary   ntfs            boot
 2      106MB   45.1GB  45.0GB  primary   ntfs
 3      45.1GB  128GB   82.9GB  extended
 5      45.1GB  120GB   74.4GB  logical   ext4  <---- Ubuntu Install
 6      120GB   128GB   8453MB  logical   linux-swap(v1)

  • mount the partition 
mount /dev/<partition> /destination
eg : mount /dev/sda5 /media/sda5

  • run 
grub-install --root-directory=<mount> <disk>
eg : grub-install --root-directory=/media/sda5 /dev/sda 
Assuming you get a success message your good to go.  Reboot and you should have Linux back and in my case Windows 7 also now existed on the GRUB loader.

Caveat : The first time I tried to boot Windows it complained of a missing loaded.  The second time it worked fine .. I never got to the bottom of that.

Moral of this story is install Windows first and Ubuntu second.  Ubuntu is a clever OS and Windows is not.

Sunday, 8 January 2012

New Year, new look

I've been wanting to revamp my website (all two pages of them) and blog design for a while now.  I wanted a cut down basic look which I'd seen on other sites.  I'm not shy, and 'imitation is the sincerest form of flattery' right !?

Most of the other sites I'd seen sat on Wordpress.  I toyed with this and even tested the theory using an AWS cloudformation Wordpress stack.  Which incidentally worked really well !  But I've committed to blogger so wasn't going to going to switch that part and learning another platform just for a few pages seemed excessive.  Although in hindsight probably less than the path I took.

I started to mess around and build up some html/css.  One of my targets was to get a functioning menu rather than the multiple image hack I'd put together before.  Reason : I'd stand more of a chance of getting the Google search sub-headings.  Thinking about it I don't really know 'why' I want them, but that's now irrelevant.

I found this http://blog.vogtjosh.com/post/2990652547/css3-animated-drop-down-menu which has a really nice looking transition menu - well, I say nice, nice on SOME browsers.  Basic on others (looking at you Microsoft).

De-constructing the CSS to get the look I wanted was not quick.  A steep learning curve which went back and forth as the smallest change broke the look in different browsers.

I applied the same fade look to the social icons, again, that took ages and often meant going back to square one.  Mostly due to my crap web skills but also because of very different behaviour across browsers and because I didn't do any revision control.

Persistence paid off and its mostly finished with the main page, picture gallery and blog all with a similar look.  There are a few bugs which I need to look at and I need to clean up and better annotate the CSS.  But mostly I'm happy with the result, especially in Chrome, IE - pah, who would use that as a browser now anyway. And I also learnt some new skills which is always nice.

Thursday, 29 December 2011

Blogger, double line spacing

This has been bugging the crap out of me for ages so I finally sat down this evening and worked it out.  Or at least I worked a work-around out !

When creating posts blogger would kindly add </br> tags into the html. </br> is a HTML line break.  So when writing a post with CR to create a single line space for a paragraph blogger would kindly add a br tags all over the place, and so you end up with double line spacing.

Note:Changing the line break options made bugger all difference.

I had my default blogger font as Trebuchet but in the WYSIWIG blogger editor the font would show as Times Roman.  Each blog post I created I'd select all and use the font drop down to show me the correct font.

Bingo ! .. its at that point blogger gets all crazy with the br tags.

What I hadn't realised is if you leave the editor font alone and look at the preview then you get the default font you've set in the blog template design.  And if you don't change the font in the editor then blogger never inserts the </br> tag.

I am happy now.  No more switching to HTML view and deleting tags ..

VLC, Windows 7 to Basic Mode & Black screen

Debugging an audio issue I have on XBMC and dropped to trusty VLC. Windows (7 x32) flicked into basic mode and VLC only played the audio.


A quick google showed a few hits with the same issue, but no resolution. Check video drivers, update VLC etc.  All rather generic.


It also wasn't version specific (I horde older versions) and they all behaved in the same way.


No amount of preference changes resolved it.


Fix : Shut some apps, in my case Chrome was hogging all the RAM and I was >70% used. Releasing some system resources fixed VLC. So not directly a VLC issue. 


Hope that helps some people. The problem seems to have been around a while ..

Wednesday, 14 December 2011

Installing flash on Backtrack 5

Backtrack comes with flash installed, but it doesn't work.  Believe it or not Nessus requires flash ! A security scanner that requires flash, oh the irony ..

Following the instructions provided by BT didn't work for me so I'm reproducing the 32bit steps which did :


Grab the correct/latest flash install from adobe.com : 

install_flash_player_11_linux.i386.tar.gz
Run the following commands : 
Remove BT installed files 
apt-get purge flashplugin-nonfree flashplugin-installer gnash gnash-common mozilla-plugin-gnash swfdec-mozillarm -f /usr/lib/firefox/plugins/*flash*
rm -f /usr/lib/firefox-addons/plugins/*flash*rm -f /usr/lib/mozilla/plugins/*flash*
rm -f ~/.mozilla/plugins/*flash*sorm -rfd /usr/lib/nspluginwrapper
Install downloaded version
tar xvfz install_flash_player_11_linux.i386.tar.gz
mkdir ~/.mozilla/plugins
mv -f libflashplayer.so ~/.mozilla/plugins/
Test within the browser, firefox about:plugins

UPDATE : This process also works for Chromium

Wednesday, 30 November 2011

Crowbar & OpenStack Install Part 1

A few weeks ago I decided to investigate OpenStack.  The core components are a collaboration and resulting love child of NASA and RackSpace and is an Open Source solution to build a blaah blaah cloud.  It seems to be gaining good traction and is often mentioned in the same breath as VMware.  In fact it appears everyone not in VMwares back pocket is jumping on the bandwagon and so seemed worthy of a look.

This is still a moving target for me, its not 'up' and has certainly not been painless and smooth, but I'm writing up Pt.1 as much for me as for the blogosphere.


OpenStack is, well, just that, a stack of different products which together produce an end solution.  In my eyes and how I'd describe it to 'management' is its comparable to LAMP.  Linux, Apache, MySQL and PHP.


I won't go into the details you can read yourself - http://en.wikipedia.org/wiki/OpenStack


I started by reading the install docs and attempting to install each piece individually and then I guess hook them all together.


This didn't go well and a twitter reply from Matthew McClean suggested I take look at Dells Crowbar.


The rest of this post will be the process, troubleshooting and useful links I've come across as I attempt to install Crowbar on my journey to OpenStack nirvana ..


Crowbar background


https://github.com/dellcloudedge/crowbar/wiki

http://robhirschfeld.com/2011/03/14/how-openstack-installer-works/

Resources


4 VMware guests - Each has two NICS each on a vlan, eth0 vlan 66 and eth1 99.  eth0 will be re-configured from the default so its available on my corp LAN.

  • Admin Node - 2GB RAM, 20GB disk
  • Node 1 - 1GB RAM, 15GB  disk
  • Node 2 - 1GB RAM, 8GB disk
  • Node 3 - 1GB RAM, 8GB disk


Installation

The documented install procedure - https://github.com/dellcloudedge/crowbar/wiki/Install-crowbar


If only it were that simple.

NB//Crowbar.iso is a base install, it has none of the OpenStack components. 
This will build, pretty seamlessly, your 'admin' node which is then used to build the other components.
Here things went a little squiffy.

Theres a  nice YouTube video of building the environment which I started to follow :




But with little success.  The first barclamp (name assigned to the Crowbar packages, which actually in turn directly represent Chef cookbooks) which the video has you assign is Glance, which for me failed.  Attempting to resolve this I joined the Crowbar lists and co-coincidently someone else asked about the order to install applications and had another link :

MySQL
Keystone
Nova Dashboard
Glance
Nova
Very different to the order on the video ! - But its still worthwhile watching.

Another little find went into some further details - http://kb.dtosolutions.com/wiki/Deploying_a_small_OpenStack_test_environment_using_Crowbar


From these I eventually cooked up the following install method which seems to be more successful than anything else so far.

Due to a bug in the dashboard when removing or adding nodes I found you had to create all your nodes upfront before you start to apply barclamps.  Create 3 nodes, power them all on so they run the discovery image and become available in the Crowbar console (unassigned, yellow).

Click bulk edit and assign all three.  They will install the OS, reboot a few times and then go 'assigned' in the console with a green icon.


Assuming you have the admin node built and three green nodes.

  • Build MySQL proposal and assign server to node 1 and client to node 2 and 3
  • Build Keystone and assign to node 1
  • Nova Dashboard to node 1
  • Glance to node 1
  • Nova.  
Nova requires a 'controller' and then compute nodes.  Trying to do all three failed for me so I did them individually.  In my case I'm using VMware for this POC so the nova proposal needs to be changed.  Edit the line :
"libvirt_type": "kvm", -> "libvirt_type": "qemu",
And assign Controller to node 1 and then compute to 2 and 3.

Throughout all of this I had a tail -f running to the admin log :



/opt/dell/crowbar_framework/log/production.log


By all accounts I should now have a working environment. I don't, everything appears to be installed but the learning curve continues.

Nova dashboard is not working which I've traced to a routing issue on node 2. It has the admin interface up but the default gateway is using one of the networks I didn't change at the install time.


Nagios is not working. Watching the production.log during the barclamp installs showed Nagios errors but I'm ignoring them/that for now.


Troubleshooting / Hints 'n' tips : 


Barclamps sometimes report failure to deploy but repeating the same task will be successful.


If your running your POC on hypervisors or something else that has the technology make good use of snapshots.