Linux Blog

Mounting Remote shares with SSHFS

Filed under: General Linux,Quick Linux Tutorials — TheLinuxBlog.com at 4:47 pm on Wednesday, August 11, 2010

If you have ssh access to a remote machine and wish to browse the file system SSHFS is a great utility.
It can be easily installed by your favorite package manager, or compiled from scratch. It has been a dear friend of mine for at least a couple of years.

To mount a file system with SSH, it is almost simpler than making an SSH connection:

sshfs [user]@[host]: [mountpoint]

to unmount is just as simple. Either:

fusermount -u [mountpoint]

OR

sudo umount [mountpoint]

Once your remote file system is mounted, you may bask in its glory and take advantage of everything a local file system has to offer although you may notice a slight delay.

If you’re an mplayer user and wish to stream media, you can use the -cache option to give you a little bit of a buffer.

Making ISO’s with dd

Filed under: General Linux — TheLinuxBlog.com at 4:59 pm on Monday, July 26, 2010

Creating an ISO Image under Linux from the command line is a really easy process. Fire up your favorite terminal and type the following:

dd if=/dev/cdrom of=<iso image name>

The if is for input file and the of for output file. There are lots of options for dd so check out the man page.

To mount the newly created image (as root) you can mount it as a normal device with the -o loop option:

mount -o loop <iso image name> /mnt/<dest dir>

Things I can do before Windows Boots

Filed under: General Linux — TheLinuxBlog.com at 8:38 am on Monday, June 28, 2010

I guess I’m one of the lucky ones that gets to use Linux at work. The kicker is, I need Windows to do part of my work so I have two machines. After a recent power outage, I needed to boot both machines this morning. So, I thought I’d document what I did before Windows booted.

  1. Turned both machines on
  2. Cleaned 3 coffee mugs and came back
  3. Talked to my boss about the power outage
  4. Logged into my Linux machine
  5. Started all the software I thought I might need for the day (Pidgin, Thunderbird, Firefox, Eclipse, Tilda and screen)
  6. Checked my e-mail
  7. Approved some comments on this blog
  8. Wrote this blog post.

On that note, my Windows machine is about booted and I can load up the Word documents that were inconveniently sent to me in .docx format. What a Monday Morning.

Excuses, QLandkarte, BOFH and Devscripts

Filed under: General Linux — Owen at 8:32 pm on Monday, April 12, 2010

After not writing for a little while (I call it writers block, you can call it lazy) I decided to do what any Linux Geek would do. I searched two different distributions software repositories for excuses. Fedora and Debian had quite different but interesting outputs.

Fedora’s came up with QLandkarte GT which is a GPS tool that replaces .

QLandkarte GT is the ultimate outdoor aficionado’s tool for GPS maps in GeoTiff format as well as Garmin’s img vector map format. Additional it is the PC side frontend to QLandkarte M, a moving map application for mobile devices. And it fills the gap Garmin leaves in refusing to support Linux. QLandkarte GT is the proof that writing portable applications for Unix, Windows and OSX is feasible with a minimum of overhead. No excuses!

Debian on the other hand came up with two results one more entertaining than the other, but both useful. The first being a package called devscripts that are

scripts to make the life of a Debian Package maintainer easier

The second package is what I can describe as an awesome find for excuses “fortunes-bofh-excuses”. If you like BOFH or fortunes and have a twisted sense of humour I’m sure you’ll love this package.

If you get a chance and run a different distribution, I’d love to see the packages that come up for it. I was really trying to find something that would help me get a little more organized, or add a little more confusion to my workday. Mission Successful, feel free to flame.

Multi Tail – Multi Tail!

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 6:28 pm on Wednesday, March 10, 2010

Multitail Gnome Terminal

A few weeks ago a new version of RSSTail came out. After reading the RSSTail page I found out that you can use RSSTail as a plugin to a fantastic application called multitaill. That is when I realized that multitail is actually written by the same person.

If you rely on tail, or have ever used tail you’ll probably enjoy this one. As the name implies it is a pager like tail except that it supports for more than one stream. Now, I know some of you have probably used some wizardry do get your favorite pager to show multiple streams, either in the same output or by using screen / splitvt but multitail really simplifies the process. It has all kinds of settings (such as color) and allows you to manage your tail’d files on the fly and even save the current view for later use. It does have a little bit of a learning curve but I think it is well worth it, especially if one of your hobbies includes log watching.

Remove lines that are in another file

Filed under: Shell Script Sundays — TheLinuxBlog.com at 6:52 pm on Sunday, February 7, 2010

Remove lines from a file that exist in another fileI had an issue this week where I needed to remove lines from one file if they existed in another file. Looking back it was frustrating as such a task should be simple.

