Shortening the Linux Prompt in Ubuntu


I’ve been using my iPhone to do things on my desktop PC at home recently, mostly with the intent of actually being able to do web design/coding while on the run via my iphone.

One problem I’ve been running into is the default command prompt contains the current directory, as well as username by default on the Ubuntu distribution. While ordinarily this works just fine when you’ve got a nice big desktop monitor, on the iphone it takes up valuable screen space and tends to cause lines to double up unnecessarily when you’re deep in some subfolders.

So I decided I wanted to shorten it to a simple dollar sign ($), instead of the normal daniel@mdpatrick-desktop:/etc/sv/git-daemon$. (Mouthful, isn’t it?)

There’s two ways to go about this. The “normal” way is to just edit your local .bashrc file. You can do this by typing vi ~/.bashrc (or if you’re not sure what vi is use nano .bashrc). You’ll want to add something along the lines of PS1=’$ ‘ to the end of this file.

Square Up Merchant Services: Freelancers Rejoice


Yesterday I was sitting at Republic Coffee with Rhonda and David Sandy. We were enjoying each others quiet presence when I realized I recognized someone that walked past for the second or third time in a row.

Deja Vu: A Glitch in the Republic Coffee Matrix?

I mentioned it to Rhonda, and she said she thought she may have saw some people out of the corner of her eye that she recognized as well.

A Treat! MidSouth Makers!

At this point I ran a mental checklist and I realized that it was the time of week that the MidSouth Makers (our local hackerspace) meets! Joy of joys! While I’ve had the opportunity to meet with some of the guys over a lunch, and had a few other interesting social connections to the group (small town) I hadn’t yet made it to an official meeting.

As luck would have it, despite being in Republic Coffee at the same time as me, I’d already missed most of the meeting already — drat! However, with the mere 10 minutes I did get to interact with the group I saw Daniel Hess (@dan9186) passing around an iphone with a funny looking square thing on it. Apparently this little device, called a “Square” is actually to charge credit cards on the spot using an iphone! awesome? awesome.

Square Merchant Services

SquareUp on an iPhone

Squareup.com: How It Works

So apparently the way it works is this: So long as you have the square you can accept card payments with no contract or monthly fees. You just plug the free card reader into your mobile device and start swiping. If you *swipe* the card the fee is 2.75% of the transaction + $0.15. If you hand-key the card the cost for using the service is 3.5% of the transaction + $0.15.

Square is available for the following devices: iPhone, iPod touch (2G+), iPad, Nexus One, Motorola Droid, Motorola Droid X, HTC Droid Incredible, HTC Evo, HTC Hero, HTC Desire, Samsung Galaxy S series, and the LG Ally.

Squareup.com service is only available within the United States. If you’re interested in learning more go ahead and read their frequently asked questions.

Editing Websites with SSH and an iPhone


Now that I’ve got a smartphone I’d like to actually be able to use it to edit websites. I’ve gotten to where I can SSH my main machine (which is running Ubuntu) at home as well as my webhost’s servers to edit my websites. Access to SSH is ubiquitous among most webhost providers’ servers.

iSSH for the iPhone Rules: It Has Alt, Ctrl, Del, and Arrow Keys (Important!)

I’ve got a cool SSH client on my iphone called iSSH — only a few bucks — that will also connect up to my desktop if I want to do something that requires a little more than the bash commandline. (Which, by the way, you can check what shell you’re using at any time by typing echo $bash).

Though, to be honest, using vnc for a view of the desktop tends to be slow and barebones. It’s way faster if I can get a good grasp of doing the things I need to do from the actual commandline since it boils down to only transmitting text. iSSH has the benefit of supporting important characters like the alt key, among other things, which is very useful for certain unix commandline — particularly the text editors, which are primarily used for direct editing of files such as css stylesheets, pdf, html, etc.

Logging Into a Linux Box with Dynamic DNS

My home IP address changes occasionally — though, not often. To make it so I could consistently find my home “box” I signed up for a DynDNS.org address which will allow you to login with yourownaddress.dyndns.org, which an app on your box can update automatically periodically ensuring that if your IP address changes you’re still available through the DynDNS address.

File & Directory Lists: Assessing Folder Size, Listing Files

Recently, when logging into my PC I realized I needed to liberate some space on my dropbox. I had to determine which folders. Ordinarily to list files I use this command: ls -alhF. This shows most of the information you’d ordinarily need, and includes options to make folders stand-out (-F), show normal file sizes (-h), show hidden files beginning with a . such as .htaccess (-a), and -L for longer listing.

However, even this well adapted version of ls I find that when working with the commandline in the unusual circumstance that I need to liberate space rapidly from a dropbox folder with many sub-folders, for example, ls does not show the file size of folders *beneath the current folder*, but instead only of the immediate files within the current directory. In order to see the space amount of space all of the directories take up counting all sub-folders and files it is necessary to use the following: du -h -c .

In this case, the . in du -h -c represents the current directory.

Commandline Text Editors: Vi, Vim, Nano

Though, I’ve been told by friends I really should learn vi or vim if I want to speed things up, I mostly just use nano. I’ll have to memorize some of the whiz-bang tricks for using vi to make it worth the switch. (See the vi cheatsheat) For the time being, however, nano is very intuitive, with it’s on-screen directions for basic commands. Vim, by the way, is just a sort of improved version of vi. For the most part the fundamentals are the same with either one.

Git is Awesome

One cool thing about using an iphone and SSH to edit pages, is almost every webhost, as well as my desktop PC has git on it. Which means that even as I edit the web page, whether I’m logged into my desktop or another server I can keep track of my changes, and if I make an accident which I may be a little more prone to use typing on the iphone’s capacitative screen, I can always roll back safely to the previous version.

This is really important because it eliminates the possibility of disaster and really makes doing editing from a smartphone a more viable option.

Other useful links: