Getting Your Priorities Straight…

priorities

Source: http://www.linuxhaxor.net/2009/03/29/lh-strip-2-getting-priorities-right/

[del.icio.us] [Digg] [StumbleUpon] [Technorati]
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

A Script That Makes Your Server Post Uptime Info to Twitter

by Tom Duffy

Well, I have been hell bent on finding something USEFUL about Twitter ever since I made my last post.  It’s 3:17 in the morning right now and I’m only up because I’ve been trying to do three things.  First, write a script that would post to Twitter.  This was actually the easy part.  Second, I wanted the message that the script posts to Twitter to be the output of a command on my system.  For now I’m using the uptime command.  Third, schedule this script to run every hour.

I can have my own updates sent to my cell phone through SMS.  So, if more than an hour goes by in which I don’t get a text, I know my server is down and I can get it fixed.  So, what did I do?  Well, I started by writing the following bash script:

#!/bin/bash
# Login information.

USERNAME="my@email.com"

PASSWORD="password"

URL=http://twitter.com/statuses/update.xml
# Post to Twitter.

result=`curl -u $USERNAME:$PASSWORD -d status="here's where I could type whatever I want to post to Twitter" $URL`

So, that’s cool…This script is VERY simple! It just uses cURL to login to Twitter and then post an update. Simple is good. So, now we want to make it so that the update that is posted is the output of the uptime command. To do this, we just need to make some quick changes to our original script. The new script should look like this:
#!/bin/bash

# Login information.
USERNAME="my@email.com"
PASSWORD="password"
URL=http://twitter.com/statuses/update.xml

# set uptime output as a variable
set `uptime`

# Post to Twitter.
result=`curl -u $USERNAME:$PASSWORD -d status="$*" $URL`

So, what we just did was set the output of the command as a variable.  Actually bash views each section of the output as a separate variable.  That is why we have the status=”$*”…which basically tells the script to post every variable in the script to Twitter.  The Twitter update winds up looking just like you ran the uptime command!  Alright…it’s all down hill from here!

Next, we want to schedule this script using cron.  So, I ran the command:

crontab -e

in order to edit my crontab file.  Then I decided I wanted the script to run at 11 minutes after the hour, every hour.  So, the crontab entry will look like this:
11 * * * * /home/tduffy/bin/twitsys >>/home/tduffy/logs/twitsys.log 2>&1

The first part is the time schedule, the second is the script, the third is the log file. I always output cron’d scripts to a log file. It’s just old habit I guess.

Anyways, I hope someone finds this useful.  If you like it, please comment on it.  Or if you have any problems, feel free to comment with your questions.

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , , , , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

Twitter…What the hell?

by Tom Duffy

Why is everyone tweeting about twitter?  What’s the big deal?  Where did the idea come from that NEW technology must be GOOD technology?  I understand social networking sites and social bookmarking sites, but Twitter seems to be so benign in comparison to it’s big cousins.  I can see how using Twitter to feed other social sites can be usefull, but hardly NOBODY is using it for this.  I can also see using Twitter as a means to publish the status of a server.  In fact, I might even write a script that will post my server’s uptime and load to Twitter.  But there hardly seems to be anyone using it for this!

Most of the people who are using Twitter use it for the most ridiculous things.  They take a shower and tweet about it…they eat breakfast and tweet about it…they hate monday so they tweet about it.  I understand the whole “Web 2.0″ trend, but at some point we have to say Web 2.NO!

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

A Very Simple, Very Useful Bash Script

by Tom Duffy

I use Bash scripts all the time.  I love them.  They make using Linux so much more fun!  I have posted some bash script information on this site before, but I wanted to post a simple how to guide for a very simple, yet very useful bash script.

The first thing that I like to do when I’m writing a bash script is write down exactly what I want the script to do.  So in this case, we are going to write a script that does the following:

1. Displays a prompt asking for a user name

2. Reads the user’s input

3. Runs the finger command on the given user name

4. Displays results from the who command on only the given user name

5. Displays results from the ps command on only the given user name

Okay…Next we will need a name for the script.  For the sake of this example, we will call the script “ucheck”.

So next, we will open up a terminal and go to our /home/user/bin directory (which should be in your PATH as well).  Type the following:

touch ucheck

Now we will chmod it to be executable.  Type the following:

chmod ug+x ucheck

Okay, now we can get to writing the actual script.  So open ucheck with your favorite text editor.  I prefer vi, so I would type:

vi ucheck

Now we need to get some standard script stuff written in there, so add the following to the file:

#!/bin/bash

#ucheck - displays information about a given username

#by: (WRITE YOUR NAME HERE)

This is the “shabang”…it is what tells the computer that this script will use bash to execute the commands within it.  Below the shabang is a commented section that gives the script name, a description of the script, and author info.

Now we will need to add the meat of the script:

#!/bin/bash

#ucheck - displays information about a given user name

#by: Tom Duffy
#prompt

read -p "Please enter a user name: " usernm
#finger

finger $usernm
#who

who | grep $usernm
#ps

ps -U $usernm

Okay…so, now we have our script! Save it and try running it. The output of this script isn’t always pretty, but it is almost always useful!

[del.icio.us] [Digg] [StumbleUpon] [Technorati]
  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

5 Ways To Save Money Using The Internet

by Tom Duffy

In these times of economic recession, it is important to save every penny that you can.  The internet, as you all know, contains a vast world of services and products.  A lot of them can save you money!  You probably know about most of the services that I’m going to talk about here, but many people still aren’t taking advantage of them.  So here’s my top 5 money saving internet services:

5. Online DVD Rental

Companies like Netflix have changed the way we can rent movies.  A lot of people are already using Netflix, but the real money saving potential of Netflix is the combination of the Watch It Now feature and canceling any home cable or satellite services that you have.  With more and more movies available on the Netflix Watch it Now site, it is obvious that we can pull our Netflix plan back to the 1 DVD at a time minimum and take full advantage of watching movies on our computer.  I can already hear all of my readers who use Linux groaning.  That is because Linux isn’t supported by Watch it Now which sucks, but it is still a very cool feature for Windows users.  With Watch it Now, you can watch as many movies as you want on your computer with no extra fees.  If you have a supported device, you can even stream the Watch It Now movies directly to your TV!  Some of them are even in HD.

4.  Free TV Shows

By cancelling cable or satellite services, we can save at least $50 per month.  You would be surprised at how many networks allow you to view their shows on their website for free!  CBS, NBC, FOX (no Linux support), A&E, and many more networks have full episodes that are viewable online for free.  There are also sites that have many different networks to watch all in one place such as WWITV.

3.  IP Telephone

Services like Vonage use the internet to make phone calls.  That’s only kind of cool though because they still want you to pay 20 bucks a month for it.  Services like Skype allow users to make internet phone calls from PC to PC for free!  They will also let you make PC to Phone calls for very cheap.  Sign up for Skype!  Get all of your friends and family to sign up too!  Then you can save cell phone minutes by using Skype when you are near your PC.  After a couple of months you will probably notice that you can pull back your minutes on your mobile plan which can save you some cash.

2.  Online Retail and Grocery Coupons

There are a bunch of online coupon sites that are not very good.  If you are patient, you can find some real deals on some of them though.  I’ve had the most success with Wow Coupons which allows you to print coupons right from your computer for use in various retail and grocery stores.  Remember, every penny that you save adds up over time!

1.  Host Your Website At Home

This one isn’t for everyone.  If you have a website that you host through a hosting company, you might be paying anywhere from a few dollars per month up to 40 dollars per month depending on the hosting company and features.  If you have an internet connection with a high upload speed, you should really consider hosting your own site.  It takes some work and some patience, but it feels great knowing that you aren’t forking out any money to that hosting company anymore!  The best part about hosting your own site is that you can get all the features that you need for free!  All you need is a computer that you are willing to set aside as a web server.  For an operating system, you should use Linux because for web servers, it is much better than Windows and it’s free.  I recommend CentOS or Ubuntu Server.  There is a ton of information available on how to setup a web server using Ubuntu or CentOS out there on the web.  Do some research and start your project.  If you don’t have a static IP address you can use a service like DynDNS which lets you host a site without a static IP.

All of these services can really save you some money!  By canning your home cable or satellite service, your home phone service, and pulling back your mobile minutes you can save up to $100 per month…or more depending on what you were paying for them!  With Skype, the key is really to get your friends and family on it.  I hope this list helps you save some money in these tight times.  Good luck to everyone!

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

Death of the Fanboy Mentality…The True Meaning Of Freedom is CHOICES!

by Tom Duffy

I would like to start by saying that I have made a lot of posts in the past that rip on Windows and M$ products.  That being said, my perspective has started to change in regards to this.  I personally prefer Linux and BSD over Windows or OSX (yes, I know that OSX is based on BSD), but that doesn’t make Linux and BSD BETTER.  If you are a reader of my blog then you no doubt understand that I LOVE Linux and that I LOVE freedom.  But what exactly is freedom?  To me, freedom is the ability to make choices.  If nothing were left but Linux, would we truly be free?

I feel very strongly that M$ products serve a very important role in today’s society.  Businesses all over the world would stop working if they suddenly didn’t have Windows.  Graphic designers who depend on Photoshop and Illustrator wouldn’t be able to do their jobs without OSX or Windows.  I know that these apps can run under Wine, but let’s face it, they don’t run very well!

The role that Linux is currently playing is the right role.  A combination of geeks, programmers, scientists, thrifty students, and adventurous folks all get to enjoy Linux.  Do I think that Linux will one day rise above M$ in market share?  Probably not.  But the point is that we have a variety of choices!  This is what freedom is all about.  My drive in the past years has been to tell everyone I know that Linux is better.  Not anymore.  I feel I’m doing the Linux community a disservice by doing that.  My new drive is to tell everyone I know that there are options.  Choices to make.  “Sure, you are using Windows now, but have you checked out Fedora?”  Or the flip side of that, “Well, if you are having so much trouble playing games under Ubuntu, have you tried other distros?  If you’ve tried other distros and you are still unhappy, maybe you should try Windows!”

This new mentality seems fresher to me.  Gone are the days of Linux fanboy.  Let’s be critical thinkers here!  If everyone I know started using Linux, a LOT of them would have trouble and would be very confused.  The fanboy mentality often makes the Linux community seem immature, egotistical, elitist, and annoying.  As Linux users we should merely SUGGEST the option of Linux rather than “Preach the Gospel of Linux”.  So let’s go out there and raise awareness of the choices that we have in this technological society!  Open mindedness is essential to any campaign to raise awareness.  And here’s an idea…Let’s learn everything we can about Windows so that when we come across someone who’s struggling with Linux, we can offer the choice of Windows!

“There is a bar against all information, which is proof against all arguments and which cannot fail to keep a man in everlasting ignorance - that principle is contempt to investigation.”

-Herbert Spencer

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

The Progression of My Linux Usage

By Tom Duffy

The first time I ever used Linux was back in 1999.  It was Slackware 7 with KDE 1.0.  I was immediately hooked.  It felt good to be a part of something new and exciting.  As newer Distributions rolled out I tried a lot of them.  I found myself enjoying the challenge of getting all of my hardware to work properly, compiling drivers, writing scripts to automate tasks, etc.  Time progressed and I found that I had less and less time to spend on the configuration aspect of my OS.  So, I started using Distros like Suse, Fedora, Ubuntu, and Mandriva.  It wasn’t long before I started to feel like I had been wasting my time with all that nonsense of messing with config files and scripting.  I felt as though Linux shouldn’t be a challenge.  It should just “work”.

This continued until around a year ago.  I was fairly happy with my Ubuntu laptop and everything seemed fine.  Until the day arrived that I got a Wacom Tablet and hooked it up.  It worked to a certain degree out of the box.  But some of the main features weren’t working, such as pressure sensitivity, the eraser feature on the pen, and the tracking wasn’t great.  So, I visited an old friend.  The xorg.conf file.  Man…It was like returning home!  I quickly got the tablet working correctly by setting up different input devices in my conf file.  After that, I noticed that my graphics card wasn’t configured correctly either. (even though it “worked”)  So, I hacked away for a few hours and configured it correctly fixing a weird screen resolution issue that I had ignored to the point of completely forgetting about it!

I started digging around in some other config files for things that “worked” but didn’t quite seem configured correctly.  I edited my hosts file to add some security.  I was back!  It felt great.  But something wasn’t quite right.  I realized that at the expense of “ease” I had sacrificed what I had grown to love about Linux: The lack of bloat and high performance speed.  I thought at this point I had two options.  I could go through the kernel and spend a week or two completely cleaning it out, or I could back everything up and install a more base distro and customize it to my liking.

I opted for the latter!  I downloaded the latest Slackware release.  I believe it was Slackware 12.  After the install, I got to work configuring.  Then I remembered someone saying that if you want to take the time to configure, Gentoo is also a great option.  Well, I hadn’t tried Gentoo.  So I scratched my Slackware install and in went Gentoo 2007.  It was a little foreign at first, but I quickly got the hang of it.  Within a week or so, my laptop was screaming fast and ALL of my hardware was working CORRECTLY!

I guess in the end, some Linux users prefer the configurability of Linux.  Others just like a distro that works.  I have a friend that claims that anyone who really learns Linux and uses Linux for a long time will eventually wind up with a nicely configured version of Slackware or Gentoo on their box.  I don’t know if that’s true for everyone, but it turned out to be true for me!  Now I run Gentoo 2008 and it is great!  I realized that I only need to spend time configuring after an install or when I add hardware.  I simply wrote some scripts to help automate the configuration process for when I need to reinstall.

I used to be a big Anti-M$ guy.  I would PREACH about Linux all the time.  I would look down at people who had proprietary Operating Systems.  I don’t know if it is age or what, but I’m starting to see things differently now.  Nobody likes to be told that they are stupid.  Especially based on something that’s on their computer!  I’ve stopped preaching Linux.  It’s NOT for everyone.  It’s not better than Windows for everyone.  It is better than Windows for me.  If I see someone struggling with their computer or complaining about M$ then I will simply MENTION that there are alternatives and if they need help I offer it to them.  About 2 weeks ago I was at a coffee shop and a nice gentleman started a conversation with me about computers.  He started complaining outloud about M$ Office 2008.  He was talking about how he felt trapped into using M$ products and he felt stuck with Windows.  I mentioned Ubuntu to him and gave him a CD.  I told him he could install it under Windows and just try it out before making any decisions.  I warned him that it isn’t the same as Windows and that he might not like it.  Yesterday I saw him at the same coffee shop and he had installed Ubuntu in Dual Boot mode with Windows and he said he was using it for about 80% of his work tasks. It felt good to offer an alternative and see it work for someone.  Had I come off as preachy, he almost certainly would have avoided the possibility that he could install and run Linux!

My point is this.  Most of us rely on our computers on a daily basis.  Some people need Windows, some don’t.  I personally am a Linux user.  I love Linux.  I love the community, I love the software, I just love it all.  My progression from Slackware to Fedora to Ubuntu to Gentoo is relevant because it shows that there’s a different flavor for all of us.  I just need to keep in mind that for some people, that flavor is M$ and that is okay!  I know this article is a little scattered and jumps from one thing to another, but I felt inspired to write about this…so there!  I hope that someone out there enjoys this article and please feel free to comment about your experiences with MENTIONING Linux rather than PREACHING Linux.  Or you could comment about what distros you have used in the past and what you use now!

Tom

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

5 Best Web-Comics on the Net

The web has become a wonderful channel for artists, photographers, journalists, and musicians to share their message with the world.  Being a long time fan of comic strips, I often find myself searching the net for new web-comics to check out.  I have found that a lot of them are horrible.  In fact, almost all of them are not even the least bit amusing.  However, a few great strips have emerged and here is my list of the 5 best web-comics on the internet.

5.  We The Robots

We The Robots

We The Robots is a clever toon from the mind of Chris Harding.  Harding has been an artist and an animator for many years now.  We The Robots almost never fails to make me laugh.

4.  Left Handed Toons

Left Handed Toons

At first, I wasn’t a huge fan of Left Handed Toons (by right handed people).  Over time however, my opinion has changed.  Their zany humor has grown on me.  Whether or not others agree with this selection matters not, because I like it!

3.  Cyanide And Happiness

Cyanide And Happiness

Cyanide and happiness is a daily webcomic that is drawn and written by several different contributors.  Some of the humor is very dark and disturbing, which is nice sometimes!

2.  xkcd

xkcd

This is another one that I didn’t like at first.  It seemed very trendy and I was convinced it was only popular because it makes its readers feel smart.  I now spend a lot more time reading the comic though and I like it more and more.  The art certainly isn’t terrific, but the writing is top notch.  With an emphasis on math, physics and technology, this web-comic has quickly become one of the most popular comics on the net!

1.  Utopia Theory

Utopia Theory

Okay…Utopia Theory.  I absoulutely love this comic.  It is one of the only hand drawn web comics out there.  Created by Tom Duffy and Wes Hill, Utopia Theory is usually single panel comics with a bit of a Gary Larson feel.  The writing is original, the art is great…this is my favorite web-comic!

Well, that’s my list.  If you disagree please feel free to send all email complaints to /dev/null

Thanks!

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

Digg Goes Offline - Noob Tries To Submit a Story About It To Digg!

by Tom Duffy

digg

