Linux Blog

Advanced Bash-Scripting Guide

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:38 pm on Monday, November 24, 2008

Today the Advanced Bash-Scripting guide has been updated: http://www.tldp.org/LDP/abs/html/

Changelog: “Many bugs were fixed. Additionally, there is a great deal of new material. Editing was done for increased consistency. Two new example scripts were added.”

This is not a book that everyone will want to read, but for those wanting to know more about scripting or those with bash scripting knowledge its a must. Its available in a couple of formats for your reading pleasure.

Use VNC through SSH

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 11:33 am on Thursday, November 20, 2008

Here is another quick tutorial;

Some times its nice to tunnel through SSH. Perhaps you have SSH running but the firewall does not allow anything but SSH in. You can tunnel VNC (or any other service) through SSH by doing the following:

On the machine local to you establish an SSH connection to the remote machine with “Local (-L)”  port forwarding. This may seem confusing and often confuses me, where [-p PORT] is optional

 ssh -L 5901:localhost:5900 username@HOST [-p PORT];

Once I have the connection established I can now use vncviewer to connect to my local host with the port specified

vncviewer  localhost:5901

Thats all there is to it, have fun!

sl the BOFH’s revenge for bad typists

Filed under: Linux Software — TheLinuxBlog.com at 9:57 am on Wednesday, November 19, 2008

If you don’t know what BOFH is, then lets try wikipedia. This morning in my feed reader from tips4linux.com was an article that “makes you pay attention.”

Basically, the article software package they were recommending today is sl. I couldn’t resist commenting on this. There are many times that I am stuck over a slow SSH session, all I need is the server admin, or BOFH coming along, installing sl and making my life a pain.

So, I installed it on my desktop. What an excellent piece of software. If you run Fedora its in the yum repos and you should give it a shot. Now, all I have to do is symlink this to other useful binaries that I commonly mistype, don’t have installed and for good operator measures, some that I do.

Its too bad that I couldn’t run this through wall, but I guess I could run it as a cron. I think it should have a config file so that you could work it a bit more. Perhaps as it steams through make the smoke spell a message. Any way, thats my ranting and rambling over for the morning. Now to yum remove.

Whats in your Feed Reader?

Filed under: General Linux — TheLinuxBlog.com at 4:18 pm on Friday, November 14, 2008

Hey, today I’m asking the question as to whats in your feed reader. I mostly ask this question because I’m interested in what other people are reading and writing.  Here is a list and commentary of the Linux and tech related feeds that are in my feed reader. I invite you to add your feed to my list, and perhaps walk away with some feeds that you were not aware of. This is not a comprehensive list, I’ve only added the ones that have been updated recently and those that I have commentary about.

The Linux Blog
URL: http://www.thelinuxblog.com
Feed URL: http://www.thelinuxblog.com/feed
Description:
Well, who doesn’t subscribe to their own blog? I mean I have to have some one reading my blog right? Seriously though, I’d appreciate it if you subscribed to my RSS feed and occasionally left comments!

Freshmeat.net Announcements (Global)
URL: http://www.freshmeat.net
Feed URL: http://feedproxy.google.com/freshmeat/feeds/fm-releases-global
Description:
For those who don’t know about freshmeat:
“Have you been living under your desk?”
This is a decent feed it provides information about software that has been updated. I use it to get notified when there are updates and to find new projects.

Technorati Linux Related
URL: http://www.technorati.com
Feed URL:  http://feeds.technorati.com/search/Linux?authority=a4&language=en
Description:
This is a very basic feed that grabs blog posts from Technorati. I don’t have this one set to notify me because I’d never have time to work. I just check it from time to time and see whats going on.

Linux Journal
URL: http://www.linuxjournal.com
Feed URL:  http://feeds.feedburner.com/linuxjournalcom
Description:
Any one who’s picked up a magazine knows about The Linux Journal, but may know know that they should subscribe to their RSS feed. I like the magazine and their feed is great too. They post a decent amount of news, reviews and informational content so its worth signing up. Hopefully one day they’ll send me some promotional material or something for being so loyal.

Red Hat Magazine
URL: http://www.redhatmagazine.com
Feed URL: http://feeds.feedburner.com/RedHatMagazine
Description:
Red Hat Magazine, what more is there to say? Its a magazine about Red Hat related technologies. They have great content and a great editorial team. They don’t just post on Red Hat topics either so give it a subscription if you want something different.

Free Software Foundation – FSF Blogs
URL: http://www.fsf.org
Feed URL: http://www.fsf.org/blogs/RSS
Description:
FSF enough said right? Well, not exactly. I love the FSF and all they do so I subscribed to their blog. Perhaps I should subscribe to more of their feeds since they do such a good job.

Ubuntu Geek
URL: http://www.ubuntugeek.com
Feed URL: http://www.ubuntugeek.com/feed
Description:
Although I’m not the worlds largest Ubuntu fan (I probably fall in-between, but no where near UbuntuHater) I still like to keep up with whats going on in the Ubuntu world. Since a lot of what applies to one Linux distribution applies to another, this is a good one.

Debian Package of the Day
URL: http://debian.net
Feed URL: http://debaday.debian.net/feed/atom/
Description:
Debian has the most packages available (I think). So I subscribed to their feed thinking, cool a piece of software a day. Cool right? Well sort of. The title of the feed is some what misleading because I do not get a package of the day every day. Perhaps one a week. But still one a week is better than none a week right?

Mark Shuttle Worth
URL: http://www.markshuttleworth.com
Feed URL: http://www.markshuttleworth.com/feed
Description:
Here Be Dragons! Most know as the founder of Ubuntu, but also well accomplished in the cryptography field (read Thawte) First African in space. Always very interesting content. Respect!

Linus’ Blog
URL: http://torvalds-family.blogspot.com/
Feed URL: http://torvalds-family.blogspot.com/feeds/posts/default
Description:
Who has that T-Shirt:
“Linus is My Homeboy?”
Yea, me neither but I do subscribe to his feed just because I can. Although I feel some what voyeuristic since it is some what personal. I think its very intriguing, while others call it stalking.

TECH SOURCE FROM BOHOL
URL: http://www.junauza.com/
Feed URL: http://feeds.feedburner.com/SimplyJun
Description:
I didn’t even know where Bohol was before subscribing to this feed. Subscribing to this feed will give you articles about Linux and other technical topics. But I still don’t know where Bohol is. (just kidding I googled it)

Ian Skerrett
URL: http://eclipse.org | http://ianskerrett.wordpress.com
Feed URL: http://ianskerrett.wordpress.com/feed/
Description:
Follower on Twitter Ian Skerrett is the director of something or other really important with the Eclipse foundation. (Marketing) I read his blog from his Twitter link and decided that it would be a useful feed to add to my reader.

Tips4Linux.com
URL: http://tips4linux.com
Feed URL: http://tips4linux.com/feed/
Description:
Website that lists a bunch of tips for Linux. Some more useful then others, and some if you are an experienced Linux user perhaps will seem like common knowledge. If you want tips and want them in your RSS feed reader, get them here!
Some Other Feeds

Geekologie – Gadgets, Gizmos, and Awesome
URL: http://geekologie.com
Feed URL: http://www.geekologie.com/index.xml
Description:
I’m not sure who pays this guy but its humorous. Borderline safe for work and perhaps the biggest time waster I have in Akregator.

Life Hacker – Excerpts
URL: http://you-better-be.able.to.figure-this-one-out.co.us
Feed URL: http://feeds.gawker.com/lifehacker/excerpts.xml
Description:
Life hacker, hack your life? No not exactly. Tips on how you can improve your life. Topics range from genius to dumb to common knowledge. (such as how to wrap your cords up, which we all know cords are suppose to be plugged in and in a birds nest under your desk) This site is for those like me who want to be more productive and … wait never mind I’m just digging myself a bigger grave. Seriously though Lifehacker does have some good content. Just don’t read the comments.

Engadget
URL: http://engadget.com
Feed URL: http://feeds.engadget.com/weblogsinc/engadget
Description:
Keep up with the latest gadgets that you will never get. Thats pretty much how I view engadget. I like it, but I used to like it more. So I think of it as a legacy feed. Around just because I wouldn’t feel right deleting it.

In Closing
Feel free to suggest feeds to me I’ll more than likely add them. If you are not on the list and just have to be leave a comment. I may have you in my feed reader already. This also is not my whole list. If I had to write a description about every feed do you know how long I’d have been writing this?

Using a custom Tomcat on Fedora

Filed under: Quick Linux Tutorials — TheLinuxBlog.com at 10:22 am on Wednesday, November 12, 2008

So, I hear you need to use Tomcat on Fedora eh? Not happy with the available Tomcat version from the repository? Well my friends you can add a custom Tomcat to Fedora and have it run as a service.

This post is somewhat related to: my Adding a service on Fedora post except this one is more specific to Tomcat. If you’d like more information on adding services to Fedora that is the place to look.

Here is the script that I have been using: (Read on …)

Shell Script Flow Control – my most refered to articles

Filed under: Shell Script Sundays — TheLinuxBlog.com at 2:38 pm on Sunday, November 9, 2008

This week I do not have time to write a full fledged article on shell scripting, so I am going to some flow control and logic articles that I wrote that I read the most.

One script that I continuously refer to is one of the first shell scripting articles I wrote titled “When Photoshop Fails.” The reason I refer to this article is because it describes a couple of looping techniques and a loop that works with spaces in filenames. For those interested but do not want to read the whole thing here is the loop in short:

find * -iname "*" | while read i; do echo "$i"; done

The next article I’m linking to is the one I wrote on loops: http://www.thelinuxblog.com/for-while-and-until-loops-in-bash/ it outlines some of the basic looping techniques. What I fail to mention in this article is that seq can be used to generate sequences of numbers for the [in list] section. The following is how you would create a loop to loop from 1 to 10 echoing out each number:

for i in `seq 1 10`; do echo $i; done;

Select Statements in Bash is exactly what the title implies. How to implement select statements in bash scripting. Also known as switch’s and case’s in other languages many will be familiar with this sort of logic. Even though I do not refer to it as often as some of the other articles I think it is worth of a mention in this list.

Decision making using if statements is something that every shell scripter is bound to come across. While not exactly the most in depth article on bash if then else statements it is a good start for any one wanting to learn more.

I love dialog’s and it just so happens that dialog and xdialog do a great job of making dialogs for your shell scripts. Creating Dialogs with Dialog has some basic uses of dialog. While it is not exactly logic or flow control, it can be used to prompt the user for input or just to pretty things up a little. It just so happens that it has an X front end called xdialog which does a good job too.

This is not all of the articles I refer to, but its the ones I wrote. If any one else has a list of articles they refer to that are bookmarked that I wrote or not I’d be interested to see them. Just paste them in a comment.

APNIC Box – Linux on a Mikrotik 532a, Part 1 – The Device

Filed under: General Linux — davidapnic at 1:04 pm on Wednesday, November 5, 2008

I put this device together for fun sometime around the start of 2007. The ideas that spawned this was using OpenWRT on a Linksys WRT54G access point. A surprisingly powerful and full Linux distro with all kinds of advanced capabilities running on a Linksys wireless router which I’d previously thought to be a reasonably dumb device with computing power more comparable to a calculator than a PC. The project opened my eyes to embedded devices, and I wondered what device base I should start with. To cut a long story short and for reasons that I can’t even remember anymore I came across the Mikrotik Routerboard 532A and decided that I should start with that.

Conception

APNIC Box Image 1

APNIC Box Image 1

Here’s a picture of the device from the outside with some labels, view the full image to see them.

1. Status LEDs. Blue at the bottom left shows it’s on, orange at the top right shows that there’s wifi activity.
2. Ethernet (eth0)
3. Standard Serial Console (57600, 8 N 1)
4. Ethernet (eth1)
5. Ethernet (eth2)

You’ll notice a PicoLCD unit from mini-box.com on top of the device, I’ll dedicate a separate section to that. For the moment, eth0 connects to a switch and my local lan on the 192.168.100.0/24 range. eth1 holds a public IP and is connected to my first ISP via a ADSL2+ modem (I generally get about 14mbit down and 1.5mbit up stable), and eth2 is connected to the same provider via a separate ADSL2+modem (I get about 16mbit down and 1.7mbit here). The ISP does not bond these connections – I wish :-). They are two entirely separate connections to the same ISP. This isn’t for redundancy as realistically unless you use cable which isn’t available in my area, any fault will usually be with BT (the network/telecoms provider) and so using two separate ISPs won’t really add any great redundancy factor. BETHERE (my ISP) are the only UK ISP that I know of to offer the 24mbit down/2.5mbit up service. Anyway, I guess the speed difference over the two lines is down to one connection to the exchange being slightly shorter or maybe cleaner *shrug*

Article first published at: http://www.adamsinfo.com/apnic-box-linux-on-a-mikrotik-532a-part-1/