Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Tuesday, August 4, 2009

Blank screen when installing Ubuntu


Several co-workers and I run encrypted Ubuntu Desktop on our work laptops. Specifically I have an HP Compaq 6710b and they have all had monitor issues when installing Ubuntu. If you run the default "Install Ubuntu" option, the next screen will just be a blank screen. I need to get this documented because I always forget how to fix it.

While at the Ubuntu Splash screen do the following:

  • Press the F1 key for "Help"
  • Press the F6 key for "Special boot parameters for special machines"
There you will see an option in the middle described as:
Laptops with screen display problems vga=771. We need to append this to the Boot Options.
  • Press the ESC key to get back to the Splash page
  • Press F6 for "Other Options" and then Press ESC
Now the Boot Options should be visible. It should look something like this:

Boot Options file=/cdrom/preseed/ubuntu.see initrd=/install/initrd.gz quiest --

Delete the trailing -- and add in vga=771. You should have the following:

Boot Options file=/cdrom/preseed/ubuntu.see initrd=/install/initrd.gz quiest vga-771

Press the enter key and you should now be able to successfully install Ubuntu.

Thursday, July 23, 2009

Linux config files available on github

I pushed several of my common linux config files that I often find myself sharing with others via email to github. I'd say it's currently specific to Java developers that are using maven2. I lean heavily on alias's defined in my .bashrc file which lives under my home directory. Hopefully others will fork this project and I can merge forked changes back into my project.

Not only did I want to provide an easy way to share among co-workers, but I also wanted to be able to port to other machines or even when I need to rebuild my work laptop. Also, I just want to get more comfortable with a DVCS workflow. Thanks to Ron Alleva's post (Using Git and Subversion in 5 Easy Steps) about getting setup with using git as the client to svn, I am all set at work to start using git.

Please check it out at https://github.com/jlorenzen/linux-config-files/tree

git clone git://github.com/jlorenzen/linux-config-files.git

Currently it includes:

  1. .bashrc - Contains my alias's
  2. .synergy.config - Config file I stole from Joe Kueser which lets me control a windows machine with the keyboard and mouse connected to my linux laptop (see synergy).
  3. .vimrc - Simple vim settings. Nothing special yet
  4. idea.sh - Simple IntelliJ Idea startup script for linux
  5. idea.vmoptions - Modified vmoptions for IntelliJ Idea
  6. start-hudson.sh - Example of a generic linux startup script
  7. stop-hudson.sh - Example of a generic linux stop script
For those looking to create a github account (and for my future reference) I struggled on how to sync up my local master with the master on github. Thankfully history was around to remind me.

git push origin master

This was after I did the one step (I think) to add the origin:

git remote add origin git@github.com:jlorenzen/linux-config-files.git

Wednesday, July 22, 2009

Minor issue with Ubuntu Desktop

Linux and Ubuntu are awesome. I switched from developing on Windows XP to Ubuntu Desktop in late 2007 (7.04 or Feisty Fawn). I will never again develop on an windows machine. Hopefully I won't ever work for a company that requires a windows platform, but at that point I would rather buy my own work computer or setup Ubuntu in a virtual instance. I really appreciate Rob Madole and Brian O'Neill for showing my the right path. I remember Brian's frustration anytime he was forced to pair with me on my windows machine. Now I am like that with my co-workers.

Even though Ubuntu is great, I still have one minor compliant. Well it's really 3 things combined: Extended Monitor support, Compiz, and Gnome-Do. I am addicted to all 3, but trying to get all 3 to work together seems impossible.

Extended Monitor Support
The big problem here is going back and forth between work and home. At work I want to use my monitor, but at home I use just the laptop monitor. In the past I ran nvidia-settings when I wanted go back and forth. This has been improved with some help from Ron Alleva by using the xrandr command. He gave me some alias's to run when I wanted to switch. When I first installed 8.10, I used those alias's, but it seems lately its being auto-detected because when I plug my monitor in at work, ubuntu recognizes it and I don't have to run anything. Nor do I have to run anything now when I get home. So it would seem I have a good handle on this now, but when using an extended monitor other things don't work.

Compiz
I love compiz mainly for one thing: transparency in my terminal. I'm sure I have set a million other settings before, but enabling the Normal Visual Effects under the System > Preferences > Appearance setting is usually one of the first things I do. I believe this setting uses Compiz. With this setting enabled, my terminal window is transparent enough that I can see other applications in the background, like firefox or pidgin which I typically have behind terminal without having to switch back and forth. Unfortunately, it seems I can't have this setting enabled when I have an extended monitor.

Gnome-Do
Man I love it. I am hoping to eventually get to a point to where I have an entirely clean desktop like this. My favourite is the docky option seen here which is similar to Mac's Spotlight. Gnome-Do works just fine with an extended monitor, but docky requires compiz to be running in Normal mode and if you recall compiz doesn't work for me when using an extra monitor.

This is probably a pretty minor compliant verses all the ones I had against Windows, so I don't expect any new patches coming out of Canonical. In an ideal world, my extra monitor would just be automatically detected, compiz would work, and therefore gnome-do docky would work.

Wednesday, April 16, 2008

Sharing your folders in Ubuntu

Today I needed the ability to modify files on my Linux host machine from my Windows VM instance running in VMWare Server. This was actually pretty easy and once I found this article I was able to get it working in about 5 minutes.

Enjoy

Thursday, November 15, 2007

How to remote into Windows from Linux

You can easily use rdesktop to remote into a Windows machine from Linux. I am using Ubuntu 7.10 and rdesktop works fast and its easy. The default resolution is really small so here is my command to start it up specifying a different resolution.

rdesktop -g 1024x800 server

You can also specify the -f option for full screen mode, but beware it's not easy getting out of rdesktop full mode. Use CRTL+ALT+ENT to exit full screen mode.

Sunday, October 21, 2007

Tip for using Grails in Idea

Recently I tried creating my first Grails application using the JetGroovy plugin available in Idea (version 7.0). However, I have Linux (Ubuntu 7.10) and you don't get those nice little icons to start Idea when you install it. Consequently when I tried to create a new Grails project I received the following error:

grails: JAVA_HOME is not defined correctly; can not execute: java

How in the world is that possible I thought to myself? What half decent java programmer doesn't have JAVA_HOME set? Oh but then I remembered my special start script responsible for starting Idea. Idea requires the variable JDK_HOME to be set, but Grails within Idea needs JAVA_HOME. Therefore, here is my new script I use to start Idea 7 which allows me to create new Grails projects. And don't forget Idea 7 on Linux requires JDK 1.6.

sh -c 'export JDK_HOME=/workspace/java/jdk1.6.0_03;export JAVA_HOME=/workspace/java/jdk1.5.0_12;/workspace/java/idea-7361/bin/idea.sh'

Friday, October 19, 2007

Upgrading to latest Ubuntu Gutsy Gibbon (7.10)

Here is the information needed to upgrade Ubuntu from 7.04 to 7.10:
https://help.ubuntu.com/community/GutsyUpgrade

Friday, October 12, 2007

Linux generic start and stop scripts

If you are following my twitter account, you will notice that I recently switched to Ubuntu and will never look back. Sometimes I find myself having to create start and stop scripts for weblogic, glassfish, hudson, etc. All these scripts are generic enough that you just copy and paste and modify some names. But I don't do it frequently enough to have memorized the syntax. Therefore I want to document and explain start and stop scripts that are generic enough they can be used for almost anything.

Next you will see the exact start and stop scripts we use in our Continuous Integration environment to manage hudson.

Start Script - start-hudson.sh
#!/bin/bash
nohup nice java -jar hudson-1.136.war --httpPort=8282 > ./hudson.out 2>&1 &

Stop Script - stop-hudson.sh
#!/bin/bash
kill `ps -ef | grep hudson-1.136.war | grep -v grep | awk '{ print $2 }'`

Start Script explained
nohup nice
I don't claim to be an advanced linux user, so don't expect a master's thesis on this one. Nohup on Wikipedia tells us that nohup "is a unix command that is used to run another command while suppressing the action of the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. It is most often used to run commands in the background and output that would normally go to the terminal goes to the file called nohup.out if it is not redirected". Nice allows you to run a program with a modified scheduling priority with -20 being most important and 20 being less important. I believe the default when using nice without a value is 0.

The '>' command
Takes the output from my java command and places it in the file ./hudson.out.

The '2>&1' command
2> is standard error and &1 is standard output. So combined it says take standard error and put it in standard output, which the previous command said take standard output and put it in ./hudson.out. So together these two commands put standard output and error in ./hudson.out.

The '&' command
When appending it at the end like it is, it means runs this process in the background.

Stop Script explained
Uses the Process Status (ps) command and grep to search for a process that includes the text 'hudson-1.136.war'. Then it uses awk to split out the output from ps to get the Process ID. Once the Process ID is found it passes it to the kill program to stop the daemon (pipes rock!). This method of using kill to stop a process is rather brute force and does have some flaws if you don't use unique text to search (multiple users running hundreds of programs). Most programs, say weblogic, for example should already have a stop script, so obviously prefer those over my example.

So what if you want the startup script to begin at boot time? Well, add a soft link pointing to your startup script (ln -s /home/jlorenzen/bin/start-hudson.sh) in /etc/init.d/. Then use the update-rc.d command to add it at boot time (update-rc.d softlink_name defaults).

Update: Do to this posts popularity, I created a github account and uploaded these scripts so they can be easily shared, referenced, and forked. See http://github.com/jlorenzen/linux-config-files/tree for more information.

Ubuntu JeOS (Just Enough Operating System)

Back in September, Ubuntu announced a new addition to the family called JeOS (Just Enough Operating System). Ubuntu JeOS (pronounced "Juice", no not the Barry Bonds Juice that can be denied as not knowing) , "is an efficient variant of the popular desktop and server operating system, configured specifically for virtual appliances". The article goes on to state, "JeOS Edition has been tuned to take advantage of key performance technologies of the latest virtualisation products from VMware".

Looks really interesting and actually comes at a good time as I have been playing around a lot with VMware, DSL (Damn Small Linux), and Ubuntu Server.

To read the entire announcement go here.

Tuesday, October 9, 2007

Compressing ginormous files

I know most of my fellow linux coworkers already know this trick but since I am fairly new to linux and I know others are I am going to show how one can compress ginormous (quote from the movie "Elf") files.

First run: tar -cf filename.tar /directory/*
Then for best compression run: gzip -9 filename.tar

The to uncompress the file run: tar -xzvf filename.tar.gz

Friday, August 24, 2007

Favorite svn commands

Recently I switched from Windows to Linux, or more specifically Ubuntu 7.0.4. With a couple of minor issues, everything is working great so far. One of the main reasons for changing was to be faster and better at what I do, and I think linux can help me achieve some that.
One common thing I feel makes linux developers faster is knowing commands and not requiring GUIs. GUIs take a long time to load and refresh compared to just opening a file in vi or vim. On windows I loved SmartSVN and would recommend it to anyone; in fact I have had to install it on linux until I have been converted. At the same time I have enjoyed learning the svn commands, which by the way are 100 times easier than cvs commands. Most cvs commands require options to be effective (cvs update -Pd). Not so with svn.

Here is a list of favorite svn commands I have come to love. Also included are recommendations from friends.

  1. svn help . For example svn help update
  2. svn status. List modified or uncommitted files
  3. svn update. Get the latest code and update your modified files
  4. svn commit filename -m "Commit Message". Commit the file. filename is optional
  5. svn diff. Do a diff on locally modified files.
  6. svn diff -r M:N. Performs a diff on the revisions M and N
  7. svn merge -r M:N. Revert back to a previous version
  8. svn log -v. Gives you a verbose log of everything that has happened
  9. svn st | grep "?" | awk '{print $2}' | xargs svn add. Handy command for those who go days without committing and need an easy way to commit uncommitted files.
  10. svn propedit svn:ignore. Tells subversion to ignore certain files or directories.
  11. svn revert filename. Takes the filename out of source control. Handy when commnd #9 adds files you didn't intend to add.
Also there are shortcuts to most of these subcommands. For example svn status is also svn stat or svn st. Just run svn help to get a list of shortcuts.

Finally, don't be disappointed if you are a windows developer. You can use svn in cygwin the same way.