Saturday, October 10, 2015

Learning Python

Python is one hell of a programming language. The flexibility with if statements, for example, is amazing. There's so many ways to do things.  More than this, but just to demonstrate the flexibility of being able to say:

if (this or that) or (not this and not that) or (that and not this)
    doSomething()
else:
    doSomethingElseEntirely()


.. is just plain liberating, from a programming point of view. To do that in bash, you'd probably have to do something like:

this = "true" 
that = "true" 
if [[ this == true && that == true]]
then
     do_STUFF()
elif
     [[that == true]] && [[this != true]]
else
     do_MORE_STUFF()
fi 

But than again, BASH will evaluate anything and everything as true, and there's also a /bin/true and /bin/false floating around, so that is not the most reliable code.. So we ought to use arithmetical operations:

#!/bin/bash

false=0
true=1

((false)) && echo false
((true)) && echo true
((!false)) && echo not false
((!true)) && echo not true


Python, however, is much more forgiving when it comes to boolean stuff (but not forgiving at all regarding indentation...) It also makes great use of parameter expansion. How many different ways can you calculate leap years? At least two that I know of. (Some kid in my class was asking for help with this one, so here ya go..)

########################
#!/usr/bin/env python  #
# Leap Year Calculator #
########################

# Declaring error messages here is a lot prettier than everywhere
erNocomp = ("Sorry... that doesn't compute!")
mathIsBroken = ("Something is terribly wrong here! Bailing!")

# Python does not seem to understand unset variables outside of functions so #declare them here:
year = ""
##########
# exit cleanly. got sick of programs crashing upon completion
def exit_0():
    while True:
        try:
            x = input("Press Ctrl + c to quit ")
        except KeyboardInterrupt:
                break
                exit(0)  
  
#

print("""
######################
# Is it a leap year? #
######################

"""
)
# Another library we can use to save some code
import calendar
# 1 will always equal 1; 1 will always return true.

# This is the standard way to validate input. Here we're just saying "till the  

# end of time, or until y = an integer, keep asking for input"
 while 1:
    try:

        y = int(input("Please enter a year...: "))
        break
    except ValueError:("That's not a year!")
    print (erNocomp)
    

#
# This is how to calculate leap years manually, because that was the assignment:

# I feel this is pretty straightforward...
#
# def isLEAP(year):
      return (y % 4 == 0 and y % 100 != 0) or (y % 400 == 0)
#
#   if
isLEAP(year):
#       print ("%s is a leapyear." % y)
#   elif not isLEAP(year):
#       print ("Nope")
#
# but its better to trust the calender library that's already meticulously #written.. this is another thing about python that I totally love-- all these #built in functions like isLeap(year) or toRoman(int) to calculate roman numerals

#
# I can pull it off using the math and the library in one if statement,
 

# for the sake of ultimate reliability.
#
######## Note how to combine variables and strings in output:

isOrIs = ("Python or math says %s is a leap year!" % y)
isntAndIsnt = ("Python and math says %s is not a leap year!" % y)
## Prepare for Transdimensional Scenarios
isAndIsnt = ("Python says it's a leapyear, math says not. What universe is this?")
isntAndIs = ("Python says it's not a leapyear, math says it is. What's going on here?")
#########
# Here I'm asking "does the math check out, and does calendar also say it's so?
#

if calendar.isleap(y) or
isLEAP(year):
    print(isOrIs)
    if
calendar.isleap(y) and not isLEAP(year):
        print (isAndIsnt)
    elif not
calendar.isleap(y) and isLEAP(year):
        print (IsntAndIs)
elif not
calendar.isleap(y) and not isLEAP(year):
    print (isntAndIsnt)
else:
    print(mathIsBroken) # just in case the universe ends or whatever
    exit(1)

#
# figured i needed a clean exit func at some point
#
exit_0()

# not a whole lot different than doing
# exit(0)
# just catches the traceback errors


Fun stuff, right? I've decided to post all my python homework scripts on Github, (after the due date, of course!) on the off chance someone learns something from them, but also for own record... Github is very reliable for backing up code and discs tend to fail as per Murphy's law...

That's all for today, folks. BTW does anyone have a CSS script or API for proper python colour coding? That'd be great.

Friday, October 9, 2015

How to Not Have One of *Those* Days

Did you feel a bit groggy after your alarm clock awoke you this morning? Did you roll over and say "Can't do it..", than snooze through 3 ten minute cycles causing you to have to rush out the door? That was how one of my mornings went last week, and the reason that happened is because I forgot to turn on sleep-tracking on my phone before I went to bed. There is this ingenious app called Sleep as Android, in case you have not heard of it, that utilizes your phones accelerometer to track your sleep patterns.

Don't follow? Sleep cycles are directly correlated with movement. Accelerometers are sensors that detect motion, and they're quite sensitive. So, if you put the phone on your mattress when you go to bed, the accelerometer can track movement, hence tracking sleep cycles. I read somewhere that this is almost as accurate as what the doctors use when conducting a sleep study, although I can't confirm that. However, I can confirm that when the app wakes me up, rather than a sleep-cycle naive alarm clock, I feel much more refreshed. I also got used to waking up feeling that way, and it really sucked waking up during deep sleep the other day.

I am groggy all day if I am awoken at the wrong time... This app has enabled me to function while adjusting from getting up at 3 PM to 6:40 AM over the last couple months. It's totally worth a try. It's also interesting to analyse your sleep patters, as the app nicely graphs it all out. You can also record noises to figure out what's waking you up, or detect snoring, etc.

This is the quantum age, and incredible technological advances are also improving quality of life. Smart phones are just computers with lots and lots of sensors, consequently they can be used for obscure purposes. I wonder what my phone will do next year? They used to say the sky is the limit. But we're way past the sky, as the space age started over 50 years ago. There are no more limits. Don't let an old fashioned alarm clock slow you down, try Sleep as Android. No, I was not paid to write this, I just think you ought to know.

Tuesday, September 22, 2015

Don't Mess With the Routers

I've been wondering when this would happen. It would simply make too much sense for the government to not interfere with our wireless routers, along with every other thing in the world. After I heard that they were going to classify 'intrusive' security software as 'weapons' and place 'export' restrictions on them, I knew that this would go one of only two ways:

The first, preferable, and (more) sensible way would be that our government would allow the domestic technological industries & open source community to keep innovating without counterproductive regulations and interference, so long as we don't 'export' any 'intrusive' security software to other nations. I may have even been okay with this to a point, especially considering that we don't want the Chinese, Russians, or whoever to use our own source code against us... Although it's not accurate to say that open source code is ours, or anyone’s, for that matter... it belongs to everyone. But the point is that I can understand that mentality, to a point.

The second possibility was that the government would begin to see open source code in general as a threat to the establishment, and begin to place restrictions on software development, or on the hardware that the software runs on. Well, that's exactly what's happening with wireless-routers right now, and that is really bad news for the people of planet Earth.

Modems, routers, and embedded devices in general are often the most insecure devices existing. They're also usually the weak point of any given network, mainly because many of them run on proprietary, closed-source software that is rarely (if ever!) updated. Millions of routers end up being turned into zombies, utilized by blood-sucking bot-nets and the like, because they are so insecure, and because the OEM's never update the firmware (like, ever...). I've had at least two experiences in which my router was taken over by a rogue piece of malware, and no matter how many times I reflashed the stock ROM, the virus would simply respawn, and the rest of my network would suffer as a result. Do you want to know how I fixed them? I installed OpenWRT on them, and now not only have they ran happily ever after, they're also about twice as fast, and posses roughly 100 times the functionality that they did running the stock TP-LINK & Netgear firmware. (Netgear routers are the worst routers ever, just so you know.)

The FCC claims that open source software like DD-WRT or OpenWRT allows users to do things like adjust their signal strength, or unlock channels that are illegal to use in the United States. They are (somewhat) correct about that. However, I seriously doubt that this has ever been a problem for anyone, anywhere. Everyone knows that if you run your router on channel 14, than some HAM operator will track you down and rat you out. Operating a pirate radio is a federal crime in the USA, and it's very easy to get caught. Obviously, there is another motive here. Could it be that the NSA does not like the fact that anyone with an IQ of 60 or higher can bypass their backdoors that come preinstalled with ~70% of router firmware on the market...? Hmm...

The FCC wants to force manufactures to lock down WiFi routers so that they cannot run firmware that is not signed by the manufactures key, exactly like what has happened to the Android market over the last couple years. And it's bullshit, doing nothing but making it slightly more difficult for developers, enthusiasts, and people wanting to reclaim a little privacy by running a custom ROM to do so. But at least we can still buy a developer phone with an unlocked bootloader!

"...so far, the commission has only told us that “versions of this open source software can be used as long as they do not add the functionality to modify the underlying operating characteristics of the RF [radio frequency] parameters. It depends on the manufacturer to provide us the information at the time of application on how such controls are implemented. We are looking for manufacturers of routers to take more responsibility to ensure that the devices cannot be easily modified.” [1]

Even if that statement turns out to be true, it still would suck because in my experience, tweaking the radio parameters has made my routers run about 200% better, and (guess what...)... I did all that without breaking any laws, or causing any interference to nearby devices. Not to mention that it's not as if DD-WRT suddenly gives you the power to turn your router into an ion cannon or a satellite jammer. WiFi radios operate within the very small, already noisy, but unlicensed 2.4 Ghz range, and cannot be tuned outside of that range with software modifications alone. And 5 Ghz routers are already tightly regulated, because you need a radio license to modify a device that operates in that range as it is now. The reason we have unlicensed radio spectrums is so that hobbyists and ordinary people can utilize them. Thus, the FCC's "concerns" about open source router firmware are totally reta'ded.

Another possible motivation for these restrictions is likely the increasing popularity of MeshNets. These are privately owned & maintained wireless, peer-to-peer networks. The most well known is Hyperboria. Meshnets are simply the product of the people of Earth trying to rebuild the internet:

The stated goal of Hyperboria is “to provide an alternative to the internet with the principles of security, scalability and decentralization at the core.” [2]

It's safe to say that meshnets could be viewed as a threat to the establishment. If they start blacklisting websites and step up the censorship of free speech, privately owned, decentralized networks will be the only thing standing in the way. Without a free, open, uncensored internet, humanity would still be in the dark, technology would never have gotten this advanced, and the governments would still be getting away with whatever the hell they wanted to. Freedom of information must be not infringed upon, in any way, shape, or form. There is so much at risk.

If this law ends up passing, I will never purchase another commercial router again. I will build my own from scratch using something like a Raspberry PI running Debian, a few CAT5 ports, and a couple of Atheros chipsets (I suppose I should buy them now while I still can). The security of every other device on your network depends on the security of your router. All of the traffic that traverses your network goes through the router at some point (unless you're plugged right into the modem), so you better be able to trust the damn thing!

The FCC ought to take a long walk off a short pier. They have not been doing their jobs very well as of late. They are supposed to protect the communications infrastructure, instead of stunting or belittling it. Please visit this site to learn more about this issue. The FCC's side of the story can be found here. And the public comment page, found here, does not work at this time. The deadline for pubic comments has been extended to sometime in November. I hope they fix their page before then.

Sunday, August 30, 2015

Deploying Mass Ubuntu Installations

Recently, I've been working on a project to help my community by improving their technical infrastructure. My main priority with this project is to give the source to the people. To liberate them from the chains of Microsoft, and of closed source, proprietary software in general. The time is right, considering Android (the most popular OS in the world right now) runs on the Linux kernel. I would say that Android has inadvertently nudged the open source subculture into the center stage of tech.

But along with any other type of freedom, you must go out of your way a little to take advantage of it. Free software is not exempt. In other words, there will be a bit of a learning curve, but it will be well worth it. This is why I chose to use Ubuntu as the ambassador, because it's probably the most user friendly distro for people that are used to running Windows. It has a very friendly and large support community on the internet that can be found in forums such as askubuntu.com. It is always on the bleeding edge, receives very frequent updates, and supports the largest amount of hardware, right out the box, than any other Linux distribution I've used.

I met with several different clients to give them a rundown of the operating system and show them what is included by default. For the most part, my clients were pleasantly surprised with Ubuntu, and it seemed to exceed their expectations regarding ease of use, cross platform compatibility, and the secure nature which allows one to never buy antivirus again.

But installing Ubuntu on 100 computers is definitively a redundant, time consuming task. Automating the post installation configuration is very easy with bash, but automating the actual installation itself is not quite so easy. However, there are a few measures that one can take to make it go as quickly & smoothly as possible.

First of all, you're going to want a few copies of installation media. While DVD's are cheap, you may want to use USB discs instead. That way you can take advantage of the a persistence volume, which will save things like your wifi password, username, etc. These are things that you would otherwise have to enter many, many times, so it's worth it. Installations also go much faster when using USB, simply because USB transfers data much faster than optical drives. However, you should make sure that you have a couple of mini net install iso's on hand (these will fit on CD-R's). Sometimes a computer will have a graphics card that does not agree with the standard installation media and will not work. In these cases, you have to use the net installer, and it works 99% of the time.

The other thing you will need is a password generator script and some sticker labels. It would be pretty lazily irresponsible to configure 100 computers with the same password, wouldn't you say? Here's a good one:

#!/bin/bash
# Random password generator. Originally by jbsnake, modified by crouse to use Upper case letters as well.
# Now also does error checking and fails if the input isn't numerical integers or if no input is given at all.
# Modified by Darkerego to save output with description so you can remember what the password is for.
# For obvious security reasons, this is better managed as root.
#if [ "$(id -u)" != "0" ]; then
#   echo "Run it as root." 1>&2
#   exit 1
#fi

if [[ -z "$1" || $1 = *[^0-9]* ]];
  then
   echo " ";
   echo "      ######### COMMAND FAILED ########## ";
   echo "      USAGE: $0 passwordlength";
   echo "      EXAMPLE: $0 10";
   echo "      Creates a random password 10 chars long.";
   echo "      ######### COMMAND FAILED ########## ";echo " ";
   exit
  else
   if [[ "$1" -lt "6" ]]
   then echo "Your password is less than 6 characters in length."
         echo "This is a security risk. Suggested length is 6 characters or longer !"
   fi
   RIGHTNOW=$(date +"%R %x")
   pwdlen=$1
   char=(0 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V X W Y Z)
   max=${#char[*]}
   for i in `seq 1 $pwdlen`
      do
           let "rand=$RANDOM % 62"
      str="${str}${char[$rand]}"
      done
   echo $str ##| tee -a passwords
fi
echo 'Enter a password description'
read pwinfo; echo $RIGHTNOW : $pwinfo : $str >> /root/passwords
echo 'Warning: output saved to passwords file'
exit





Finally, you should choose a desktop environment. I started with Gnome, but half way through decided to do the other half with Unity. I really am not a Unity fan, but it may be easier to understand for new users, and I don't want to throw people off and give them a bad first impression of Linux. First impressions are everything, even in the technological world.

It also helps to have a post installation script. This is the one I have been using. I originally wrote it to configure my VPS servers, and adapted it for desktop systems. There are a lot of security related kernel tweaks and whatnot that really should be turned on by default. That and installing/removing certain software is what this script is for. If I ever have to do this again, I am going to take the time to figure out how to completely automate the installation. I mean all I should have to do is stick a disc in a drive, walk away, and come back to a fully configured, fully installed system.

Monday, August 17, 2015

Building a Badass Tower, Part III : Choosing a Case

Maybe this should be titled Part 2.5, but I don't know how to do a .5 in Roman Numerals (IIi ?). I'd like to highlight a few things I've learned during this project to counter some bad advice I've found lurking around the internet. There's all sorts of silly arguing on those forums, and than you have people writing articles that don't seem to have a clue what they're talking about. Sometimes I am one of those people, admittedly.

First of all, when planning to build a computer, do not cheap out on the case! I've seen a couple articles where the author says "Buy  the cheapest case possible." That's terrible advice, and I'll tell you why. Investing in a good case will allow you to upgrade, add parts, keep your hardware running cool, keep static electricity out, and even completely rebuild the computer one day, reusing that case. I'd even go so far as to recommend that you buy a cool looking case, because that will make you love your computer that much more, and motivate you to keep it functioning well. A little love goes a long way. However, one should find a good balance between aesthetics and functionality when choosing a case.

For example, my tower was originally custom built by a friend and came with a black steel gaming case. This case was not quite as cool looking as this Cooler Master case that I had lying around. The Cooler Master had trippy, quiet 80mm blue LED fans, and a pretty transparent blue acrylic side that allowed you to see all the components in action. It looked badass, but unfortunately it was not even close to a master of coolness due to a lack of fans and a poorly designed air intake. I ended up putting everything back into the original case, because that case has two 120mm front intake fans, a 120 mm side exhaust fan, a 136 mm top exhaust fan, and a 120 mm exhaust fan on the back. In contrast, the Cooler Master only has two 80mm front intake fans (with steel holes for intake that don't draw easily and get clogged easily too), and another 80 mm LED fan on the back. It'd be fine for a system that doesn't produce a lot of heat, but I like to over-clock my machines, so I wanted as much air circulation as possible. This is especially important when you have an Nvidia GPU, because those things freaking cook themselves to death, idling between 60 and 70 degrees Celsius and hitting upwards of 90 when doing these like even watching an HD movie when there are two monitors plugged in! Like, wtf Nvidia? Can't you, idk, maybe use higher quality heat sinks or something?

Keeping things cool isn't the only characteristic to look for in a case. One should also look for a heavy duty, big metal box. The metal encasing acts as a barrier to everything around it, keeping static electricity away from your fragile hardware. There's probably some conspiracy with the computer manufactures to use plastic housing in order to wear the machine out faster so you buy a new one. In retrospect, I've had a few laptops with mostly plastic exteriors, and those are ones that always have something die after 3 or 4 years for no reason, most notable, the LCD display and hard disc. Also, it's great to have a hole to put a padlock through so that you can lock your computer. Remember, anyone with physical access to your machine can reset the bios and bypass many of the security restrictions you may have in place. But, it's a lot harder to get away with when you have  the case locked. Yes, this is something that you should be worried about in this day and age. It also prevents theft and tampering. To summarize, you want a big metal box not a half metal, half plastic, static attracting piece of junk.

Finally, it's a good idea to buy a case that has lots of room to work with on the inside. It's no good having things cramped. It impedes air flow, makes maintenance more of a pain, and puts limitations on the types of upgrades you can perform. For instance, you may want to put an after-market heat sink on your CPU, which may require more room because good heat-sinks can be big. BTW, if you do buy a nice air cooling heat-sink, I'd recommend looking for something that allows you to blow the air in any direction you want. Sometimes you might want to shoot it out the top fan, sometimes the side fan, and if you don't have a top or side fan, you will want to point it so it all blows out the back fan.

In my case (eh ha), i will probably end up painting some trippy shit on my black steel case, to liven it up a little. I'll also probably get some LED fans, because.. why not? As long as their still good quality fans it doesn't matter. That way I'd have colored light dancing through the fan grills, which would look pretty cool. Which brings me to my last point-- you can always modify your case, if you'd like. For example, if I cut out two big holes on the top of my aluminum Cooler Master, than I could add two big powerful exhaust fans, which would dramatically help the airflow situation. Unfortunately my camera broke recently, and I need to find a USB to Compact Flash card adapter (if they even make those anymore, it's an old Canon), so I don't have any pictures for you right now.

Buy a good case, just in case. One day you may find yourself in a place, where you wish you'd bought a better case...

Monday, August 10, 2015

Building a Badass Tower Part II : On Second Thought...

It turns out that open source Nvidia drivers are still actually not stable enough to rely on, or at least for certain GPU's. Although my card runs much cooler with the noveau driver, I started getting those random freezes again. With disappointment, I had to revert back to the proprietary Nvidia drivers. However, this time I used the xorg edgers repository, which seems to be, at least a little more stable.

On another disappointing note, I've been reminded of why I hate AMD processors again... Lately, I've been having this strange problem with my USB 3 ports. Sometimes, for no logical reason that I can find, the USB 3 controller just stops working. When that happens, sometimes it also crashes the entire system with it, and other times not. The only way I know to fix it is to shut down the system, turn it off, unplug everything, press the power button long enough to discharge the capacitors, and than reboot. After doing all of that, my USB 3 ports magically work again.

I am sure that there is a way to fix these problems, but honestly I am tired of trying to do so. This is why I prefer Intel chipsets: because they just work, no matter what. That is the definition of stability in my book. So whenever I burn out or outgrow this motherboard, I will most certainty purchase an Intel chipset next time.

In the meantime, if anyone else running an AMD 3+ board has experienced these issues and could shed some light here and tell me what to do to fix this USB 3 port problem, that'd be swell. Other than that, I am really enjoying this system. The computing power is beyond awesome, there's just a couple annoying glitches I need to work out.

Wednesday, August 5, 2015

Building a Badass Tower

Discs & Partitioning

During my quest to build an impenetrable, powerful fortress, I have discovered that one of the most effective ways to thwart malicious software from taking hold of a Linux machine is to simply place certain directories on separate partitions. This gives you the ability to mount them with certain options not available when everything is lumped together inside one partition. The example that comes to mind first is mounting /tmp with 'noexec', 'nosuid', and 'nodev'. Because /tmp always has world read, write, and exec permissions, it's the perfect place to drop, compile, or otherwise prepare malicious software. This is not only important on servers, but also development machines, where compilers are often present.

If I were to ever create my own distribution, the installer would by default place /tmp on a separate partition with at least the 'nodev' and 'nosuid' options. Although I recommend mounting /tmp with 'noexec' as well, it can complicate things a little when you need install or update software. However, it's pretty easy to quickly remount a partition with different options:

mount -o remount,exec /tmp

Other directories that ought to be mounted separately include /var/log, /usr/local, and /home.  This partitioning scheme is reasonable for a multi purpose desktop system that may also run some type of server:

/               ext4    errors=remount-ro                                        0       1
/boot           ext4    defaults,noatime,nodev,nosuid,noexec    0       2
/home           ext4    defaults,nodev,nosuid                              0       2
/opt            ext4    defaults                                                        0       2
/srv            ext4    noatime,noexec,nodev                                 0       2
/tmp            ext4   noatime,nodev,nosuid,noexec                     0       2
/usr            ext4    defaults,nodev                                              0       2
/usr/local      ext4    defaults,nodev                                           0       2
/var            ext4    defaults,nodev,nosuid                                  0       2
/var/log        ext4    defaults,nodev,nosuid,noexec                                0       2
/var/log/audit   ext4    defaults,nodev,nosuid,noexec                                0       2
/dev/mapper/cryptswap1 none swap sw                                  0       0


This may be overkill, but I really like the flexibility that this scheme gives me. I like to at least put /var/log, /srv, /opt, and /usr/local in their own partitions. You can also mount /usr and /usr/local read-only, but you'd have to remount them as rw when you performed updates or installed software. However, doing so does harden a system quite a bit, and thus may be worth the extra hassle.

One thing to keep in mind is that it's a pain to fix something from recovery mode with a setup like this. It may be a good idea to keep a copy of busybox somewhere else on the filesystem in case something stupid happens. Usually you can just mount all of your partitions and than do what you need to do from recovery though, so I dont' think its much to worry about. However,  /etc should not have it's own partition, because if anything breaks and you need to change settings from recovery and can't mount /etc, than good luck to you.

If you have multiple hard discs you can spread the file system across the disks for a noticeable performance increase. Even with SSD's, the disc is often the performance bottleneck. Many factors seem to affect SATA speeds, including what cable you use to what type of disk you have. I currently have 4 hard drives in my tower, and it's awesome. Naturally, the main system runs of an SSD, because it's fastest. Than I have a 2 TB external disc hooked up to one of my USB3 ports. I use that for storage. I run VM's off another separate, dedicated disc, which nearly eliminates the performance reduction from the VM's on the rest of the system.

CPU's, GPU's, and BIOS: Fear Not the Microcode

I am an intel type of guy, and I've always hated AMD chipsets. My experience with AMD (which may have been more NVIDIA's fault, as the two often come together) and Linux has always been one of severe frustration. When you install Debian, for example, which does not come with any proprietary drivers out of the box, everything runs beautifully without any tweaking needed on an intel system. That's thanks to Intel working with the open source community over the last ten or twenty years.

It seemed that whenever I did an install on an AMD system, the experience was poor, and many 3rd party drivers, (cough, NVIDIA, I am looking at you right now!) were needed. For whatever reason, AMD systems often come with NVIDIA graphics cards. Intel often has graphics support integrated into their processors, so everything just works the way it is. The tradeoff is that you lose some of your performance because some of your RAM is reserved for video memory.

On desktop systems, you're probably going to want a video card, mainly because a) you have the room for it, and b) a GPU can seriously improve your user experience. Honestly, I don't have much experience with ATI or Radeon GPU's, but it seems people have less of a hard time getting those working than they do with NVIDIA GPU's on Linux systems. I do, however, have enough experience messing around with NVIDIA cards to offer some advice. First of all, try (hard) to avoid using the proprietary NVIDIA drivers! They seriously suck, like a lot. Sometimes it seems as though you don't have a choice in the matter, but before you resign yourself to such awfulness, try these things:

First, update your BIOS. Seriously, do it, especially on AMD systems, you will notice a big increase in stability. My theory is that Intel riggourously tests their shit before marketing it, which is why it's so stable from day one till death. AMD, either because they're always in a race with Intel, or maybe because of they don't work closely with the open source community like Intel does, seems to release processors before they're ready to do so, and than fix the problems with microcode updates. That's my theory, anyway. Because Linux distros don't always install the microcode for you, you're often left with damaged goods after installation. So, install the amd-microcode package, reboot, and than reevaluate your opinion of AMD's stability. I gaurentee you will be pleasantly surprised.

After installing the microcode & updating your BIOS, if you have an NVIDIA chip that is running NVIDIA drivers because it was acting up (my system would just randomly freeze when using the open source Noveau) try to get rid of all the NVIDIA crap, and see how your system performs. Just do ...

apt-get purge nvidia*

And than reboot. Hopefully at this point your system will be running stable and you'll be pleasantly surprised. If so, now install the mesa packages, which compliment the Noveau drivers quite nicely. After I did all of this, I had no more problems with system instability or video cards! My GPU is running at about 58 degrees Celsius now, as opposed to over 70 Celsius on the proprietary driver!

Now you can think about overclocking your CPU. Mine is factory clocked at 3.6 GHz (quad core), and I was able to overclock it to 4.7 GHz without any stability issues, or after-market heat sink! That is one hell of an improvement, in my opinion. However, once my thermal paste arrives in the mail, I am going to install a badass Zalman CPU fan and try to see if I can hit 6 GHz. Currently, my CPU never gets hotter than 45 Celsious, and idles around 10 or  15 (according to lm-sensors anyway). That is probably because my Cooler Master case is very well designed, and has excellent air flow.

More to come on building a badass tower next time. Peace.