Linux Noobie: Built-in Link Checker – WGET


wgetAt work, we found that we needed a simple way to spider one of our sites just to get response times. We didn’t need anything too complex but we did need to have the spider run locally. I did some Googling and found a lot of open solutions but there was usually something not exact to our requirements. Then I rediscovered WGET.

What a wonderful tool. I have been using it since the beginning to snatch files off the web but I had no idea that it was able to actually spider a site.  Here’s the command that I started with:

wget --spider --force-html -r http://my-awesome-site.org
  • ‘–spider’ option tells wget not to download anything
  • ‘-r’ option tells wget to recurse the entire site
  • ‘–level=n’ is an option that could be used to limit the recursive depth

One of the best features with this command is that it’s pretty much universal throughout linux installs which is extremely handy for me.

Advertisements

Linux Noobie – IPTables


iptablesI know I’m a muppet, you don’t HAVE to tell me…

(This will just be a quick and dirty touch upon some useful commands to completely FUBAR your IPTables configuration.  I’m NOT kidding.)

Yesterday, I was provided an opportunity to bask in the glory of IPTables, the defacto standard Linux firewall solution.  Our system engineer stood up a RHEL 6 server and then copied over a ton of data from our production CMS so we could do some performance testing.  This CMS has replication jobs that need to be reconfigured but that can only happen while it’s running.  In short, he erected an IPTables force-field for the server until I could reconfig the replication jobs.  We have a system and it’s worked great… until yesterday.  It seems that even System Admins like to take vacations.  So, I was on my own.  

The CMS/Content/Data was copied over successfully and the IPTables configured to prevent OUTPUT on ports (I’m making these up but you will get the point) 5805, 5806, and 80.  I have to get these turned off and the only person to help is Google.  Well, as with many things Google it’s either feast or famine and I was feasting.  There’s tons of great info on IPTables but I found one of my favorite sites, nixCraft, to be very helpful.  Here’s how I solved the problem:

First, I needed to be able to see what I was working with.  This was accomplished by listing out the IPTables configuration:

sudo iptables -L

This provided me with the following:

Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
DROP tcp -- anywhere anywhere tcp dpt:5805
DROP tcp -- anywhere anywhere tcp dpt:5806
DROP tcp -- anywhere anywhere tcp dpt:http

So, I did some digging and found this article on nixCraft which is really good considering books have been written on the subject.  Since I knew that the admin created these entries, I just needed to drop them.  I found that you can reference these entries with line numbers and also limit the listing to specific sections.  Since I want line numbers and only the OUTPUT section, I put in this:

sudo iptables -L OUTPUT --line-numbers

and I got this back:

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
1 DROP tcp -- anywhere anywhere tcp dpt:5805
2 DROP tcp -- anywhere anywhere tcp dpt:5806
3 DROP tcp -- anywhere anywhere tcp dpt:http

Now, to delete them, I used this command:

sudo iptables -D INPUT 1

The listing after this looked like:

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
1 DROP tcp -- anywhere anywhere tcp dpt:5806
2 DROP tcp -- anywhere anywhere tcp dpt:http

Finally, rinse and repeat and then Save the config as follows:

sudo service iptables save

Just to make sure, I restarted IPTables service as such and then views the listing:

sudo service iptables restart

Everything looks the way I left it.  Now to test it.  I used telnet to call out to an external server listing on 5306 and it responded so I know that the firewall is allowing the traffic.

 

Linux Noob : DVDs From Ubuntu to Android


handbrakeA few months back, I bought a bunch of instructional dvds for guitar but I found that with my current household situation, I was constantly battling for control over the TV.  Bubble Guppies and Backyardigans wins everytime.  So, the videos sat unwatched and my sad guitars were played with the same old tunes.

I decided that since I had recently received a Kindle Fire for Father’s day, I could try to rip the DVDs down to manageable size and load them up on the Kindle.  With my primary OS being Ubuntu and my constant experiment to find software that handles the tasks previously left to Windows, I started looking for something that could decode the DVDs with with quality.

I did some searching around and discovered that Handbrake is the defacto standard for doing this within the community.  However, getting it ON my Ubuntu machine turned out to be a bit of a challenge.  That is until I found this post: http://linuxg.net/how-to-install-handbrake-0-9-9-on-ubuntu-13-04-12-10-12-04-via-ppa/

Within 5 mins, I had what I needed, no fuss, no crap.

Thank you, LinuxG.net.  You rock! (and soon, so shall I)  🙂

UPDATE:  The first DVD I ripped came out to about 470 MB.  Perfect for keeping my favorite lessons on the Kindle

Linux Noob: Et tu sudo?


Cesar-sa_mortI haven’t been here in a while so I’ll quickly sum up.  My work machine got sad and instead of replacing the hard drive, I was gifted a Mac.  Well, the Mac got sad so I made my Linux laptop work again.

Currently, I am running Ubuntu 13.  I have been playing around with some other distros but everyone here seems to be pretty happy with Ubuntu.  Personally, I never over-liked it but Mom always said to try new things.

I wish I had been documenting all the wonders to get this thing going but suffice it to say I have been “challenged.”  My latest bout with U13 was with sudo.

I have a rather complex development workstation config going on and so, to make things easier, I have a few environmental variables set, One being the $JAVA_HOME.  This works fine when banging around but I have an application server that I develop against locally that needs to run as root.  So, I kick off the the old sudo command and I get:  java: no can find.

Bah!

I run echo $JAVA_HOME and that works
I run sudo echo $JAVA_HOME and that works… hmm
but I run sudo java and I get the ‘no can find’

So I did a bit of looking about and I found that Ubuntu has some security fix to its sudo.  Though I am hesitant to circumvent this, I had to throw this in to make it work:

alias sudo='sudo env PATH=$PATH'

With that, all is better.  Now I can access java via root, user, and sudo.  weeeeeeeeeeeeee.

Here’s the article where I found this fix: http://stackoverflow.com/questions/257616/sudo-changes-path-why

Image source: http://en.wikipedia.org/wiki/File:Cesar-sa_mort.jpg

Linux Noob: Upgrading From Fedora 14 to Fedora 16


So, today I had enough.  I love linux and all it has to offer but I wanted a shiny bobble to play with, a challenge.  Entertainment.  So, instead of watching another mindless installment of some teenie bopper vampire movie, I decided it was time to hold on to my lugnuts because it was time for an overhaul.

I have been tempted with the prospects of upgrading Fedora 14 but I’ve been way too busy.  Not that today was any different but I felt the spirit move me, so I went for it.

First, I went to  http://fedoraproject.org/wiki/PreUpgrade and follow the instructions for getting PreUpgrade installed:

[muppet@computer ~]#  yum update

[muppet@computer ~]#  yum install preupgrade

[muppet@computer ~]#  preupgrade

I just let this thing run and I have to say I was really amazed at how smoothly the upgrade went.  I kept working away, and about 20 minutes later, it was done.  I rebooted and HOLY COW… shiny bobble.  I had a couple of issues but this could have gone so horrible… but it didn’t.  I tip my hat you you crazy kids at Red Hat.

The two big issues I had were with VirtualBox and Pidgin (using SIPE for communicator).  When I fired up the VBox, it tanked on one of my VMs showing and Exit Message 1. The advanced error showed a NS_ERROR_FAILURE 0x80004005.  Wait a minute… I recognize this error.  It’s the permissions error code I’ve seen in windows… wait… whaaaa?

I did a bit of searching and found a thread on the VirtualBox forums.  A post from “perryg” led to the correct solution (Thank you Perry).

[muppet@computer ~]#   /etc/init.d/vboxdrv setup

…and Virtualbox was fixed!  Sweet!

Next, I had to tackle Pidgin… This was a tough nut to crack.  Everything seemed to be correct but I kept getting this crappy SSL error.  Turns out the answer was pretty simple.  in the advanced config, there is an entry for Server/Port.  I checked on my backup machine and put in the config and it started working.  Wow.  that was cool.

So, the only two issues were resolved within a day.  Upgrading to Fedora 16 was really pretty comfortable for me.  Obviously there are a lot of changes… and several things to my configurations but everything works, even my bootloader.  I’m pretty excited about this but since it’s so new, I may have missed a couple of things.  I’ll keep you posted.

3/7/2012 – UPDATE:  Today did not start off well.  When I sat down at my desk, it took over 5 minutes to boot.  I thought the boot actually hung but it finally came back.  So I did a little poking around in the boot.log file and found this:

failed to start LSB: Bring up/down networking

When I saw this, I knew it was gonna suck fixing it.  So after about 3 hours of looking, I found this forum entry from the redhat.com’s bugzilla forum:

After reading this chain several times, it occurred to me that I might be running both the NetworkManger.service and network.service.  I simply entered this in:

[Muppet:Computer ~]# systemctl disable network.service

…and rebooted.  This seems to have fixed that problem.

It appears that my NVidia driver may not be working correctly.  Strange things are afoot, so I will be researching that tonight as well.  More to come…

3/8/3012 UPDATE:  The Jury is In… The upgrade was a bust! 

Well, today I tried to get Gnome3 working and it was a frustrating endeavour. I just felt like I was spinning my wheels and finally, after I had enough, walked away.  When I came back, I had an idea to get this working.  It’s not perfect… after all… I am a noob.

I created another account (adding to the wheel group), then logged out. I logged into the temp account, renamed my home folder, then created a new folder the same name as my account, then deleted my account.  All of this was to I could preserve my home folder contents.  Next I created another account with the same username and password as before.  After double checking the config, I logged out and then back in and… voilà… Success.

Well, now I have to rebuild my interface so I can be productive again but everything seems to be working.  I am actually logging this post via my VirtualBox VM.

So, the moral of the story is… upgrades suck.  Sorta.  I lost my user configs but not my files or the installation (that would have sucked so much more).  Reconfiguring my desktop is a small price to pay.  Plus, it will give me an opportunity to learn all the new, shiny features.  ohhhhhhhh… shiny baaaaaauble.

Linux Noob: Java in the Browser (Chrome or Firefox) on Fedora 14 64 bit


Ack!  This was not an intuitive endeavor to get Java applets running in Linux but I finally got it done.  Here’s what I did.

Though I used the defaults, my installation for Java seems to be a bit different than one’s I have seen on the web while I was researching this issue.  Here is my path:

/usr/java/jdk1.6.0_24/jre/lib/amd64/

I found an article that closely described the fix (click here).  You need to create a symbolic link that looks something like this:

ln -s /usr/java/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so

,,,AND… this needs to be in the correct folder.  So for my instance (64bit), this symbolic link needed to be created in the following folder:

/usr/lib64/mozilla/plugins

So, to put it all together, it should go something like this:

[root@Dave ~]# cd /usr/lib64/mozilla/plugins
[root@Dave plugins]# ln -s /usr/java/jdk1.6.0_24/jre/lib/amd64/libnpjp2.so
[root@Dave plugins]# ls
libflashplayer.so                      libtotem-gmp-plugin.so
libnpjp2.so                            libtotem-mully-plugin.so
librhythmbox-itms-detection-plugin.so  libtotem-narrowspace-plugin.so
libtotem-cone-plugin.so
[root@Dave plugins]#

I then refreshed my browser and the applets started flowing.

See how easy that was?

😛

Linux Noob: Reaper On Linux


I love Reaper.  It’s been my go-to Digital Audio Workstation software for over two years and it, hand’s down, has the best bang for the buck for audio engineering (IMHO).  So, when I made the move to Linux, I was rather bummed about not being able to use it.  I have yet to see Linux offerings that provide the same level of complexity and support as I have with Reaper. I know that I just waved the flag inviting a flame war, but that’s my opinion.

So, I have created a post on my other site, DigitalRecordingOnline.com detailing the steps.

I can quickly tell you that I used the following to get it going:

  • Wine
  • WineASIO
  • JACKLab’s XenCenter
  • Reaper

If you have been trying to get this working, check out the walk-through and let me know if it worked for you.