Archive for the 'Bash' Category

Succumbing to the pressure

My T60p.

[clints@herlo-lap ~]$ history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head
144 svn
144 cd
108 ls
104 ./manage.py
101 ssh
69 su
43 screen
26 vim
25 rm
15 ping

[clints@thor ~]$ history|awk ‘{a[$2]++ } END{for(i in a){print a[i] ” ” i}}’|sort -rn|head
266 git
260 make
71 cd
57 ls
55 vim
55 rt
26 rm
19 bin/send-patch
18 grep
16 bin/validate

I guess I love RCS’.

Cheers,

Herlo

Distro Comparison: openSUSE 10.3 first impressions

I don’t know if I can last an entire week with openSUSE 10.3. I can’t believe I even thought it possible. I am jonesing for Fedora right now, even though any other distro would probably do…

What’s wrong with SUSE you ask? Just about EVERYTHING! I’m not comfortable at all in this rancid environment. It sucks the life right out of you. I hope some SUSE people come running to save me from this turmoil I feel as I currently hate using this distro. Here’s my first impressions: (beware, the list is rather long)

GOOD

The items below are positives and the openSUSE team deserves credit for all of their hard work in these areas.

  • Wireless works (+1)
    • My Intel wireless card from my T60p is recognized and associates with my access points
  • The nautilus-open-terminal package is enabled by default (+2)
    • This is the right-click on desktop –> Terminal option, (something severely lacking in fedora and not easily installed in a kickstart)
    • Having this feature, its very simple to get started with the terminal which is definitely needed for the power user in me
  • Install allowed me to choose not to use their grub (0) [while this is nice, if I had installed their grub, it would have wiped out my fedora grub components]
  • zypper is much improved over the previous rug (10.1) tool (+1)
    • still needs work though
    • easy to add repos compared with fedora
      • packagekit can solve much of the incontinuity in fedora
      • though its nice to have a simple gui to add repos, knowing which repos is still a bit of an exercise in futility.

Positive Score: +4

BAD