Today (July 31, 2008) at approximately 11:44am Pacific Time, Digg.com, the popular social bookmarking site temporarily went offline for some server maintainance.  At approximately 11:45am Pacific Time, a Digg user who has been desperate to get a few diggs decided he would blog about the outage and then submit the story to digg.com.  It wasn’t until he had finished his blog and tried to submit the story that he realized that the site needs to be up in order to submit a story.  Better luck next time digg noob!

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags:

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments

How To Become Microsoft-Free in 30 Days

by Tom Duffy

I can’t stand Microsoft.  I really can’t.  That being said, I have personally been Microsoft-Free for well over a year now.  This is truly a wonderful feeling!  I have four different computers that are all completely free from ANY Microsoft products.  I would like to share with you how you can become Microsoft-Free in 30 days or less!

First of all, let me share with you what I run:

Desktop: Intel Core2Quad dual booting Slackware Linux and Fedora 9 (Sulphur)

Laptop 1: Intel Pentium 4 running Xubuntu Hardy Heron

Laptop 2: AMD Athlon running usb boot Slax

Laptop 3: Apple PowerBook running OSX Tiger

It is important to note that just running Linux or OSX doesn’t free you completely from Microsoft.  A lot of Apple users run MS Office and other Microsoft products even though this is totally unnecessary.  So, now let’s talk about how to start freeing yourself from Microsoft.  Let’s take the following example:  A PC user is running Windows XP Professional with the following additional Microsoft products installed:  Microsoft Office 2007, Windows Media Player, and Microsoft Money.  Okay, now the most difficult Microsoft product to free yourself from will be the operating system itself.  So I recommend starting by replacing Office, Media Player, and Money.

In place of Office, you have some options.  My personal preference is OpenOffice which can be downloaded here. Once downloaded and installed, OpenOffice provides a feature-rich replacement for Microsoft Word, Microsoft Excel, Microsoft Powerpoint, and Microsoft Database.  It doesn’t however, replace Outlook.  For Outlook’s replacement, I recommend Mozilla Thunderbird which can be downloaded here.

To replace Windows Media Player, I recommend MPlayer which can be downloaded here. Don’t forget to download codecs from the site as well.  This is what will make it play all of your different media types.

To replace MS Money, I recommend GNUcash which can be downloaded here. GNUcash is a great piece of software that can handle personal and small business finances with a ton of cool features.

Now that we’ve replaced the software installed on your Windows computer with open source alternatives, let’s start the process of replacing Windows itself.  I personally recommend the Linux Distrobution called Ubuntu which can be downloaded here. Once you download the ISO file, go ahead and burn the image to a blank CD.

Okay, now all of the above can be done in a matter of hours.  So why does it take up to 30 days to become truly Microsoft-Free?  Well, it is because of the transitional period that comes with learning a new operating system.  The Ubuntu CD that you just burned can be used in many ways for you.  There are two transitional steps that I recommend before you actually format your drive and completely replace Windows.

The first step is to insert the CD while running Windows.  Ubuntu includes a cool new feature that allows Windows users to install Ubuntu as an application within Windows to try it out.  Go ahead and use the Wubi Installer to install Ubuntu on your Windows partition.  Spend some time using Ubuntu every day.  Get used to the differences.  USE GOOGLE TO GET ANSWERS!  I can’t stress this part enough.  When you transition from Windows to Linux, you are going to hit some walls.  There is a TON of help available out there.  Use google to find it!

After you have gotten used to using Ubuntu within Windows, it is time for the next transitional step.  This step consists of installing Ubuntu onto its own partition and dual booting between Ubuntu and Windows.  The reason that I recommend this is that when you are in the Ubuntu partition and you come across something that you can’t quite figure out, you can always reboot into Windows to take care of it.  This process is annoying though which will eventually lead you to trying harder to solve problems within Ubuntu rather than rebooting into Windows.

Now that you are fully comfortable in Ubuntu and have figured out how to take care of all of your daily tasks, it is time to back up all of your data for a completely clean Ubuntu only Install!  The partitioner within the Ubuntu installer is very straight forward.  Again, if you have problems, use google to get answers.  I also recommend joining the Ubuntu Forums.  There are some absolutely awesome people on there who are ready and willing to answer questions.  Of course, if you have questions, you can always just email me!  Send questions to tom (at) techremedy (dot) net.  I hope this helps at least ONE person become free from the Microsoft stranglehold!

[del.icio.us] [Digg] [StumbleUpon] [Technorati]

Tags: , , ,

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • Twitter
  • RSS
Comments
 Page 1 of 3  1  2  3 »