I tried all sorts of things. Differencing the two files and using grep to grab the lines I wanted. Whatever I tried just did not produce the expected results. Thanks to a buddy I found the solution which ended up being to sort the two files before using diff.

Example:
Assuming two files exist, File_1 and File_2. File_1 containing lines with a, b, c and. File_2 containing b and d. If we want to remove b and d from File_1 because they exist in File_2 you could use something like the this:

owen@linuxblog:~$ cat File_1.txt
a
b
c
d
owen@linuxblog:~$ cat File_2.txt
b
d

owen@linuxblog:~$ diff File_1.txt File_2.txt | grep \< | cut -d \  -f 2
a
c

That’s all fine and dandy until File_2.txt contains the same lines in a different order. Running the same command produces different results. See Below:

owen@linuxblog:~$ cat File_2.txt
d
b

owen@linuxblog:~$ diff File_1.txt File_2.txt | grep \< | cut -d \  -f 2
a
b
c

The solution as noted above is to use sort before hand and then difference them:

owen@linuxblog:~$ sort File_1.txt >> File_1-sorted; sort File_2.txt >> File_2-sorted;
owen@linuxblog:~$ diff File_1-sorted File_2-sorted | grep \< | cut -d \  -f 2
a
c

Obviously the example has been simplified, when dealing with thousands of lines the sort could take a while. With that said I’m sure there are more efficient ways to achieve the same results. I wouldn’t doubt there being a command better suited to do this. Have at it in the comments.

Ubuntu Unleashed 2010 Edition Review

Filed under: General Linux — TheLinuxBlog.com at 11:36 am on Monday, January 25, 2010

Irritated with my Desktop after an upgrade gone bad and an incident with the nvidia noveau driver that left me x less, I decided it was time to re-install. I turned to my bookshelf to find Ubuntu Unleashed 2010 Edition. Normally by the time a book hits my shelf the material is outdated, not necessarily useless, just not the most up to date. This is an exception. The Ubuntu Unleashed 2010 Edition was updated with an Ubuntu 9.10 DVD and a “Free Upgrade to Ubuntu 10.04″ which I found out that if you buy the book before the end of 2010 you can get an upgrade kit in the mail.

So, I pop the DVD in the drive and start the installation. Nothing new here for anyone that has installed Linux or Ubuntu recently; for those that haven’t, it was a pleasant surprise to see that it actually detected my high resolution monitor and used it to its advantage. It really is strange to not have to squint at an installer. The first chapter covers the step by step installation in more detail which is relatively short and easy to follow. Most people should not need to read this if they are familiar with installing an operating system but it I think it is good to have it there. Just don’t let this first chapter prevent you from looking further into this book. After putting the DVD in and getting it started, I found myself reading the book through the entire installation; which for some reason got from 0-90% quickly, then took the majority of the time in the 90% range, but I’m not complaining.

The Authors really did a good job of writing in an understandable language and organizing the book in a logical format. I’ve found myself flipping through and finding many golden nuggets of information. I personally would not have picked this book up because of the title, since I’m not a big Ubuntu user. But Ubuntu Unleashed 2010 edition is packed full of information, 32 chapters and a hefty appendix to be exact. It is not all Ubuntu – specific either, meaning most of the content should work on just about distribution. This book would not be rendered useless if you don’t decide to go the Ubuntu route. I recommend taking a look at the contents and buying this book, as I’m sure you’ll be pleasantly surprised at the topics it covers. I think it would be a great book for someone that is interested in Linux in general, it reads well but can also be used as a quick reference. I wish I had a book like this when I was getting started, it would have saved me a whole lot of time and effort. I have set aside some of the more advanced chapters and made a note to read later.

Other reviews I’ve read have said that it has too much terminal use in it, which is something Ubuntu is trying to eliminate. While this may be true, if you want the most out of your Linux distribution, the fact is you will at some point use a terminal. Commands are less likely to change as much as graphical interfaces. Although some things may be slightly outdated I don’t think that this book should be re-written, as it is in the nature of open source and technology to change. If you keep this in mind I don’t think you’ll be disappointed with it.



Goals For The New Year

Filed under: The Linux Blog News — TheLinuxBlog.com at 9:34 pm on Wednesday, January 6, 2010

As the new year has turned, I thought it would be a good time to go back and look at my goals for 2009. To be honest they were pretty modest and I’d pretty much forgotten what they were, despite this fact I still managed to get 4 out of the 6 done. Getting certified never happened, but I feel like I became more qualified, which is all that matters right? Hah. I blame the CD ripping on streaming media services like Pandora, Grooveshark and last.fm which pretty much eliminated my need to rip the CD’s. So all in all I guess it was a productive year.

I’m still working on my technical related goals for this coming year, I don’t really know what to put on the list yet, since I’ve found that goals will change as time goes on. For example, I set up my PBX in November of 09 which was about 11 months after I set the goal that I had forgotten about. Maybe I’ll roll the two I did not accomplish in 2009 over, add a the goals of getting more organized and reducing the amount of equipment I have. Yea, those seem reasonable for now.

Happy new year!

Syncing your Delicious Bookmarks

Filed under: General Linux — TheLinuxBlog.com at 11:24 am on Friday, December 11, 2009

I’ve written about syncing your bookmarks on Linux before.

I’ve been using the method with GMarks and the Google Toolbar plugin for some time and it works just fine. I also have a Delicious account that I use for work, that I like to access and save book marks to from any computer., this is where SimpleDelicious comes into play.

Simple and seamless delicious bookmarks management from your FireFox browser menu. Unlike others it’s aimed to be simple to use and not bloated with invasive and unnecessary features.
features:

-Add and delete delicious tags/bookmarks from the browser menu, as simple as that

And it really it is, it’s a quick install then enter your account information and you’re good to go. I find the sorting on it is a little strange as it organizes by tags rather than folders, but it works. If you remember where you put something or have a good organizing system (unlike my assortment of random tags that seemed like a good idea at the time) you’ll always be able to find what you’re looking for. You can always use the web front end to search and organize your bookmarks if you have to, but this firefox plugin makes syncing and adding to your delicious bookmarks easy!

delicious_thumb

Best iPhone Error Message Ever

Filed under: The Linux Blog News — TheLinuxBlog.com at 11:45 am on Wednesday, December 9, 2009
Best iPhone Error Message Ever

Best iPhone Error Message Ever

Not Linux related at all but I thought it was funny.  So, yea. Ignore the giant DISMISS_ALERT button, that’s an error caused by me being stupid, but I thought the actual message was pretty funny.

After dialing a “special” number that I strategically obfuscated using gimp and then may have failed to upload the correct one. I get an:

“Error performing request, No Error”.

Although interesting, I now need to find some one without a jail broken phone to see if they get the same message just for the lols. Anyway this sort of stuff can be found all over the place, I just think its funny to find it on such a trendy hipster user oriented device.

When not to script it

Filed under: General Linux,Linux Software — TheLinuxBlog.com at 10:37 am on Wednesday, December 2, 2009

I’ve come across a number of programs in the past and thought to myself,

“Why didn’t they script this, it would be so much easier.”

After thinking about it for a while it all makes sense now. It seems that I had the shell script bug, everything must be done in the shell! In reality while the shell is great and all, it is not without its flaws. There are somethings the shell is great at and should be used for, then there others it shouldn’t.

Don’t get me wrong, I like to script as much as the next guy, but sometimes I think people get lost in its simplicity. Some people use it for everything without fail. Perhaps this is because they don’t know otherwise, or maybe because they too have the shell script bug.

There are many reasons to use the shell and I’m not against using it by any means. This is simply a list of when it may not be suitable to whip out the shell and start scripting. If there is any I missed, please add them in the comments and they may eventually make it into a revised post. I’ll do the same if I come up with any more. Onto the list!

Distribution / Portability – Ever try to distribute a script? Well, most of the time its not a problem, but sometimes you’ll get bit in the ass. Not all systems are created equal. Some have missing packages, or something doesn’t work the EXACT same way.

Simplicity – Sometimes bash is elegant. Well, it depends on your definition I guess. Some argue that scripting is simple, where as others that have to support or maintain it will be ready to cut you. I know I’m sharpening my shanks right now for some revenge. Seriously though, choose a language that makes it easy to K.I.S.S (keep it simple, stupid.)

Performance – Lets kick in the after burners. This is one I don’t have much experience in although I should probably look into it. The shell is sort of like a glider, it gets the jobs done, but I wouldn’t want to race it against a jet or anything. If you’re considering scripting, just time the process to make sure it meets your performance needs. Most of the time, if it is for you, you’ll be fine right? I mean you’ve got all of the time in the world and can wait overnight if you have to. I’d rather not, but have been known to wait on a slow script out of laziness.

Maintenance – Nightmare code. Dependency Hell. Some may have seen the t-shirt or heard the phrase,

“Programming is like sex; one mistake, and you’ll support it forever”

Yea scripting this is sort of like that, except you can always abandon and upgrade your scripts :)

Security – Keep it secure, there are many issues with security in shell scripts. We wont get into them now but if you wear a tinfoil hat when using a computer, you may not want to rely on shell scripts to do your top secret stuff.

Next Page »