Whle there is some good in openSUSE, its apparent to me that there is much to be improved.  As noted below, many more things are in need of improvement, to put it nicely.

  • The install takes much longer than necessary (-3)
    • Still uses ugly YAST text user interface
      • YAST didn’t recognize my video driver, but could have just used the VESA driver for the gui install
    • Asks too many questions about details that could easily be simpler
    • Did not work well with other OSes (GRUB)
      • YAST installer wanted to overwrite my fedora GRUB configuration, shouldn’t Linux play well with each other in this sense?
  • One-click install is more like 10-click (-1)
    • From opensuse.org, you can do what is called a “one-click install”, and about 8-10 clicks later its installed. If its one-click, its should be one (maybe two) clicks total.
  • The initial GNOME config of openSUSE is too Windows-like (-1)
    • If I wanted my Linux desktop to look like Windows, I’d use KDE (or even run Windows)
    • It has only one bar, and at the bottom, not enough room for status apps
    • I had to add workspaces as only one was provided by default, that seems limiting
  • bluez-gnome doesn’t have hidd or any sort of recognition for my bluetooth mouse (or anyone’s bluetooth mouse, for that matter) (-2)
  • The bash prompt is ugly - (0)
    • This one is a personal preference, but its hard to tell when I am the root user and when I am not. As such, I will modify my .bashrc and fix the PS1 value
  • The wireless driver for my T60p is not the new iwl3945, but the ipw3945 proprietary from intel - (-1)
    • The open driver has been out for quite some time
    • Proprietary codecs were not easy to find, nor install (0)
      • Fedora doesn’t make this simple either really.  Yet, when I found them in Fedora they worked first try, gstreamer failed miserably several times in openSUSE
      • an attempt at a codec buddy like tool was made, but doesn’t work…
    • zypper does not inform you of the dependencies needed to install even though it reports how much it will download (-1)
      • I want to know what packages I’ll be installing before I install them

    Negative Score: -9

    Total score for day 1:  -5 OOPS - that’s not good!

    To be honest, I think I’m being very generous in some of the points I’m giving.  OpenSUSE makes it very difficult for my lifestyle so far.  I’m not sure what they can do with 10.3 to make it better, but I’d like to hear comments and suggestions on ways to help.

    I’m sure hoping that day two will be better.  I’m already starting my list and will be testing such things as; video, development, lvm, raid, kvm/xen virtualization and much, much more.  As I continue to suffer through this bluetoothless mouse world openSUSE has created for me.

    Cheers until tomorrow,

    Herlo

    Locate vs Find

    Tonight at the Ubuntu Utah User Group I presented about Locate vs Find.

    The slides are here and written in S5.

    Kevin Kubasik also presented on Desktop Search in Gnome. It was pretty cool as well.

    The presentations went very well and was streamed and recorded by Utah Open Source Foundation.

    POW: bash-completion - Bash Auto Completion in Fedora using yum (and more)

    In an attempt to consistently blog, I am starting a new series here on fedora-tutorials.com. Program of the Week (POW). Hopefully, this will excite and inform all of us about the cool programs available in Fedora. So see you next Wednesday for another program.

    Over the past year or so, I’ve been on the hunt for several things that I find in other Linux distros that I cannot find in Fedora. Its not very common, but on occasion I do run into something that’s not there on Fedora. One of them was the ability to automagically complete many of the command lines for many things.

    One of them, and probably one of the biggest, was the fact that yum did not have tab completion for available packages. Today is my lucky day! While chatting and helping my students with their labs today, one of them mentioned to me that he could tab complete a particular command on his box. I of course inquired, because it interested me, as to the package name. It turns out my bash tab completion dreams were just about to come true! He told me about this amazing package that would let me use tab completions for things like the service command, man and of course, yum.

    I was blown away! So immediately after this discussion, I started searching for this elusive package I’ve never heard of before. Sure enough, as he informed me, bash-completion does exist and does some amazing things. After hunting around a little on google, here’s some of the stuff I found. I’ll also include the links at the bottom of this post.

    as root try this: (note [Tab] means you should hit the tab key)

    # service ht[Tab]

    What you’ll notice is that one of three things happen. If you’ve got the bash-completion package installed already because you’re ahead of the game, it should auto-complete for you. Without bash-completion, this doesn’t happen, but its also possible that since bash already has some completion in place, it might auto complete a directory for you, but that’s definitely not what you want.

    If you’ve not already installed bash-completion, I’d suggest you do it now. On Fedora 7, run the following command:

    # yum install -y bash-completion
    ..snip..
    Installed: bash-completion.noarch 0:20060301-3.fc7
    Complete!

    Now that bash-completion is installed, we need to invoke the tools. Normally, this is not needed, and a reboot/re-login will take care of this as well, but since I wanted to use this right away, I did the following as an unprivileged user:

    $ source /etc/bash_completion

    This doesn’t seem to do much, but its actually quite powerful. The source (or .) will load the environment variables from the /etc/bash_completion script into my current environment. Luckily for us, when we now log into root, /etc/bashrc will accomplish this for us without any intervention. To test that it worked, try running the following command as the same unprivileged user:

    $ unalias[Tab]
    .=     ll=     ls=     vi=     which=

    Note that when I pressed twice, a list of the currently available aliases appeared. Nice ey? Let’s complete this:

    $ unalias w[Tab]

    Now produces:

    $ unalias which

    And completes the string as expected. Now we’re getting somewhere! But why did I really want to explain this?

    Oh yeah! yum

    With bash-completion, yum can now provide us with a list of available packages, similar to the auto completion capability in apt-get or aptitude from Ubuntu or Debian. Say for instance you want to see all of the packages available for install that match what you’re looking for, but don’t want to run yum list or yum search because, in truth, it just takes to long! Now you have an alternative:

    # yum -y install bal[Tab]

    Produces:

    ballbuster.i386  ballz.i386       balsa.i386

    Adding another ‘lb’ to the end of that string (and then the tab key of course) should help us to complete to the package we’d like to install.

    # yum -y install  ballb[Tab]

    Then completes to:

    # yum -y install  ballbuster.i386

    Hitting enter then installs the ballbuster package, and its quite a fun game!

    .. snip ..
    Installed: ballbuster.i386 0:1.0-1.fc6
    Dependency Installed: ClanLib.i386 0:0.8.0-4.fc7
    Complete!

    Of course, there are hundreds of others tab completions available (and there’s a good way to list many of them too, even if its a bit cryptic). Try these on for size:

    Are you a developer?

    $ svn c[Tab]
    cat checkout  ci     cleanup   co     commit    copy    cp
    $ make [Tab]
    all clean dist-clean

    What about a systems administrator?

    # modprobe -r b[Tab]
    battery    bay        blkcipher  bluetooth  bridge     button
    $ man cron[Tab]
    cron     crond    crontab
    $ ssh herlo[Tab]
    herlo-f7   herlo-lap  herlo.org
    $ grep --[Tab][Tab]
     --after-context=  --directories=   --invert-match   --only-matching
     --basic-regexp    --exclude=       --label=         --perl-regexp
    .. snip ..

    To help you wade further through, try out the following two commands:

    • complete -p
    • declare -f

    Be aware that these are advanced components and can really be confusing if you’re not a developer and just want to use the features. The complete command seems to provides some tools to do additional auto-completion. I also think that its nice to be able to extend this functionality to other applications as well.

    As promised, here’s a few links to help your completion introduction. Note: Some of these links provide more than just the simple tab completion: