Thursday, April 28, 2011

Making Sense of Eclipse....

Oh Eclipse.. how I love you and how I loath thee.

On linux, I probably think that eclipse is one of the most versetile IDE environments I've ever used.  Pick your language and it probably supports it.  Java, pyhon, c++, cobol as well apparently for those wanting to dust off their mainframe leet skills. 

The main problem I've had with eclipse for ages has been their plugin support.  Yes, they have tons of plugins and most of them work wonderfully.  I start out with the bare eclipse, then I have a need for a python environment.. so I install the plugin, then I need a c++ environment so I install that plugin. 

Then I realize that I have so much clutter in my IDE that I can't find anything.  I also think that if I'm working on a c++ project, I most likely don't want, care or need the python support in my IDE.  Its only purpose is to suck even more of my precious RAM.

I hate having so much clutter.. so I usually end up with 3-4 installs of eclipse which is really silly.

Here's my attempt at fixing this.  (yes, this is super nerdy but it mostly works).

cd $HOME/local; mkdir eclipse
 
extract the latest eclipse into that directory, and add your standard language
neutral customization.
I like using the viPlugin or eclimd and the colorthemeplugin.


Standard install, so extract your eclipse, setup your plugins.. then go to your eclipse install directory (I usually install in $HOME for my own sanity if nothing else)

cd eclipse; git init; git add * 

Also include any dot files in the eclipse directory.

git commit -a -m "initial install"; git tag bare

now, let's setup our java environment.

git checkout master -b java

Get your favorite java plugins.  Maven?  GUI Builder? whatever you like using.

Add everything that's been added to the repo.

git commit -a -m "Adding java stuff"

Now, let's do the python environment.

git checkout master -b python

Install the python plugin and any tools.

Once this is all setup...  you checkout the branch you want to work on different versions of eclipse that are slimmed down. 
You can checkout the bare install at anytime (git checkout bare -b newFork).

In theory it saves you some space, and lets you get somewhat of a handle on your environment.

Well.. that or its a completely random crazy idea that makes no sense to anyone but me.... but sharing anyways.

Thoughts? Comments?

Also, if anyone knows of a way to unload plugins without uninstalling them completely, please let me know.

Sunday, February 27, 2011

An interesting but mostly pointless exercise.

So, let me explain my mind frame when I was approaching this.  Some of it is quasi logical, other parts is just me being weird.

For some reason or other.. I wanted to have a few raw block devices.  They're usually created using dd command.

ie.  dd if=/dev/zero of=foobar.raw bs=1M count=2048
bs = block size so the size of foobar.raw = 1m * 2048 = 2048mb = 2 gb.

Now some operations you can perform directly on the file foobar.raw (like formatting it), but since I'm trying to do crytpo + lvm, I need to at least pretend that it's a device.  losetup lets me associate a device name, in my case /dev/loop0 with a file on my file system.

So...  here's my instruction set to get a file to behave like a file system, and allow you to do all sorts of unholy things to it.

**Most of these commands assume root.  Either prepend sudo to all of these, or just become root via su - or your favorite procedure to get god mode.

1.  Create a raw file.

    # dd if=/dev/zero of=foobar.raw bs=1M count=2048

2.  Losetup, to associate file with a device name.

    # losetup /dev/loop0  ./foobar.raw


3.  Cryptosetup, really really not needed, but hey.. why not. 

3a.  Format the device we just created (loop0) to be cryptsetup device.
cryptsetup -y --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/loop0
 
3b.  Lets open the device, and give the encrypted device a name. 
 
 cryptsetup luksOpen /dev/loop0 cryptoLoop    ## 
 
4.  Now that we have an encryption layer.. lets's create an LVM, which allows me to 
extend the size of my file system or join multiple files...and all sorts of craziness/flexibility.

Most of these steps are your standard LVM setup, but we'll note them here for consitency.

pvcreate /dev/mapper/cryptoLoop
vgcreate cryptoLvmGrp
lvcreate -l100%VG -n lvmData cryptoLvmGrp

now, in theory you can format the lvm.

mkfs -t ext3 /dev/cryptoLvmGrp/lvmData
mount /dev/cryptoLvmGrp/lvmData loopback

standard usage rules apply, permissions and such.  Once you're done
using it, you need to shut down all the layers in order.

Shutdown:
1.  umount loopback
2.  vgchange -a n 
3.  crypsetup luksClose cryptoLoop
4.  losetup -d /dev/loop0 


So, in retrospect. I can probably just create an xfs/ext file system and expand the file system as needed... but meh.. I kinda like this elaborate setup.

I'm going post some scripts to automate the creation, loading, and unloading of these systems, though some of the paths for LVM and cryptsetup depends on the distro.

Edit:  https://github.com/safaci2000/RawCryptoLVM  Some really dumb scripts that work for me.  

Tuesday, February 22, 2011

Gentoo is Amazing!!

This is a flame post on Gentoo.  I found it funny mainly because I used Gentoo for the greater
part of Linux experience.  I really think it's an amazing distribution.  That being said.. enjoy the laughs.

http://funroll-loops.info/

Monday, February 21, 2011

HP Mini 210–1076NR + Ubuntu Netbook 10.10

I had a hell of a time getting the broadband working.  This particular devices comes with
Gobi 2000 and I had to do a lot of silly playing around to get it up and running.  It is odd
that the live CD out of the box supports it, but the final installed version didn't.

If you plan doing an install, I would try to be somewhere you can get a Ethernet cable to
plugin so you can get all these updates and get things squared away.

1. if it's not installed already, (apt-get install gobi-loader) get the firmware from the windows partition.
There should be a folder named Qualcomm in your standard Program Files folder.  Which contains the various firmware.  This document explains which folder to get:.  You need to grab the content of the appropriate folder
and copy it to /lib/firmware/gobi

reboot and everything worked fine for me.  If that fails, you may have to load it manually.
    gobi_loader /dev/ttyUSB0 /lib/firmware/gobi

fyi.  If you have the wrong firmware (at least in my case) it just hanged there indefinitely, while when I had the right firmware it worked almost instantly.

Wireless didn't work for me out of the box, but that's the typical broadcomm being "special" thing.  If you do the usual updates it started working for me again due to penguin magic from the ubuntu repos.   I'm sure there's about 800 sources of how to get this working, so I won't go into it.  If you have trouble.. post a comment, and I'll update the article.

Wednesday, January 26, 2011

Conversion to Linux Test Case.

Part 0 -- Intro

So, a friend of mine inquired about the joys of Linux, and had a genuine curiosity about the operating system.  I gave up trying to push Linux on people in general.  I find it cause me more headaches then its worth, and if people don't want to learn, no matter how amazing and awesome I think Linux and penguins are it still involves people using something different.  I tend to find that the general population, no matter their intellect and abilities are petrified of change.

Part 1 -- Poor Guinea Pig.

My friend is an art student, with an aptitude for computers and technology.  She won't be pulling up the terminal and starting some gcc, and patching the kernel, but she's capable of basic common sense and critical thinking.  She's worked in a computer lab before.... so I'd call her a power win user? somewhere along those lines.

She loves her shiny android, and nook, and just recently discovered that they're Linux based and still marvels at all the tidbits of Linux hidden away in various technologies.

I personally have been using Linux for so long, that I've lost touch with what's easy and isn't, so I thought she'd be a good use case.

Part 2 -- Target machine 

She just recently purchase a Netbook from verizon, with Windows 7 start edition.

Windows 7 Starter issues:
1.  limited to 3 concurrent process at a time.
2. Can't change the wallpaper.

Requirements:
Office of some form.  (OpenOffice/google docs worked)
IPod (Banshee /Rhythmbox seemed to work )

I had her look at Linux Mint, Ubuntu Netbook edition, and Fedora...and she liked the Unitiy look.

I tried walking her through an install, and that failed miserably once the idea of partitioning, mount points and all that came up, so instead decided to do it in person.

Netbook:  HP Mini 210–1076NR

Live CD issues.  Wireless didn't work.   Possible mouse issues.

I partitioned the machine proper using gparted and set it up to dual boot windows 7 and Ubuntu.  I went through the install process, everything seemed to work fine once it was done with a few exceptions.

Wireless was still broken, but that's okay.  We had the Verizon broadband, went online.. had to do some manual tasks to get the firmware download and get the silly wifi working.  First time using unity, so it didn't click right away, but the mouse won't right click.  (xorg/touchpad config probably).

I got her wifi updated, then had her do the updates she was prompted for.  The updates broke her Verizon broadband.and I tracked it down to a bug:

