Posts Tagged ‘Linux’

Installing XBMC on Oneiric Ocelot 11.10

There are 800 posts consisting of type this crap in terminal and you will have XBMC:

sudo add-apt-repository ppa:team-xbmc

sudo apt-get update

sudo apt-get install xbmc

sudo apt-get update

sudo apt-get upgrade

 

Well sure, that was easy. Except when you try to run apt-get update you will notice a 404 on the sources you have added  that is because the lights are on but no ones home. Simple solution. Open up update manager, open settings, click on other software, and change your distro type from ‘oneiric’ to ‘maverick’

 

So here it is:

sudo add-apt-repository ppa:team-xbmc

Change distro(see above oneiric to maverick)

sudo apt-get update

sudo apt-get install xbmc

sudo apt-get update

sudo apt-get upgrade

 

You should be all set.

Upgrading to Ubuntu 11.04 without a hitch

  • Go ahead and hit: Alt + F2
  • Type: update-manager -d
  • Perform any additional required updates before install
  • Enter your password, agree to upgrade and such

I did all that, then waited for 45 minutes -  now it is say Error: Forbidden 403, WHAT THE HELL?!

It’s terminal time my friends.

  • type: sudo gedit /etc/apt/sources.list
  • click replace in the search menu
  • Replacehttp://us.archive.ubuntu.comwith

    ftp://us.archive.ubuntu.com

  • Restart your upgrade. Don’t worry no time was lost since it kept all the downloads even though it reverted the installation. Ubuntu so smart.

Have fun and remember.
YouTube Preview Image

Fix Your Linux Terminal Line Wrap Issues

I had a strange problem with Putty when connecting to a Linux server that I work on from time to time. Randomly, the command I was in the middle of typing would wrap around on itself on the same line, overwriting what I had already typed. Aside from being generally annoying, it caused plenty of headaches when trying to issue longer commands.

The problem would always when entering long commands, but it would also sometimes cause the text to wrap after only 20 or so characters. I figured something had to be wrong, and sure enough after a bit of reading, I found the culprit.

It seems that at some point I read a tutorial about how to customize the command prompt that offered tips on how to dynamically change the Putty window title as well. That’s all fine and dandy, but the author left out a very important point; How to escape non-printing characters. You see, the problem with my command prompt was that several non-printing characters were being entered on the line as part of the prompt, and the shell could not accurately determine where to wrap the line, when to add a new line, etc.

Here was my existing prompt:

PS1="[\W]\$ \e]2;[\d \t]  [\w]\a"

What this does, according to the author, is create a prompt containing the relative path of the directory I am working in (the \W) surrounded by square brackets, and ending with a “$” sign. The path looks like this:
[www]$ if I happen to be working in a directory named www – simple enough.

The second half of the command (the \e]2;[\d \t] [\w]\a) causes the date and time to be displayed in square brackets ([\d \t]) followed by the full path that I am working on ([\w]). The “\e]2;” and the “\a” are just commands that specify the fact that I wanted to change the window title rather than the command prompt.

The problem arises because even though the commands to change the window prompt are considered non-printing characters, the server would “display” them anyways, taking up room on my command line without my knowledge. The simple fix is to surround the second portion of my prompt command with a pair of brackets used for specifying non-printing characters. They are “\[" and "\]“, used to denote the beginning and end of the non-printing characters, respectively.

So, my new command looks like so:

PS1="[\W]\$ \[\e]2;[\d \t]  [\w]\a\]"

Pretty subtle change, but it makes a world of difference.

So, if you are seeing some weird behavior when connected to a Linux box with Putty or any terminal client for that matter, take a closer look at your command prompt. Added tweaks such as the window title changes I made along with any sort of color changes you might have made to your prompt are likely the culprit.

Follow Geek Republic
Categories