** That's a big no-no.  Ubuntu is supposed to be super user friendly... once you make a release, you can't break drivers by doing an update.  Especially when the fix is patch the kernel and recompile... or go manually find the firmware for your card.

This worked out of the box... it should not be this difficult for an end user to get things fixed.  If the target audience is ease of use, intricate command line tools, patching code, reloading kernel module.. is not a proper way of handling things.

3.  Final thoughts.. so far.

So, I seemed more annoyed with Ubuntu behavior then she was.  She seems very happy with speed/performance over windows 7.

Enjoys all the random apps that free and available to use.  I have to fix her mouse still, but aside from Verizon and a bit of rocky start everything else works, but it involved more techie experience then it should have.

Many of these things should just work out of the box.


PS.  I need to track down the exact bug number, I'll link it in an update.


Friday, December 24, 2010

Flgith to Germany....

So my folks moved out to Germany, and I decided to visit for the holidays.  I figure its a good excuse to visit Europe, since I haven't really been there since I was much smaller, and couldn't really appreciate it.  That ... I *usually* really like traveling.  I love flying, and its a free roller coaster ride when getting from A-B.  (ie go to six flags..but when you get off your in a difference continent). 

So, taking other friends advice, I showed up at the airport stupidly early, just in case the security lines are super long and feel like doing a cavity search.  My plane was at 4:50 pm, and I got there around 1.  I fly through the security checks...and I got plenty of time to kill using my pretty shiny nook.  I turns out the flight was delayed leaving Germany, so we won't be leaving until close to 6 pm. 

Meh, that's annoying, but not the end of the world.  I find my seat, we get fed some okay-ish food for Airplane food, and are provided with a wide array of movies to keep you busy.  No drugs was sadly provided to enable you to sleep in those coach seats. 

7 hours later we arrive at Drusseldorf.  By arrive, I mean we've flying over.  The airport is closed.  So after flying to Drusseldorf, we are rerouted to Frankfurt Airport. 

We are told the trains are still functional, so we can get to Drusseldorf via rails.  Well.... alright...grrrr  (note I haven't slept yet...coming to close 6-7 am at this point).

Alright.. go find one line to wait for 15 minutes.. oh you have special ticket x,y,z you should go to this other line... which way faster.  uhmm..but...urgh.. fine..whatever...

Go search for the proper line again....processed my boarding pass, and was provided a ticket to a train from Frankfurt to Drusseldorf.  I ask about the luggage...and I need to go drag it behind me on the train.  On to baggage....

They're unloading our baggage....hmm... I put a pretty little bow on mine... I don't see the bow, ... or the luggage.  Alright, they're unloading miami flight.  I'd like to visit Miami, but pretty sure my bag isn't coming from Miami.

Take a quick look at all the other lines unloading bags...nope.. no bag.  Alright.. go to the lost baggage line (of course there's a line).  Well, there's a lady handing out forms for those from Drusseldorf... apparently I'm not the online one.  Amazing...........  Well, one less thing to carry.. that's good... right?  most electronics are on my backpack... so they just my socks, clothes... (woot streaking germany).

Fine.. go ask a few more people.. find those english speakers... oh there's everyone from my plane... sweet.  Go on the train.  choo choo choo choo... oh what? we have to take a connection.. its not a direct train? grrr

Get off at Kolm, find the next train....with a nice windchill factor.  Train is of course late... 20 minutes later... or 30 instead of a 5minute wait...

Get on the last train... that drops you off at Drusseldorf (conviniently there are 3 train station at Drusseldorf in case you needed more confusion). 

I meet my dad the station, take another train to get home since no cars can circulate outside.  I have lost track what time it is now... maybe lunch time?  so..  I would do the math, but my head is too fuzzy atm to comprehend the concept of numbers, timezones, and basic arithmetic. 

Oh yes.. no foreign currency... haven't eater since the plane food dinner the previous day.  Get home... eat anything that's presentable.... sleep...

time zone totally screwed.. so now I'm up at around 9 pm CST, and some ungodly hour locally writing up a blog cause i can't sleep. 

Next time I have the brilliant idea of traveling.... or tell someone I love to travel... do me a favor and just shoot me.. or least tazer me for a less permanent solution. 

Saturday, November 27, 2010

Guns are safe... see it says so right there..

I ran across this on a completely unrelated site....
It got a few laughs out of me.. so I felt obliged to share the love.