<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hacked Existence</title>
	<atom:link href="http://blog.hackedexistence.com/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.hackedexistence.com</link>
	<description>HackedExistence.com</description>
	<lastBuildDate>Thu, 07 Feb 2013 18:07:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Effective Backup Strategies Part 1 – Hardware, Software, and Services Options</title>
		<link>http://blog.hackedexistence.com/effective-backup-strategies-pt1</link>
		<comments>http://blog.hackedexistence.com/effective-backup-strategies-pt1#comments</comments>
		<pubDate>Thu, 07 Feb 2013 18:07:02 +0000</pubDate>
		<dc:creator>dr_dave</dc:creator>
				<category><![CDATA[Backup & Recovery]]></category>
		<category><![CDATA[DIY Computer Workstations]]></category>
		<category><![CDATA[Cloud Backup]]></category>
		<category><![CDATA[Computer Backup]]></category>
		<category><![CDATA[External Hard Drive]]></category>
		<category><![CDATA[Recovery]]></category>
		<category><![CDATA[USB Flash Drive]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=292</guid>
		<description><![CDATA[After our discussion of deciding an I/O strategy for a workstation, it only makes sense that we follow up with a discussion of backup strategies, tools, and techniques. The purpose of this article is to inform you of the decisions &#8230; <a href="http://blog.hackedexistence.com/effective-backup-strategies-pt1">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>After our discussion of deciding an I/O strategy for a workstation, it only makes sense that we follow up with a discussion of backup strategies, tools, and techniques. The purpose of this article is to inform you of the decisions you are required to make when it comes to backing up your systems/files/important data and the best practices for doing so. This article assumes the data you are dealing with is long term storage/archival data – working system data is a different beast altogether and will be discussed at length in another article. Remember – while we can discuss the pros and cons of all the options available, only you can decide what is important to you and how important it is.<br />
<br />
<strong>Consider the following questions to guide your backup strategy:</strong><br />
1.	How important is my data to me? What are the consequences of not being able to access the data? (Loss of revenue, inability to perform a task requiring information etc.)<br />
2.	What are the consequences of having the data stolen or available to third parties? (Identity theft, financial loss etc.)<br />
3.	How much money do I have to spend on creating and maintaining backups to a level that achieves my goals? (Maintaining backups operating costs  vs. level of accepted risk )<br />
4.	What level of redundancy is appropriate for backing up my data? (Level of criticality)<br />
We will analyze each of these questions in detail to provide you with some ideas for how to execute an effective backup strategy.  The key concept to take away from this discussion when dealing with backups is the following:  learn to quantify risk, and translate that risk factor directly into your hardware purchases to cover your bases.  Finally, ALWAYS ENCRYPT YOUR FILES. There exist excellent freeware options such as TrueCrypt that can provide strong encryption (AES, Twofish, Serpent algorithms of various bit lengths) for your files for free. To neglect this option leaves you open to trouble.<br />
<br />
<strong>Develop a tiered system to classify the importance of your data to you.</strong><br />
Spending the time to decide how valuable each piece of information you want to store seems like a daunting task &#8211; however, after you develop a fixed system to use to quantify your data, deciding what data gets backed up (and to where it gets backed up) becomes easy. For example, if you do your tax returns online or with a program such as TurboTax and you choose to save this data on your computer, this would be more important (and sensitive) to you than perhaps a movie you ripped to your hard drive from a DVD or some freeware program you downloaded from the web. By the same token, you could argue that your monthly budget spreadsheet is more important and needs to be more accessible as it is accessed more frequently than your yearly tax returns are.  This leads us into deciding on our selection of backup storage drives/media/services. We will discuss each of these at length so you can decide what is appropriate for your data. We offer a sensible recommendation that would be adequate for most users’ backup needs and budget.<br />
<br />
<strong>Hardware, Software, &#038; Services Options</strong><br />
<br />
<strong>1.	USB Flash Drives</strong><br />
These are both cheap and plentiful – you can find drives up to 128GB in size at your favorite local big-box store.  The speed(read/write performance) and size(capacity) of the drive generally increase along with the price. There are also drives that provide strong onboard encryption with data destruction capabilities in the event you lose the drive and someone attempts to access the data (the Ironkey series of USB flash drives) and ruggedized drives that are designed to withstand water and high levels of shock (Corsair survivor series). You can decide which of these features is best for you. These are great for storing important small files that you access frequently (documents for school, spreadsheets, online order forms etc.) Generally these are small in size and you do not need to go wild with purchasing a large capacity. 8GB-32GB should be sufficient for a USB flash drive backup, if you need more space it is time to consider alternative storage devices or services. For example, if you have an iPod Touch with a 16GB capacity, you can store a backup of all the media on it on a USB key the size of your thumbnail for $13 (SanDisk Cruizer Fit 16GB) with a 32GB version costing $25 (store two different backups!). [As a personal anecdote, I store all my school documents on a 4GB USB Flash drive and I have close to 8 years of files on it and I have barely filled it to 2GB. My graduate research is very data intensive (GBs of image files, MBs of .csv files), and all of my research data for my published work can fit on a 32GB USB flash drive – dr_dave]. Beyond this, it becomes more cost effective to purchase a traditional external hard drive for your storage needs. The beauty of the small size means that it can be stored somewhere safe (like a bank safety deposit box or other secure location) – hopefully out of harm’s way and somewhere thieves won’t find it in the event you are robbed. As many people’s primary computers become laptops – these backups become even more important as it is much easier to steal a laptop with all of your data on it than a desktop.<br />
<br /> <br />
<strong>2.	External Hard Drives</strong><br />
External hard drives are exactly the same as their internal counterparts but they come with their own protective container that has a number of different interface options available. Decide what external I/O interfaces your systems use and choose the medium that works best for you. USB 1.1/2.0/3.0, Firewire 400/800, eSATA and more are all options (USB 2.0/3.0 is the most popular). The good news is that USB is backward compatible with older devices; however they can only run at the rated speed of the old specification. The biggest decision you have to make is deciding how fast you want your external hard drive to be. USB 3.0 and eSATA drives will be more expensive as they are faster and allow you to copy larger files more quickly. The rule of thumb is the larger the capacity of the drive, the faster the interface you are going to want as filling a large drive with a slow interface can be a long process. However if time/speed are not an issue you can save money by buying a large drive with a slow interface.  Another decision you have to make is weather to purchase a 3.5” drive vs. a 2.5” drive. 3.5” external hard drives generally have a larger capacity as they can fit larger platters in the hard drives and can range in capacity from 1TB-4TB. 2.5” drives range from 500GB-2TB in size. You can be more liberal with what files you are saving to a drive such as this as the large capacity allows for backing up files that may not be “mission critical” but are still important to you.  Music and movie/tv show libraries come to mind as candidates for backup to this drive. Also there is nothing stopping you from backing up all of your files to this drive as well, but it will not be as space efficient as USB flash drives (some people don’t like having extra drives on their desk with more wires and additional power draw). Ruggedized options exist here as well, drives by IOSafe are rated highly for their durability and warrantee in the event their product fails to live up to its expectations (data recovery service and insurance payout). A 1TB drive from IOSafe costs about $300 – but the enclosure is solid and the warrantee/data recovery is worth the price of admission. They sell drives rated to survive floods and housefires, and are a good option if care a lot about your data. [I tend to go overkill when dealing with backups but if I’m saving it there is generally a reason for it – dr_dave]. The old adage of anything worth doing is worth doing well rings truest when it comes to backups.  It is also wise to keep in mind the traditional shortcomings of magnetic disks when dealing with this category of drives, unless you are using a solid state disk in an external enclosure.<br />
<br />
<strong>3.	Home NAS / Personal File Server / Backup Server</strong><br />
This option has grown in popularity in recent years, as more and more people purchase new computers and use them for their rated lifetimes, the question of what to do with the old computer has been answered.  There exists a few options in this category – you can repurpose an old computer as a PFS/Backup Server or purchase dedicated NAS hardware and fill it with Hard Drives.  Repurposing an old computer is relatively easy – you just need to install the server operating system of choice on it, install the disk drives you want to  use, spend a few minutes configuring the services that will enable you to use it safely and securely and you are good to go. Some popular options include Ubuntu Linux Server (free), FreeNAS (free), and Windows Home Server ($50 for a license) – these allow you to store and host files and other programs that help you manage your digital life. For example, Windows Home Server allows you to store backup images for all of your Windows PC’s -which you can restore over the network. It also works with XBOX and other media enabled devices in your home. [I do not recommend you use drive extender – as it just creates a large volume out of a bunch of disks. If you are bothering to set up an entire computer, you should spend the time to do your redundancies properly and build a real RAID array – dr_dave]. You can also stream movies and music from the server to devices that are enabled to interact with it. If you choose the Linux route with Ubuntu Server, you really have a significant number of options. There is nothing stopping you from running a full blown outward facing web server where you can host your own site and services. Spending the time finding and configuring the packages to fit your needs is the real challenge to setting up a linux server, but that discussion is best left for another article. The basic install will allow for you to copy files to it via SSH. Be sure to spend the time securing your server so that hackers cannot get it into it and steal or destroy your data. FreeNAS is a BSD based operating system designed specifically for the task of network storage/ file serving. It is very user friendly and easy to set up. It works well on most old hardware and provides a healthy list of features.<br />
<br />
Second, there exist devices specifically made for this purpose, which feature customized operating system environments and redundancy options galore: these are the dedicated NAS boxes.  Most of the time you will see between 2 to 5 slots for hard drives. Buy two identical hard drives and install them and you are ready to begin. Companies such as Synology and QNAP provide the highest rated NAS boxes for home office/ professional level users. They range in price from $250 up to several thousands of dollars depending on your performance needs. Their configuration and management software, small physical footprint when compared to full size desktop towers and their power consumption make them attractive choices. The built in RAID levels add the security and protection for your data that you desire, making sure that you can afford to have a few drive failures without losing any data.<br />
<br />
<strong>4.	Cloud Storage</strong><br />
This is the newest development in the backup storage world (for consumers, anyway) is that of cloud storage. Broadband internet technologies have disseminated to the point where most people have an internet connection that is fast enough to deal with remote online storage satisfactorily. Combine this fact with the rise of mobile broadband and smartphones and you have a perfect storm for the rise of this service in the consumer sector. Popular services include Amazon Cloud Drive, Google Drive, Microsoft SkyDrive, Apple iCloud, Dropbox etc.  The size of the space varies from 5GB-50GB for free before you have to pay a monthly fee for extra storage.  There are specific services designed just for cloud backup such as Carbonite.com. There are definite pros and cons to consider when using a cloud storage service. Some of the pros are: 99.9% uptime / high reliability (as long as you have a connection you should be able to get to your files no problem), it costs nothing, and you can access your files from any browser/ internet connected device. Some of the cons are: questions about security (hackers / 3rd parties viewing your data), questions about outages (will the server be available when I need it?), and internet eavesdropping /middlemen (who is listening in on the traffic on your internet line). Granted most of these services use SSL encryption, but it is important to remember that the files themselves are not encrypted. Also, reports of cloud services browsing through peoples files and banning them if they find that they are hosting material in violation of the TOS. While this is probably to the benefit of humanity considering the nature of the content in question, privacy advocates should take note.  [I would recommend encrypting all of your files locally before uploading them to a cloud storage service, especially if they contain sensitive information. This provides you with that extra “insurance” that if something goes wrong you’re still safe to a large degree. Be sure to use strong encryption with a long key. – dr_dave] Some of these services have syncing applications that let you select what directories you want synced with your cloud storage. You can also configure this application on multiple machines and allow for several computers to sync with the service. This is a great feature and prevents you from having 3 different versions of the same document. </p>
<p>If you’ve made it this far &#8211; we will save our discussion of Redundancy &#038; RAID arrays for part 2 and Incremental vs. Differential backups for part 3 of our series on I/O &#038; backups. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/effective-backup-strategies-pt1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiple Instagram Accounts solved with Android Jelly Bean</title>
		<link>http://blog.hackedexistence.com/multiple-instagram-accounts-solved-with-android-jelly-bean</link>
		<comments>http://blog.hackedexistence.com/multiple-instagram-accounts-solved-with-android-jelly-bean#comments</comments>
		<pubDate>Thu, 31 Jan 2013 00:38:41 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Instagram]]></category>
		<category><![CDATA[Jelly Bean]]></category>
		<category><![CDATA[Android 4.2]]></category>
		<category><![CDATA[android user switching]]></category>
		<category><![CDATA[JellyBean]]></category>
		<category><![CDATA[multiple instagram accounts]]></category>
		<category><![CDATA[user switching]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=282</guid>
		<description><![CDATA[I searched all over the internet for a solution to having multiple Instagram accounts.  It seemed the only solution out there was to log out of the app and back in as a different user.  Since the Instagram API doesn&#8217;t &#8230; <a href="http://blog.hackedexistence.com/multiple-instagram-accounts-solved-with-android-jelly-bean">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I searched all over the internet for a solution to having multiple Instagram accounts.  It seemed the only solution out there was to log out of the app and back in as a different user.  Since the Instagram API doesn&#8217;t allow for posting pictures, there are no third party apps, so downloading different apps logged into different accounts is not an option.  What I finally found as a solution was Android 4.2 User Switching.  This not only solved my instagram problems, it gave me two fully separate users so I can manage two completely separate sets of Social Media accounts from a single device.  With User Switching you can just add another user account and re-install all the same social media apps to manage as many accounts as you like.  Its the perfect solution for Social Media Marketing companies who need to manage multiple sets of Social Media accounts.</p>
<p>With Android 4.2 installed, go to &#8216;Settings&#8217; and select &#8216;Users&#8217; from the Interface column.  Click on the &#8216;ADD USER&#8217; button to create a new account.  To switch between accounts, turn the screen off with a press of the power button, then wake the device with another press of the power button.</p>
<p><a href="http://blog.hackedexistence.com/wp-content/uploads/2013/01/instagram_user_settings.png"><img class="aligncenter size-full wp-image-286" title="instagram_user_settings" src="http://blog.hackedexistence.com/wp-content/uploads/2013/01/instagram_user_settings.png" alt="Instagram User Settings" width="600" height="1024" /></a></p>
<p>The lock screen now shows both of your user accounts at the bottom, simply click the user account you want to use and login.  Each user account can have its own password, so multiple people can share the same tablet.  Each user account is able to install all of its own separate applications.</p>
<p>Just install instagram once on each user account, and you can switch android users to switch between the two logged in instagram accounts.</p>
<p>User Account 1:</p>
<p><a href="http://blog.hackedexistence.com/wp-content/uploads/2013/01/instagram_user_1.png"><img class="aligncenter size-full wp-image-287" title="instagram_user_1" src="http://blog.hackedexistence.com/wp-content/uploads/2013/01/instagram_user_1.png" alt="Instagram User 1" width="600" height="1024" /></a></p>
<p>User Account 2:</p>
<p><a href="http://blog.hackedexistence.com/wp-content/uploads/2013/01/instagram_user_2.png"><img class="aligncenter size-full wp-image-288" title="instagram_user_2" src="http://blog.hackedexistence.com/wp-content/uploads/2013/01/instagram_user_2.png" alt="Instagram User 2" width="600" height="1024" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/multiple-instagram-accounts-solved-with-android-jelly-bean/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workstation Disk Drives – Theory &amp; Practice</title>
		<link>http://blog.hackedexistence.com/workstation_disk_drives</link>
		<comments>http://blog.hackedexistence.com/workstation_disk_drives#comments</comments>
		<pubDate>Mon, 14 Jan 2013 16:02:51 +0000</pubDate>
		<dc:creator>dr_dave</dc:creator>
				<category><![CDATA[DIY Computer Workstations]]></category>
		<category><![CDATA[Disk Drives]]></category>
		<category><![CDATA[Desktop PC]]></category>
		<category><![CDATA[Hard Disk]]></category>
		<category><![CDATA[Hard Drive]]></category>
		<category><![CDATA[HDD]]></category>
		<category><![CDATA[I/O]]></category>
		<category><![CDATA[SATA]]></category>
		<category><![CDATA[Solid State Drive]]></category>
		<category><![CDATA[SSD]]></category>
		<category><![CDATA[Workstation]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=266</guid>
		<description><![CDATA[Workstation Disk Drives – Theory &#38; Practice This article is part of the component selection series When building a workstation, you will want to make sure that you take into account your I/O needs &#8211; as this is the area &#8230; <a href="http://blog.hackedexistence.com/workstation_disk_drives">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Workstation Disk Drives – Theory &amp; Practice</strong><br />
<br />
This article is part of the <em>component selection series</em><br />
<br />
When  building a workstation, you will want to make sure that you take into  account your I/O needs &#8211; as this is the area that will most affect  system performance after your choice of CPU and System Memory. Hard  drive performance is often overlooked due to a lack of understanding of  what each of a typical drive’s specifications mean with regards to  performance. This guide serves as an introduction to performance  workstation I/O recommendations and concepts. We introduce you to the  idea of the “Rule of 3” – 3 System Drives that serve differing needs  within your system to make accessing and managing your data easy. For  the sake of simplicity, we will assume your I/O controller is set to  AHCI mode, you are a Microsoft Windows user, and ignore RAID arrays for  the time being (we save this for another article). These recommendations  are for late 2012/early 2013, however the lessons here remain the same  as drive sizes and speeds increase until another paradigm shifting I/O  technology in a similar vein to SSDs is released.<br />
<br />
<strong>Primary Hard Drive – SSD</strong><br />
For  maximum system performance, you will want your primary drive (the drive  you install your operating system to) to be an SSD, which stands for  Solid State Drive. This drive most commonly uses NAND flash memory of  the MLC variety to store your data.  They have much faster Read/Write  speeds than traditional magnetic disks and can significantly improve  system performance.  Most manufacturers’ drives are now using the SATA  III interface, which allows for a maximum speed of 600MB/s on the bus.   It is still worthwhile to purchase a SATA III drive as they are  backward compatible with previous SATA specifications, however you will  be limited to whatever bandwidth is provided by the SATA revision you  are using. Spending between $100-$300 is appropriate for a drive to  serve this need, with a drive capacity between 120GB and 256GB being  sufficient. Since you are installing only your operating system  (10-40GB) and a few applications (2-4 @ 10-20GB each – adjust  accordingly by need/capacity) that require speed, you do not need an  overly large capacity. It is a rule of thumb to not exceed more than 80%  of the drive’s capacity with data when using an SSD, as sometimes you  can experience a slowdown in performance as a result. Recommended brands  are Intel, Crucial, and Samsung as they make highly regarded SSDs with  very fast performance.<br />
<br />
<strong>Secondary Hard Drive – High RPM Magnetic Disk Drive and/or Large Disk Cache (SSD someday in the future)</strong><br />
The  drive decision in this category is determined by what you want to do  with your system as well as your budget. The goal of this drive is to be  high performance with a larger capacity to make up for high $/per GB of  storage with SSDs. This drive’s primary purpose is to run your  applications that are not as critical as the ones installed on the SSD,  and your computer games library. The decision for this drive can go in  one of two directions: 1) Purchase a high RPM disk such as a Western  Digital Velociraptor ( 10,000RPM w/ 64MB Cache) with a capacity between  500GB-1TB. The performance increase from 7200RPM to 10,000 RPM is  significant and warrants the cost higher cost of the drive (Between  $149-$289). This is the pricier option; however the performance of the  drive in sequential reads is high and is a good drive if you do a lot of  gaming (install your games to this drive – not the SSD, as you now have  the space to install multiple games without ruining your load times –  this option is much faster than if they were on a large capacity storage  drive with a slower RPM)  2) The second option is to purchase the  largest capacity &amp; cache drive you can afford from the Western  Digital Caviar Black line. The lowest price 7200RPM 64MB Cache drive is  $90 for 500GB of storage. While option #2 is not as fast as option #1,  you still get the capacity you need to store the majority of your  applications and the performance is “good enough” while being relatively  inexpensive in comparison. You do not need nor want a drive much larger  than 1TB in this category, as the amount of time to format the drive  becomes an issue, as well as having unnecessary capacity begin to  cannibalize the purpose of hard drive #3. It is better to spend the  money on the smaller capacity drive with the higher speed – as speed has  priority over capacity in this category. In time, this disk will most  likely become an SSD as the price decreases with time while they grow in  capacity.<br />
<br />
<strong>Tertiary Hard Drive – Storage Hard Drive (Maximum Capacity)</strong><br />
The  purpose of this drive is to store all of your content &#8211; movies, music,  downloads, system backups etc. It is the “digital dumping ground” and  stores everything that needs to be archived and is not used on a  frequent basis or does not have large I/O needs. Thus, the features we  are looking for from a Hard Drive in this category are:  Stability/Longevity/Capacity. We want to make sure this drive is as  stable and long lasting as possible (as important things are backed up  to it). This means we must consider the drives mechanical parts that are  prone to wear &amp; tear. Generally, lower RPM hard drives last longer  than higher RPM hard drives, as things like bearings and read heads tend  to wear out more slowly. There is also less danger of a head crash  wiping out a large portion of the disk, as it is spinning slower than a  faster disk. Look for a drive that has a long warrantee in case it fails  earlier (this is bad), so you can have it physically replaced for free–  hopefully a data recovery service can get back the files you’ve stored  on your drive &#8211; but this can be a pricy option (more on storing backups  in multiple locations to prevent this scenario later).  Purchase the  largest drive you can afford in the 5400RPM category. Some manufacturers  are selling drives that operate at 5900RPM – this is fine (the main  point is they are not 7200RPM drives). Cache isn’t as much of a factor  here (the more the merrier), although if you can, try to find a drive  that has good performance on sequential reads as you will be dealing  with large contiguous files on this drive in most cases. Capacity ranges  from 2TB-4TB are appropriate for this area. Western Digital Caviar  Green hard drives are recommended, as they have power saving features  and firmware designed specifically to handle tasks that we are using  this disk for. A 2TB Caviar Green 64Mb Cache can be found online for as  little as $110. Intellipower is WD marketing speak for variable rate  rotational speed (5400-5900 or by some accounts as low as 5000).<br />
<br />
<strong>Conclusions</strong><br />
The  lessons here today will get you started on selecting the appropriate  disks for the tasks you have at hand.  We personally recommend and use  Western Digital Hard Drives as they have a quality warrantee that the  company honors and their drives are built solidly. However – everyone  has an opinion on drives from each drive manufacturer – pick whatever  works best for you keeping in mind the key points of what this drive is  trying to achieve for your workstation. It is worthwhile to consider the  disk utilities provided by the manufacturer to make using your disks in  the way you desire easier. This is yet another reason for the  recommendation of WD drives, as they have excellent tools you can use to  low level format your drives. IBM/Hitachi used to have the best disk  utilities (their drives have both a good and bad reputation), but WD has  recently bought them. Selecting all of your drives from the same  manufacturer means that you can perform all of your management tasks on  the drives without having to change disk software. There are some risks  involved as a consequence of this (bad batch of drives, similar rates of  failure, exposure to manufacturing defects during a generation /  platter runs), but for a personal workstation these factors are of  minimal impact. We have not bothered to discuss a backup strategy here  or any redundancy as it will be assumed that you understand what/how to  back up your important information. These concepts will be discussed in  full in a future article.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/workstation_disk_drives/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My thoughts on the Nexus 7 Tablet</title>
		<link>http://blog.hackedexistence.com/my-thoughts-on-the-nexus-7-tablet</link>
		<comments>http://blog.hackedexistence.com/my-thoughts-on-the-nexus-7-tablet#comments</comments>
		<pubDate>Wed, 28 Nov 2012 07:29:50 +0000</pubDate>
		<dc:creator>dr_dave</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Android Tablet]]></category>
		<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Nexus 7]]></category>
		<category><![CDATA[Tablet]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=248</guid>
		<description><![CDATA[To provide a bit of back story for this blog post – not long after my review of the iPad, I ultimately decided that the iPad was somewhat redundant to the iPhone I was already using, thus it had no &#8230; <a href="http://blog.hackedexistence.com/my-thoughts-on-the-nexus-7-tablet">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>To provide a bit of back story for this blog post – not long after my review of the iPad, I ultimately decided that the iPad was somewhat redundant to the iPhone I was already using, thus it had no compelling reasons to remain in my bag. As such, I eventually sold it and relegated tablets to the “computing fad” bin. Recently, I received a Nexus 7 as a gift &#8211; the 8GB model. Here is an overview of my recent experiences with it. After incessantly hearing about the glorious benefits of using tablets from my friends, I was willing to give tablets another go and see where this new 7&#8243; form factor was going to take me.</p>
<p><strong>First Impressions</strong></p>
<p>The 7” form factor for tablets is the sweet spot for touch/tablet computing. It is small enough to fit in a backpack or messenger bag with ease and not displace other important objects you need to carry around (notebooks – of the paper variety and &#8220;dead trees&#8221; aka books). The lightweight and durable materials used in its construction make it feel sturdy &#8211; but not cheap. I am a fan of rubberized coatings as they allow for a comfortable feel in the hands and provide a solid grip that cannot be found on glossy plastic or metal. ASUS managed to blend these features together well in their execution of the Nexus 7, allowing for long term one handed use. The front facing camera provides a quality (enough) picture for videoconferencing. The lack of physical buttons on the face is strange (like a home button), however this is quickly forgotten as one becomes accustomed to the device. [Editor's Note: I've yet to suffer a total system hardlock. I'm keeping my fingers crossed.]</p>
<p><strong>Props</strong></p>
<p>I received this the day Android 4.2 was released, so as soon as I fired it up I was already downloading the updates for the OS. It felt fast and responsive – setting up all of your accounts was very easy, especially if you already have an existing Google account. The Android marketplace is diverse with its offerings, and you can get some great open source software for your tablet if you choose to get it. As a Nexus device, it runs the vanilla version of the Android OS. As the Google flagship device, you can count on hardware and device driver support from developers. While I have not tested any custom ROMs for it yet, the fact that I can excites me greatly. The freedom to do what you want with your device and run the software you want is something I wish Apple would consider (Yes – I understand the walled garden approach but I believe they would see increased revenue from hardware sales if more software was compatible with their hardware.) I would hope to see a privacy and security focused ROM distro ala SELinux released for the tablet by the open source community. Once I get time – I will probably try out a few custom ROMs and end up writing a review about them.</p>
<p>Reading on this tablet is very nice, as the screen adjusts its brightness based on ambient light to conserve battery. Adobe offers its full suite of “free” products for the device (Flash and Acrobat Reader) so you can use this in a manner that is nearly identical to a browser on a laptop or a PC. My eBooks all work well on the device and it is nice to be able to carry around a large library of information (all of my computer books and research white papers).</p>
<p><strong>Gripes</strong></p>
<p>The 8GB is a bit cramped once all of your OS updates are installed and you download all of your applications from either the Google Play Store or your synced Google account. I am wondering why a discrete SD card slot was forgone, but based on my limited research this seems to be a recurring theme from new android devices going forward as apparently support for the reader is difficult in the fragmented Android device market.</p>
<p><strong>“App Bleed”</strong></p>
<p>Here I would like to draw attention to a term for a phenomenon I am calling “app bleed”. App bleed occurs when what should be a compartmentalized application ends up sharing data with other applications installed on your system. [Editor's Note: I realize this is just a file/access permissions problem - however I find app developers advertising this type of behavior as a "feature" to be a dumb idea.] This problem worsens when you store your credentials in the application and it does things automatically without your knowledge. For example, if you are logged into FaceBook and go to some website and read an article and it automatically shares that article with your FaceBook friends or some purchase you made on amazon.com gets tweeted to your Twitter followers. Many of these apps check for each other and want to share data between themselves. I STRONGLY dislike applications that share data with each other &#8211; unless I explicitly tell them this is OK. I like all of my apps separate from each other because I want to know where my data is being stored at all times. The future seems to be trending toward greater integration of social media/email/scheduling programs all sharing data with each other – so it looks like people like me are left out in the cold.</p>
<p><strong>Conclusions</strong></p>
<p>The Nexus 7 has just the right blend of features and price making it too compelling to pass up if you are in the market for a multimedia widget. It does everything it aims to do extremely well. If you see yourself needing a cheap device to consume web or social media content &#8211; this is the best one for the task. I will look forward to using my Nexus 7 for months to come. Stay tuned for my reviews on custom ROMS – coming in a few months! [Editor's Note: Probably a bit longer.]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/my-thoughts-on-the-nexus-7-tablet/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django &#8211; Add Username to 500 Error Reports</title>
		<link>http://blog.hackedexistence.com/django-add-username-to-500-error-reports</link>
		<comments>http://blog.hackedexistence.com/django-add-username-to-500-error-reports#comments</comments>
		<pubDate>Wed, 31 Oct 2012 18:04:18 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Django 500]]></category>
		<category><![CDATA[Django 500 Username]]></category>
		<category><![CDATA[Django Error Reporting]]></category>
		<category><![CDATA[Error Reporting]]></category>
		<category><![CDATA[Middleware]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=245</guid>
		<description><![CDATA[This information was taken from: http://blog.sidmitra.com/how-to-add-requestuser-to-500-error-reports-o I have been building a Social Networking style website in Django and recently received multiple 500 error reports due to users not having proper variables set.  I found the default 500 error email to &#8230; <a href="http://blog.hackedexistence.com/django-add-username-to-500-error-reports">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This information was taken from: <a href="http://blog.sidmitra.com/how-to-add-requestuser-to-500-error-reports-o" target="_blank">http://blog.sidmitra.com/how-to-add-requestuser-to-500-error-reports-o</a></p>
<p>I have been building a Social Networking style website in Django and recently received multiple 500 error reports due to users not having proper variables set.  I found the default 500 error email to be rather lacking with clues as to which users were actually causing the 500 errors, so I used the snippet above to add the request.user.username and request.user.email variables to 500 tracebacks for authenticated users.</p>
<p>Thanks to the Author Sid for a very useful piece of code.</p>
<p>To get this working, I created a new app called errorreporting, and pasted the following code into a file called middleware.py inside the errorreporting folder:</p>
<pre><span style="color: #800000; font-weight: bold;">class</span> ExceptionUserInfoMiddleware<span style="color: #808030;">(</span>object<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
    <span style="color: #696969;">"""</span>
<span style="color: #696969;">Adds user details to request context on receiving an exception, so that they show up in the error emails.</span>
<span style="color: #696969;">Add to settings.MIDDLEWARE_CLASSES and keep it outermost(i.e. on top if possible). This allows</span>
<span style="color: #696969;">it to catch exceptions in other middlewares as well.</span>
<span style="color: #696969;">"""</span>

    <span style="color: #800000; font-weight: bold;">def</span> process_exception<span style="color: #808030;">(</span>self<span style="color: #808030;">,</span> request<span style="color: #808030;">,</span> exception<span style="color: #808030;">)</span><span style="color: #808030;">:</span>
        <span style="color: #696969;">"""</span>
<span style="color: #696969;">Process the exception.</span>

<span style="color: #696969;"> <img src='http://blog.hackedexistence.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> arameters:</span>
<span style="color: #696969;">- `request`: request that caused the exception</span>
<span style="color: #696969;">- `exception`: actual exception being raised</span>
<span style="color: #696969;">"""</span>

        <span style="color: #800000; font-weight: bold;">try</span><span style="color: #808030;">:</span>
            <span style="color: #800000; font-weight: bold;">if</span> request<span style="color: #808030;">.</span>user<span style="color: #808030;">.</span>is_authenticated<span style="color: #808030;">(</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span>
                request<span style="color: #808030;">.</span>META<span style="color: #808030;">[</span><span style="color: #0000e6;">'USERNAME'</span><span style="color: #808030;">]</span> <span style="color: #808030;">=</span> <span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>request<span style="color: #808030;">.</span>user<span style="color: #808030;">.</span>username<span style="color: #808030;">)</span>
                request<span style="color: #808030;">.</span>META<span style="color: #808030;">[</span><span style="color: #0000e6;">'USER_EMAIL'</span><span style="color: #808030;">]</span> <span style="color: #808030;">=</span> <span style="color: #e34adc;">str</span><span style="color: #808030;">(</span>request<span style="color: #808030;">.</span>user<span style="color: #808030;">.</span>email<span style="color: #808030;">)</span>
        <span style="color: #800000; font-weight: bold;">except</span><span style="color: #808030;">:</span>
            <span style="color: #800000; font-weight: bold;">pass</span></pre>
<p>Then, in settings.py, I added the following line to the top of the MIDDLEWARE_CLASSES block:</p>
<pre><span style="color: #0000e6;">'errorreporting.middleware.ExceptionUserInfoMiddleware'</span><span style="color: #808030;">,</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/django-add-username-to-500-error-reports/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Phonegap + Jquery Mobile = White Screen Flicker [solved]</title>
		<link>http://blog.hackedexistence.com/phonegap-jquery-mobile-white-screen-flicker-solved</link>
		<comments>http://blog.hackedexistence.com/phonegap-jquery-mobile-white-screen-flicker-solved#comments</comments>
		<pubDate>Thu, 25 Oct 2012 16:55:23 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Phonegap]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery mobile]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[white flicker]]></category>
		<category><![CDATA[white page]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=241</guid>
		<description><![CDATA[When building applications with Phonegap, android doesn&#8217;t seem to mind changing pages, but on iOS if you are missing a few key lines of code, when loading new pages you will get a white screen flicker before the new page &#8230; <a href="http://blog.hackedexistence.com/phonegap-jquery-mobile-white-screen-flicker-solved">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When building applications with Phonegap, android doesn&#8217;t seem to mind changing pages, but on iOS if you are missing a few key lines of code, when loading new pages you will get a white screen flicker before the new page loads.</p>
<p>This issue is caused by Jquery Mobile and can be solved by adding the following meta tags inside your head:</p>
<pre><span style="color: #a65700;">&lt;</span><span style="color: #800000; font-weight: bold;">meta</span><span style="color: #274796;"> </span><span style="color: #074726;">name</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"viewport"</span><span style="color: #274796;"> </span><span style="color: #074726;">content</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"width=device-width, initial-scale=1, maximum-scale=1"</span><span style="color: #a65700;">&gt;</span>
<span style="color: #a65700;">&lt;</span><span style="color: #800000; font-weight: bold;">meta</span><span style="color: #274796;"> </span><span style="color: #074726;">name</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"apple-mobile-web-app-capable"</span><span style="color: #274796;"> </span><span style="color: #074726;">content</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"yes"</span><span style="color: #274796;"> </span><span style="color: #a65700;">/&gt;</span>
<span style="color: #a65700;">&lt;</span><span style="color: #800000; font-weight: bold;">meta</span><span style="color: #274796;"> </span><span style="color: #074726;">name</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"apple-mobile-web-app-status-bar-style"</span><span style="color: #274796;"> </span><span style="color: #074726;">content</span><span style="color: #808030;">=</span><span style="color: #0000e6;">"black"</span><span style="color: #274796;"> </span><span style="color: #a65700;">/&gt;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/phonegap-jquery-mobile-white-screen-flicker-solved/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Hadoop Single Node on Linux Mint</title>
		<link>http://blog.hackedexistence.com/installing-hadoop-single-node-on-linux-mint</link>
		<comments>http://blog.hackedexistence.com/installing-hadoop-single-node-on-linux-mint#comments</comments>
		<pubDate>Tue, 23 Oct 2012 09:30:43 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Hadoop]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Apache Hadoop]]></category>
		<category><![CDATA[Hadoop on Linux]]></category>
		<category><![CDATA[Hadoop on Mint]]></category>
		<category><![CDATA[Hadoop on Ubuntu]]></category>
		<category><![CDATA[Hadoop Psudo-Distributed]]></category>
		<category><![CDATA[Hadoop Setup]]></category>
		<category><![CDATA[Hadoop Single Node]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=231</guid>
		<description><![CDATA[In this post, we&#8217;ll look at how to install the latest stable version of Apache Hadoop on a laptop running Linux Mint 13, although this install setup should be very similar for most other distributions. Before we begin, you should &#8230; <a href="http://blog.hackedexistence.com/installing-hadoop-single-node-on-linux-mint">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hackedexistence.com/wp-content/uploads/2012/10/hadoop_logo.jpg"><img class="aligncenter size-full wp-image-239" title="hadoop_logo" src="http://blog.hackedexistence.com/wp-content/uploads/2012/10/hadoop_logo.jpg" alt="" width="300" height="225" /></a></p>
<p>In this post, we&#8217;ll look at how to install the latest stable version of Apache Hadoop on a laptop running Linux Mint 13, although this install setup should be very similar for most other distributions.</p>
<p>Before we begin, you should check out the hadoop website here: <a href="http://hadoop.apache.org/" target="_blank">http://hadoop.apache.org/</a> and familiarize yourself with the Getting Started documentation.</p>
<p><span style="color: #dc0000;">// GET HADOOP</span></p>
<p>The first thing you need to do is acquire the hadoop package.  At the time of writing, Hadoop was available for download from the following link: <a href="http://www.apache.org/dyn/closer.cgi/hadoop/common/" target="_blank">http://www.apache.org/dyn/closer.cgi/hadoop/common/</a>.  The latest stable version at this point is 1.0.4, so I opted to download the file hadoop-1.0.4.tar.gz as I want to use the source tarball instead of the rpm to build hadoop.  I have chosen this route because the laptop I am installing hadoop on will not be solely used for hadoop, so using a source based distribution allows me to keep everything in a single working directory and allows for easy upgrading in the future.</p>
<p>Once you have downloaded the tarball, extract it with the following command:</p>
<pre>$ tar zxvf hadoop-1.0.4.tar.gz</pre>
<p>Optionally, you can move it somewhere on the filesystem where hadoop will reside (maybe in your home directory).</p>
<p>Inside the newly created hadoop-1.0.4 directory, there is a docs directory that has an outline of all the steps we will be working through.  This post will walk through the &#8216;Single Node Setup&#8217; instructions inside the docs directory.</p>
<p>First, we will look at Standalone Operation which does not provide HDFS support, it simply gets a hadoop node up and running to process simple jobs.  SSH access is not required for Standalone Operation.</p>
<p>To get the Standalone Operation functional, we only need to add 1 line of code that tells hadoop where the Java Installation resides on our machine.  Apache recommends using the Sun flavor of the Java JDK, but since this is not a production setup, I am going to use the OpenJDK installation that is already installed on my Linux Mint distribution.  Further information about supported flavors of the JDK can be found here: <a href="http://wiki.apache.org/hadoop/HadoopJavaVersions" target="_blank">http://wiki.apache.org/hadoop/HadoopJavaVersions</a>.</p>
<p>Since I am running the 64 bit version of Mint, my JDK is installed at  /usr/lib/jvm/java-6-openjdk-amd64.  Add this configuration to the hadoop environment variables like this:</p>
<pre>$ cd hadoop-1.0.4/conf
$ vim hadoop-env.sh</pre>
<p>Somewhere around the top of this file you will see the following lines:</p>
<pre># The java implementation to use.  Required.
# export JAVA_HOME=/usr/lib/j2sdk1.5-sun</pre>
<p>We are going to change this to:</p>
<pre># The java implementation to use.  Required.
export JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64</pre>
<p>Congratulations!  You should now be able to fire up hadoop in Standalone Operation mode.  You can start by taking a look at the usage for the script that starts hadoop by going back up to the main hadoop folder and typing the following:</p>
<pre>$ bin/hadoop</pre>
<p>Now lets run the example hadoop script to actually push a full job through our Standalone server.  Again in the hadoop folder:</p>
<pre>$ mkdir input
$ cp conf/*.xml input
$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs[a-z.]+'
$ cat output/*</pre>
<p>This should run the example script and put the output from the job in the output folder.</p>
<p><span style="color: #dc0000;">// PSUDO-DISTRIBUTED OPERATION</span></p>
<p>Although Psudo-Distributed Operation is not required, it will provide you with an environment that much more resembles what you will encounter in production.  I recommend performing the extra configuration to provide the web-based job tracker, web-based node tracker, and HDFS that you will find in hadoop production servers.</p>
<p>On Linux Mint, we must start by installing the SSH server and starting up the ssh daemon.  Install the server with the following command:</p>
<pre>$ sudo apt-get install openssh-server</pre>
<p>After the server is installed, check its status with:</p>
<pre>$ /etc/init.d/ssh status</pre>
<p>If the server is not started, start it with:</p>
<pre>$ /etc/init.d/ssh start</pre>
<p>Now that the SSH server is running, we must enable passphraseless ssh</p>
<p><span style="color: #dc0000;">// WARNING<br />
THIS IS DANGEROUS.  YOU SHOULD NOT ENABLE PASSPHRASELESS SSH WHEN YOU ARE NOT USING HADOOP.  EITHER DISABLE SSH ALLTOGETHER OR REMOVE THE AUTHORIZED_KEYS WHEN NOT USING HADOOP.</span></p>
<pre>$ ssh-keygen -t dsa -P '' -f ~/.ssh/id_dsa
$ cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys</pre>
<p>You should now be able to ssh into the localhost without entering a password.  Try it with the following command (you might have to type yes to accept the RSA key fingerprint, this is OK):</p>
<pre>$ ssh localhost
$ exit</pre>
<p>Inside the conf directory, we need to modify 3 files to add configuration for Psudo-Distributed Operation.  This should be added between the &lt;configuration&gt; and &lt;/configuration&gt;tags.</p>
<p>In conf/core-site.xml add the following:</p>
<pre>    <span style="font-weight: bold;">&lt;property&gt;</span>
        <span style="font-weight: bold;">&lt;name&gt;</span>fs.default.name<span style="font-weight: bold;">&lt;/name&gt;</span>
        <span style="font-weight: bold;">&lt;value&gt;</span>hdfs://localhost:9000<span style="font-weight: bold;">&lt;/value&gt;</span>
    <span style="font-weight: bold;">&lt;/property&gt;</span></pre>
<p>In conf/hdfs-site.xml add the following:</p>
<pre>    <span style="font-weight: bold;">&lt;property&gt;</span>
        <span style="font-weight: bold;">&lt;name&gt;</span>dfs.replication<span style="font-weight: bold;">&lt;/name&gt;</span>
        <span style="font-weight: bold;">&lt;value&gt;</span>1<span style="font-weight: bold;">&lt;/value&gt;</span>
    <span style="font-weight: bold;">&lt;/property&gt;</span></pre>
<p>In conf/mapred-site.xml add the following:</p>
<pre>    <span style="font-weight: bold;">&lt;property&gt;</span>
        <span style="font-weight: bold;">&lt;name&gt;</span>mapred.job.tracker<span style="font-weight: bold;">&lt;/name&gt;</span>
        <span style="font-weight: bold;">&lt;value&gt;</span>localhost:9001<span style="font-weight: bold;">&lt;/value&gt;</span>
    <span style="font-weight: bold;">&lt;/property&gt;</span></pre>
<p>Now we need to format the distributed filesystem with the following command, from the hadoop folder:</p>
<pre>$ bin/hadoop namenode -format</pre>
<p>And now were ready to go!  Start up the hadoop daemon with the following command:</p>
<pre>$ bin/start-all.sh</pre>
<p>You should now be able to browse the nameNode and JobTracker in your browser (after a short delay for startup) by browsing to the following URLs:</p>
<p>nameNode: <a href="http://localhost:50070/" target="_blank">http://localhost:50070/</a></p>
<p>JobTracker: <a href="http://localhost:50030/" target="_blank">http://localhost:50030/</a></p>
<p>At this point your Psudo-Distributed Mode should be fully operational.</p>
<p><span style="color: #dc0000;">// RUN THE EXAMPLE ON THE PSUDO-DISTRIBUTED CLUSTER</span></p>
<p>Now were going to run the exact same example we ran above but this time inside of the Psudo-Distributed Cluster.  We start by copying our input data set into HDFS:</p>
<pre>$ bin/hadoop fs -put conf input</pre>
<p>Run the example:</p>
<pre>$ bin/hadoop jar hadoop-examples-*.jar grep input output 'dfs['a-z.]+'</pre>
<p>You should now see the job executing in the web based Job Tracker, and when the job completes you will be able to get the report from the job tracker.  To copy the output from HDFS back to the local file system for examination, we can use the following command:</p>
<pre>$ bin/hadoop fs -get output output</pre>
<p>The output from the job that just completed will now be in a folder called &#8216;output&#8217; in the current working directory.</p>
<p><span style="color: #dc0000;">// STOP THE HADOOP DAEMON</span></p>
<p>Once you are finished, you should stop the hadoop daemons from running with the following command:</p>
<pre>$ bin/stop-all.sh</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/installing-hadoop-single-node-on-linux-mint/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Book Review: Ghost in the Wires</title>
		<link>http://blog.hackedexistence.com/book-review-ghost-in-the-wires</link>
		<comments>http://blog.hackedexistence.com/book-review-ghost-in-the-wires#comments</comments>
		<pubDate>Wed, 07 Dec 2011 12:01:15 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Book Review]]></category>
		<category><![CDATA[Ghost in the Wires]]></category>
		<category><![CDATA[Kevin Mitnick]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=215</guid>
		<description><![CDATA[When I was in high school, I wouldn&#8217;t say I was an avid reader, but I definitely tackled some novels. When I got to college (back in 2003), reading books (that weren&#8217;t textbooks) kind of faded away, which is ironic, &#8230; <a href="http://blog.hackedexistence.com/book-review-ghost-in-the-wires">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When I was in high school, I wouldn&#8217;t say I was an avid reader, but I definitely tackled some novels.  When I got to college (back in 2003), reading books (that weren&#8217;t textbooks) kind of faded away, which is ironic, you would think college would have the opposite effect &#8230;</p>
<p>Recently, I gave the kindle a try, to see if I could really get back into reading books.  Even though I&#8217;m a huge supporter and overzealous user of technology, I was wary of the kindle at first.  I didn&#8217;t like the thought of not being able to flip pages, not being able to dog-ear pages and write notes in the book.  It really bothered me that when I finished dedicating all that time to a novel, I wouldn&#8217;t have a paper back trophy to add to the collection.  Then I actually gave it a try &#8230;</p>
<p><a href="http://blog.hackedexistence.com/wp-content/uploads/2011/12/ghost-wires.jpg"><img class="aligncenter size-full wp-image-224" title="ghost-in-the-wires" src="http://blog.hackedexistence.com/wp-content/uploads/2011/12/ghost-wires.jpg" alt="" width="324" height="500" /></a></p>
<p>Kevin Mitnick&#8217;s autobiography, &#8220;<a href="http://www.amazon.com/Ghost-Wires-Adventures-Worlds-Wanted/dp/0316037702/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1323259049&amp;sr=1-1" target="_blank">Ghost in the Wires: My Adventures as the World&#8217;s Most Wanted Hacker</a>&#8220;, instantly interested me as I had read &#8220;<a href="http://www.amazon.com/Takedown-Pursuit-Americas-Computer-Outlaw/dp/0786889136" target="_blank">Takedown: The Pursuit and Capture of Kevin Mitnick, America&#8217;s Most Wanted Computer Outlaw-By the Man Who Did It</a>&#8221; by Tsutomu Shimomura and John Markoff in highschool.</p>
<p>In this spare-no-details first hand account, Mitnick takes us through his rise to become the FBI&#8217;s most wanted target, detailing his steps in creating new identities to allude the law enforcement manhunt while (quite successfully) staging a counter snooping operation that kept him one step ahead of his pursuers for years.</p>
<p>Many of Mitnick&#8217;s exploits are based on an attack vector known as Social Engineering.  He outlines the three steps to successful social engineering as:<br />
1) Assume a position of authority<br />
2) Convince the victim that you are supposed to be doing what you are asking them to do<br />
3) Convince the victim that you are unable to do it yourself, and you need their help<br />
These three steps, if performed properly, almost always result in the victim doing something for you that you shouldn&#8217;t be able to do yourself.  Mitnick, by simply talking to people on the phone, was incredibly skilled in getting people to grant him access to restricted information and change systems that he didn&#8217;t have the permission to change himself.</p>
<p>Overall, this book assumes you have some background understanding of how  a Telco operates, and is not for the technically challenged, although  it rarely goes into great technical detail.</p>
<p>What I found most interesting was Mitnick&#8217;s thoughts on solitary confinement, a topic he became quite familiar with through first hand experience.  Spending 8 months in solitary confinement for non-violent crimes seems a little harsh, and Mitnick constantly describes the damaging psychological impact that it can have on a human being.</p>
<p>At one point, Mitnick describes being diagnosed as having an &#8220;addiction to hacking&#8221; in the same sense as an addiction to smoking or drinking.  This is easily justified given his lack of &#8220;for profit&#8221; exploits in lieu of a constantly exploiting Telcos on the quest for knowledge.</p>
<p>The truly shocking thing about this book is not Mitnick&#8217;s exploits, but the vulnerabilities in the Telco&#8217;s themselves, something I have been conscious of for years.  Most of his code based exploits were piggybacked on Social Engineering attacks against the Telcos.  The biggest vulnerability in the phone companies are the Operators, Service Technicians and general staff who are willing to break security protocol (or even completely disregard it) for someone who speaks their rare and unique, highly technical language.  This is a terrifying reality considering the power one can wield by simply convincing people over the phone to do something.</p>
<p>I highly recommend this book to other tech junkies looking for a good read, and am looking forward to reading some of his other books.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/book-review-ghost-in-the-wires/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building Awesome Facebook tabs with a Horribly Documented API</title>
		<link>http://blog.hackedexistence.com/building-awesome-facebook-tabs-with-a-horribly-documented-api</link>
		<comments>http://blog.hackedexistence.com/building-awesome-facebook-tabs-with-a-horribly-documented-api#comments</comments>
		<pubDate>Wed, 21 Sep 2011 17:34:48 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Facebook API]]></category>
		<category><![CDATA[Facebook Tabs]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=186</guid>
		<description><![CDATA[I built this Facebook tab in 2 days.  The entire template file is 111 lines of code.  2 days is way too long for 111 lines &#8230; You can check out the tab here. I&#8217;ve been playing with the Facebook &#8230; <a href="http://blog.hackedexistence.com/building-awesome-facebook-tabs-with-a-horribly-documented-api">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I built this Facebook tab in 2 days.  The entire template file is 111 lines of code.  2 days is way too long for 111 lines &#8230;</p>
<p>You can check out the tab <a href="https://www.facebook.com/#!/pages/Nation-Wide-Bar-Crawl/196540083699474" target="_blank">here</a>.</p>
<p>I&#8217;ve been playing with the Facebook API for a while, and I&#8217;ve never really been satisfied with the final product.  Something about it always seemed incomplete.  There were all kinds of restrictions and all kinds of hacks to break restrictions.  For example, I had a photo gallery inside a Facebook tab that leveraged a Dialog window to display a full size image, thanks to the old Javascript API.  Way cool effect for a photo gallery, but hacked out and not really supported which eventually caused it to break.</p>
<p>I&#8217;ve been working on a website for a few months, and I wanted to build something that would extend its reach to Facebook.  I wanted to create something that would really allow people to interact with each other, on Facebook, the way they used to with Apps like SuperPoke.</p>
<p>1) Pick a gift.<br />
2) Pick a friend.<br />
3) DIRECT INTERACTION that all your friends see.</p>
<p>The popularity of App provoked direct interaction between two people on Facebook is something that has really faded, probably due to horrible API documentation, and been replaced by a more pure, unaided post based interaction.  Our solution was to build an App that provided quality content worthy of sharing on Facebook while making it a very simple to share the content with a friend.</p>
<p>Facebook has built in facilities for sharing content with friends.  They used to provide access to some of those facilities in older versions of the API, but have since stripped out access to those facilities and replaced it with a lower level access to Facebook data, effectively moving third party developers closer to the database.  This is very beneficial to developers if they can figure out how to interface with the API, as it not only allows, but forces the developer to build out the full flow of interaction, but unfortunately, often becomes a task of blindly reverse engineering return values and function calls.</p>
<p>Alright, enough bitching about Facebook, lets take a look at the product &#8230; and I&#8217;ll bitch some more later.</p>
<p><img src="http://blog.hackedexistence.com/wp-content/themes/twentyten/images/beerwall.jpg" alt="Select a Beer" /></p>
<p>Our wall is composed of a huge list of beers that you can scroll through.  Step 1 is simply to pick a beer.  When you click on the beer, you are asked to authorize the app, giving access to your basic information (friends list).  After Authorizing the App (you only have to authorize it the first time you use it, it will be stored in your preferences), you will be shown a list of your friends in alphabetical order.  &#8216;In alphabetical order&#8217; doesn&#8217;t seem that impressive, but it&#8217;s not built in.  The Graph API uses lazy sorting when it returns the friends list, so it had to be sorted in Javascript by the browser.</p>
<p><img src="http://blog.hackedexistence.com/wp-content/themes/twentyten/images/select_friend.jpg" alt="Select a Friend" /></p>
<p>Step 2 is just as simple, click on one of your friends.</p>
<p><img src="http://blog.hackedexistence.com/wp-content/themes/twentyten/images/post_to_wall.jpg" alt="Post to Facebook Wall" /></p>
<p>Step 3: Facebook dialog asking if you want to post the chosen beer to the chosen friends wall.  Type in a description, and click share.  Thats it.  3 clicks and you can share any of the almost 200 beers with any of your 342,000 friends.  Simple enough, right?  Now lets look at the code &#8230;</p>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
// Put some style info for your div ids and classes here
&lt;/style&gt;
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;/head&gt;
</pre>
<p>In the first block of code we setup a basic HTML layout and load the jquery script from Google&#8217;s Servers (Props to Google for hosting a lot of good frameworks for the masses).  The Jquery framework is going to help us with a few things, hiding and showing divs, getting and setting variable values, etc.</p>
<pre>&lt;body&gt;
&lt;div id="fb-root"&gt;&lt;/div&gt;
&lt;script&gt;
window.fbAsyncInit = function() {
FB.init({
appId  : 'YOUR_APP_ID_HERE', //FILL IN YOUR APP ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml  : true, // parse XFBML
oauth  : true // enable OAuth 2.0
});
//  FB.Event.subscribe('auth.statusChange', onFacebookStatusChange);
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</pre>
<p>The above code sets up the body element and uses javascript to load the Facebook Javascript API asynchronously.  Be sure to fill in your App ID or this will fail to load the API and all calls to the API will fail.</p>
<pre>function onFacebookInitialLoginStatus(response) {
if (response.status != "connected" || response.authResponse == null) {
facebookLogin();
}
FB.api('/me/friends', function(response) {
var friends1 = response.data;
var friends = friends1.sort(sortByName);
var l = friends.length;
for (var i=0;i&lt;l;i++) {
$('#friends ul').append("&lt;li onclick=\"personSelected(" + friends[i].id + ");\"&gt;&lt;img src=\"https://graph.facebook.com/" + friends[i].id + "/picture/\"&gt;&lt;p&gt;" + friends[i].name + "&lt;/p&gt;&lt;/li&gt;");
}
$('.beers_image_list').hide();
$('#beers_page_header').hide();
$('#footer').hide();
$('#friends_header').show();
$('.friends_image_list').show();
});
}
</pre>
<p>The above function is responsible for checking the LoginStatus of the requesting user.  I had to reverse engineer the response object as there is no proper documentation outlining what actually gets returned.  What comes back is a list of friends stored in response.data, but the Graph API uses a lazy sorting method and returns the list without any useful sort performed.  We must therefore implement a method in Javascript to sort the returned list.  This all takes place in the browser instead of on the server.</p>
<pre>function sortByName(a, b) {
var x = a.name.toLowerCase();
var y = b.name.toLowerCase();
return((x &lt; y) ? -1 : ((x &gt; y) ? 1 : 0));
}
</pre>
<p>The above function had to be implemented into the code (and was taken from HERE) to sort the list of friends.</p>
<pre>function facebookLogin() {
FB.login(onFacebookInitialLoginStatus);
}
</pre>
<p>The facebookLogin() function does some stuff FILL IN EXPLAINATION</p>
<pre>function shareBeer(selected_beer_img, selected_beer_link, selected_beer_name, selected_beer_brewery, selected_beer_type, selected_beer_locality) {
$('#selected_beer_image').html(selected_beer_img);
$('#selected_beer_link').html(selected_beer_link);
$('#selected_beer_name').html(selected_beer_name);
$('#selected_beer_brewery').html(selected_beer_brewery);
$('#selected_beer_type').html(selected_beer_type);
$('#selected_beer_locality').html(selected_beer_locality);
FB.getLoginStatus(onFacebookInitialLoginStatus);
}
</pre>
<p>The shareBeer() function is really the heart of what makes our product unique and easy to use.  By utilizing the Jquery framework, we are able to create a simple and easy to use user interface that allows users to perform step 1, Choose a Beer.  The function is fired by an onclick event attached to the &lt;li&gt; object that we will look at a little later in the HTML.  shareBeer() takes a few arguments, all of which are information that will get passed to the final dialog and describe the Beer that someone is going to share.  Because I am not overly familiar with Javascript, and it made debugging extremely easy, I chose to pass the variables from step 1 to step 2 inside of hidden div elements in the HTML.  The divs were hidden with CSS (display:hidden;).</p>
<pre>function personSelected(person) {
FB.ui({
method: 'feed',
to: person,
name: $('#selected_beer_name').html(),
link: 'http://nationwidebarcrawl.com/link/',
picture: $('#selected_beer_image').html(),
caption: 'Free. As in Beer.',
description: '&lt;center&gt;Brewery: ' + $('#selected_beer_brewery').html() + '&lt;/center&gt;&lt;center&gt;Type: ' + $('#selected_beer_type').html() + '&lt;/center&gt;&lt;center&gt;Locality: ' + $('#selected_beer_locality').html() + '&lt;/center&gt;'
}, function(response) {
if (response &amp;&amp; response.post_id) {
alert('post published');
} else {
alert('post failed');
}
});
}
&lt;/script&gt;
</pre>
<p>This function is responsible for popping the &#8216;post to wall&#8217; dialog which is popped by calling the &#8216;feed&#8217; method of the FB.ui() Graph API function.  We again utilize Jquery to pull the values from the Beer object variables that we set inside of hidden divs.  This function is triggered by an onclick event on the &lt;li&gt; that we will look at later in the HTML.  The onlick event passes the Facebook id of the friend who occupies the clicked &lt;li&gt;.  The FB.ui call utilizes this argument as the &#8216;to&#8217; value for the call.  If you leave the &#8216;to&#8217; value blank, the dialog will default to posting to the requesting users feed.  Without this &#8216;to&#8217; argument, our Facebook App loses its ability to provoke social interaction, and thus, its value to the Facebook community.</p>
<p>The description utilizes the &lt;center&gt; tag to get line breaks in our post.  Currently, Facebook does not allow you to put line breaks in your post description, but wrapping each line inside of a &lt;center&gt;&lt;/center&gt; tag will display the content on separate lines.</p>
<pre>&lt;div id="friends"&gt;
&lt;div id="friends_header"&gt;&lt;/div&gt;
&lt;ul&gt;&lt;/ul&gt;
&lt;/div&gt;
&lt;div id="beers_page_header"&gt;&lt;a href="http://nationwidebarcrawl.com/beers/" target="_blank"&gt;&lt;img src="/media/images/facebook/beers_button.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;ul&gt;
{% for beer in beers %}&lt;li&gt;&lt;a href="#" onclick="shareBeer('{{ beer.mainphoto.get_singlebeer_url }}', 'http://nationwidebarcrawl.com/beers/{{ beer.slug }}', '{{ beer }}', '{{ beer.brewery }}', '{{ beer.type }}', '{{ beer.get_locality_display }}');"&gt;&lt;img src="{{ beer.mainphoto.get_singlebeer_url }}" /&gt;&lt;p&gt;{{ beer }}&lt;/p&gt;&lt;/a&gt;&lt;/li&gt;{% if forloop.counter|divisibleby:"4" and not forloop.last %}&lt;/ul&gt;&lt;ul&gt;{% endif %}{% endfor %}
&lt;/ul&gt;
&lt;div id="footer"&gt;&lt;a href="http://cloudcreativegroup.com/" target="_blank"&gt;&lt;img src="/media/images/facebook/footer_logo.png"&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div id="selected_beer_image"&gt;&lt;/div&gt;
&lt;div id="selected_beer_link"&gt;&lt;/div&gt;
&lt;div id="selected_beer_name"&gt;&lt;/div&gt;
&lt;div id="selected_beer_brewery"&gt;&lt;/div&gt;
&lt;div id="selected_beer_type"&gt;&lt;/div&gt;
&lt;div id="selected_beer_locality"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>The above HTML generates the entire 3 step process in a single page, embedded inside of a Facebook fan page, utilizing Jquery to require only the initial page load to facilitate the entire 3 step process of sharing a gift with a friend.</p>
<p>AN OPEN CALL TO FACEBOOK</p>
<p>Facebook, love the website.  In fact, it eats up a large amount of my daily time, but we have to have a talk about your API.  You guys have moved at an extremely fast pace over the last couple years, starting out as a College based social network and eventually expanding to encompass the whole world.  During this time, many developers have felt as though you haven&#8217;t put enough emphasis on keeping your API documentation up to date (and working for that matter).  I like how you guys have spent a lot of time trying to explain the concepts behind a lot of the inner workings of your API, but honestly, none of the documentation really helped me understand what was going on.</p>
<p>The one thing I think you guys could really improve, and quite easily, would be a full API reference.  If you&#8217;re not sure what one of those looks like, take a look at Google Maps API Version 3 reference here: <a href="http://code.google.com/apis/maps/documentation/javascript/reference.html" target="_blank">http://code.google.com/apis/maps/documentation/javascript/reference.html</a></p>
<p>With a fully documented API reference, you will see a lot more quality apps being developed for your platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/building-awesome-facebook-tabs-with-a-horribly-documented-api/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MediaTemple CentOS 5.5 (VE) Server Build &#8211; Django 1.3, Python 2.7, MySQL 5.5, PHP 5.3</title>
		<link>http://blog.hackedexistence.com/mediatemple-centos-5-5-ve-server-build-django-1-3-python-2-7-mysql-5-5-php-5-3</link>
		<comments>http://blog.hackedexistence.com/mediatemple-centos-5-5-ve-server-build-django-1-3-python-2-7-mysql-5-5-php-5-3#comments</comments>
		<pubDate>Thu, 04 Aug 2011 06:37:56 +0000</pubDate>
		<dc:creator>r3dfish</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Media Temple]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[MediaTemple]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Server Build]]></category>

		<guid isPermaLink="false">http://blog.hackedexistence.com/?p=175</guid>
		<description><![CDATA[This is an updated version of an older blog post outlining a full (VE) build for django.  I had to update my server due to incompatibilities between the latest version of WordPress and the versions of PHP/MySQL found in the &#8230; <a href="http://blog.hackedexistence.com/mediatemple-centos-5-5-ve-server-build-django-1-3-python-2-7-mysql-5-5-php-5-3">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.hackedexistence.com/wp-content/themes/twentyten/images/VEServer.JPG" alt="VE Server" width="1122" height="265" /></p>
<p>This is an updated version of an older blog post outlining a full (VE) build for django.  I had to update my server due to incompatibilities between the latest version of WordPress and the versions of PHP/MySQL found in the standard CentOS repos.</p>
<p><span style="color: #ff0000;">// SHOUTOUTS</span></p>
<p>Malcolm Frazier &#8211; (still) holding it down with the Linux knowledge.</p>
<p><span style="color: #ff0000;">// USER ACCOUNTS</span></p>
<p>The first step is to create a user account so you don&#8217;t have to use root</p>
<pre># useradd &lt;username&gt;
# passwd &lt;username&gt;</pre>
<p>Add a user group so we can setup the sudoers file and add our new account to the group</p>
<pre># /usr/sbin/groupadd &lt;new_group_name&gt;
# /usr/sbin/usermod -a -G &lt;new_group_name&gt; &lt;username&gt;</pre>
<p>I like to use the locate command a lot, so lets build the index of the file system that locate uses to search</p>
<pre># updatedb</pre>
<p>Setup the sudoers config file</p>
<pre># vim /etc/sudoers</pre>
<p>Add the following lines to the bottom of the file:</p>
<pre># Customizations
%&lt;new_group_name&gt;     ALL=(ALL)     ALL</pre>
<p>*** The above modification more or less gives all users in &lt;new_group_name&gt; the ability to do anything root can do, without the root password.  This is fine for building the server, but after the server is built, you should restrict the permission levels a little bit more.</p>
<p>At this point you should be able to exit ssh and log back in as your new user account.  You can use sudo &lt;command&gt; to execute commands as root, or use sudo -s as a replacement for su.</p>
<p><span style="color: #ff0000;">// UPGRADE PACKAGES SYSTEM WIDE</span></p>
<pre># yum upgrade</pre>
<p><span style="color: #ff0000;">// INSTALLING PYTHON 2.7</span></p>
<p>I&#8217;ve chosen to use Python 2.7 as my version of python for django.  CentOS 5.5 comes with Python 2.4 already installed.  I had some down time on a past project because I asked the techs at RackSpace to upgrade the version of Python on the server and they started by uninstalling Python 2.4.  The problem is that the yum package management system that CentOS uses is built on top of Python.  If you uninstall Python 2.4, you will not be able to use yum to install Python 2.7, or any other package at that point.  The solution is to install Python 2.7 in parallel to 2.4, have Django and all your other apps use the 2.7 install, and leave 2.4 to be used by yum and the underlying OS.</p>
<p>Before we start compiling, lets install the GCC compiler:</p>
<pre># yum install gcc</pre>
<p>This will prevent the following error from occurring if you try to compile python without gcc:</p>
<pre>configure: error: in `/root/Source/Python-2.7':
configure: error: no acceptable C compiler found in $PATH</pre>
<p>Additionally, you&#8217;ll want to install a few extra optional dependencies for Python</p>
<pre># yum install readline-devel gdbm-devel sqlite-devel
# yum install openssl-devel ncurses-devel bzip2-devel</pre>
<p>Theres a great tutorial on installing Python 2.7 on CentOS 5 <a href="http://toey.tc20.net/2010/08/04/install-python-2-7-gevent-on-centos-5-x86_64/" target="_blank">here</a>.</p>
<p>Instead of using /usr/src/ for all the source code, I created /root/Source/ to hold the source from all the packages.  Inside of Source, download and extract Python 2.7:</p>
<pre># wget http://www.python.org/ftp/python/2.7/Python-2.7.tar.bz2
# tar -xvjf Python-2.7.tar.bz2
# cd Python-2.7
# ./configure --help</pre>
<p>Read through the configure help and see if there are any options you want to enable or customize.  Then run the configuration script:</p>
<pre># ./configure --prefix=/usr/local/python2.7 --enable-shared</pre>
<p>&#8211;prefix tells python to install to a directory other than the default.  This is necessary if we want to run both 2.7 and 2.4 side by side.</p>
<p>&#8211;enable-shared will prevent an error later on when trying to build mod_wsgi.  If you get the following error when building mod_wsgi, recompile and reinstall python with &#8211;enable-shared:</p>
<pre>/usr/local/python2.7/lib/libpython2.7.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
apxs:Error: Command failed with rc=65536
make: *** [mod_wsgi.la] Error 1</pre>
<p>Now its time to build and install Python:</p>
<pre># make
# make install</pre>
<p><span style="color: #ff0000;">// SETUP ENVIRONMENT VARIABLES</span></p>
<pre>$ vim ~/.bashrc</pre>
<p>Add the following to the bottom of .bashrc:</p>
<pre># User specific aliases and functions
alias python='/usr/local/python2.7/bin/python'</pre>
<p>Log out, Log back in, and you should be able to execute the new Python 2.7</p>
<pre>$ python
Python 2.7
&gt;&gt;&gt;</pre>
<p><span style="color: #ff0000;">// INSTALLING PIL (PYTHON IMAGING LIBRARY)</span></p>
<p>At this point, if you install PIL without first satisfying the optional dependencies, PIL will be built without libjpeg and zlib (png support).  The output of python setup.py install would be:</p>
<pre>*** TKINTER support not available
*** JPEG support not available
*** ZLIB (PNG/ZIP) support not available
*** FREETYPE2 support not available
*** LITTLECMS support not available</pre>
<p>Unfortunately, PIL doesn&#8217;t complain very loudly and will still install a working version that will not be able to handle .jpg or .png files.  If you install PIL without the header libraries for the dependencies present, you will receive the following error in django&#8217;s admin when trying to upload an image file:</p>
<pre>Upload a valid image. The file you uploaded was either not an image or a corrupted image.</pre>
<p>You can further verify if the proper support is compiled in from the shell:</p>
<pre>$ python
&gt;&gt;&gt; from PIL import Image
&gt;&gt;&gt; i = Image.open("/path/to/some/image.jpg")
&gt;&gt;&gt; i.verify()
&gt;&gt;&gt; i.load()
Traceback (most recent call last):
File "&lt;console&gt;", line 1, in &lt;module&gt;
File "/usr/local/python2.7/lib/python2.7/site-packages/PIL/ImageFile.py", line 189, in load
d = Image._getdecoder(self.mode, d, a, self.decoderconfig)
File "/usr/local/python2.7/lib/python2.7/site-packages/PIL/Image.py", line 385, in _getdecoder
raise IOError("decoder %s not available" % decoder_name)
IOError: decoder jpeg not available</pre>
<p>You can see from the above error that the jpeg decoder is not available.  If you&#8217;ve already installed PIL, uninstall it.  If you havn&#8217;t installed PIL yet, this will save you a lot of time (:</p>
<pre># yum install zlib zlib-devel
# yum install libjpeg libjpeg-devel
# yum install freetype freetype-devel</pre>
<p>Django relies heavily on the PIL.  Again in our /root/Source directory, install PIL:</p>
<pre># wget http://effbot.org/downloads/Imaging-1.1.7.tar.gz
# tar xvfz Imaging-1.1.7.tar.gz
# cd Imaging-1.1.7
# python setup.py build_ext -i</pre>
<p>Check to make sure that libjpeg and zlib were found:</p>
<pre>*** TKINTER support not available
--- JPEG support available
--- ZLIB (PNG/ZIP) support available
--- FREETYPE2 support available
*** LITTLECMS support not available</pre>
<p>Run a test to make sure that everything works:</p>
<pre># python selftest.py
--------------------------------------------------------------------
PIL 1.1.7 TEST SUMMARY
--------------------------------------------------------------------
Python modules loaded from ./PIL
Binary modules loaded from ./PIL
--------------------------------------------------------------------
--- PIL CORE support ok
*** TKINTER support not installed
--- JPEG support ok
--- ZLIB (PNG/ZIP) support ok
--- FREETYPE2 support ok
*** LITTLECMS support not installed
--------------------------------------------------------------------
Running selftest:
--- 57 tests passed.</pre>
<p>And finally, install PIL:</p>
<pre># python setup.py install</pre>
<p>You should now be able to import PIL inside of python:</p>
<pre>$ python
&gt;&gt;&gt;import PIL
&gt;&gt;&gt;</pre>
<p><span style="color: #ff0000;">// INSTALLING MYSQL</span></p>
<p>Enable the Remi Repository to install MySQL 5.5 and PHP 5.3.  More information about the Remi Repository can be found <a href="http://rpms.famillecollet.com/" target="_blank">here</a>.</p>
<pre># wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm
# rpm -Uvh epel-release-5-4.noarch.rpm
# rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
# yum --enablerepo=remi list mysql mysql-server
# yum --enablerepo=remi install mysql.x86_64 mysql-server.x86_64</pre>
<p>Start the MySQL Server:</p>
<pre># /etc/init.d/mysqld start</pre>
<p>In order to set the initial root password, and get rid of the built in tables/user accounts for testing, run:</p>
<pre># /usr/bin/mysql_secure_installation</pre>
<p>Follow the instructions, pick your customizations &#8230; then make sure MySQL is installed and working:</p>
<pre># mysql -u root -p
Enter password:
mysql&gt; SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.5.14    |
+-----------+
1 row in set (0.00 sec)</pre>
<p>Add MySQL to the proper run level:</p>
<pre># /sbin/chkconfig mysqld on</pre>
<p><span style="color: #ff0000;">// MYSQL-PYTHON GAP</span></p>
<p>Next, you need to install MySQL-python, the python interface to MySQL.  If you do not install MySQL-python, later on when you try to do a &#8216;python manage.py syncdb&#8217; django will not be able to communicate with MySQL and will throw the following error:</p>
<pre>django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb</pre>
<p>Setuptools is a required dependency of MySQL-python.  Download it from <a href="http://pypi.python.org/pypi/setuptools" target="_blank">here</a> and install it, setting the prefix to our freshly installed python2.7</p>
<pre># sh setuptools*.egg --prefix=/usr/local/python2.7</pre>
<p>Now install the MySQL headers from the Remi repo, then install MySQL-python:</p>
<pre># yum --enablerepo=remi install mysql-devel.x86_64
# wget http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz/download
# tar -zxvf MySQL-python-1.2.3.tar.gz
# cd MySQL-python-1.2.3
# python setup.py build
# python seutp.py install</pre>
<p>At this point django should be able to talk to MySQL using MySQL-python.</p>
<p><span style="color: #ff0000;">// INSTALLING APACHE</span></p>
<p>Next we have to install our web server, Apache.  There&#8217;s a pretty straight forward tutorial on this <a href="http://www.cyberciti.biz/faq/linux-install-and-start-apache-httpd/" target="_blank">here</a>.</p>
<pre># yum install httpd
# /sbin/chkconfig httpd on
# /etc/init.d/httpd start
Starting httpd:                                            [  OK  ]</pre>
<p>At this point, you should spend some quality time with /etc/httpd/conf/httpd.conf to really squeeze some power out of apache.</p>
<p><span style="color: #ff0000;">// INSTALLING DJANGO</span></p>
<p>The django install docs can be found <a href="https://docs.djangoproject.com/en/1.3/topics/install/" target="_blank">here</a>.</p>
<pre># wget http://www.djangoproject.com/download/1.3/tarball/
# tar xzvf Django-1.3.tar.gz
# cd Django-1.3
# python setup.py install
$ python
&gt;&gt;&gt; import django
&gt;&gt;&gt;</pre>
<p><span style="color: #ff0000;">// INSTALLING PHPMYADMIN</span></p>
<p>PhpMyAdmin is a web interface for controlling your MySQL database.</p>
<pre># yum install phpmyadmin</pre>
<p>This will install PHP as a dependency, but you will still need to setup PHP.  Setup the PHP Cookie:</p>
<pre># vim /usr/share/phpmyadmin/config.inc.php</pre>
<p>Add the Python Shared Libraries</p>
<pre># vim /etc/ld.so.conf.d/python2.7.conf</pre>
<p>add the following line:</p>
<pre>/usr/local/python2.7/lib</pre>
<p>Create necessary links and cache the new libraries:</p>
<pre># ldconfig</pre>
<p><span style="color: #ff0000;">// INSTALLING MOD_WSGI</span></p>
<p>mod_wsgi is the link between apache and django.  It is responsible for taking the web request from apache and getting it to your django app for handling.  The mod_wsgi installation docs are a great resource, they can be found <a href="http://code.google.com/p/modwsgi/wiki/InstallationInstructions" target="_blank">here</a>.</p>
<p>First, we need to install the source code for apache, as mod_wsgi needs it to build.  Install the httpd-devel package, which will install the headers for apache.</p>
<pre># yum install httpd-devel</pre>
<p>Get and install mod_wsgi</p>
<pre># wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
# tar -zxvf mod_wsgi-3.3.tar.gz
# cd mod_wsgi-3.3
# ./configure --help
# ./configure --with-python=/usr/local/python2.7/bin/python
# make
# make_install</pre>
<p><span style="color: #ff0000;">// POINT APACHE AT DJANGO USING MOD_WSGI</span></p>
<p>First, you need to tell apache which version of python to use so it doesn&#8217;t use the default 2.4:</p>
<pre># vim /etc/httpd/conf/httpd.conf</pre>
<p>Add the following to the bottom of the file:</p>
<pre># Python Versioning Control for mod_wsgi
WSGIPythonHome /usr/local/python2.7</pre>
<p>Make sure you load mod_wsgi in httpd.conf at the end of the LoadModule section</p>
<pre>LoadModule wsgi_module modules/mod_wsgi.so</pre>
<p>Then restart apache</p>
<pre># /etc/init.d/httpd restart</pre>
<p>Now you can configure your virtual hosts in apache to point to a &#8216;django.wsgi&#8217; file thats specific to each django project you create.  Add the WSGIScriptAlias to your Virtual Host configuration file:</p>
<pre>WSGIScriptAlias / /path/to/your/django/project/django_project_name/apache/django.wsgi</pre>
<p>Add the &#8216;apache&#8217; directory to your django project, and create the django.wsgi file inside the apache directory:</p>
<pre>$ cd /path/to/your/django/project/django_project_name/
$ mkdir apache
$ cd apache
$ vim django.wsgi</pre>
<p>Copy the following into the django.wsgi file:</p>
<pre>import os
import os.path
import sys

sys.path.append('/path/to/project/root')

os.environ['PYTHON_EGG_CACHE'] = '/path/to/a/directory/for/egg_cache'
os.environ['DJANGO_SETTINGS_MODULE'] = 'your_django_project_name.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()</pre>
<p>If you&#8217;ve made it this far, you should have a working django install.</p>
<pre>(:</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.hackedexistence.com/mediatemple-centos-5-5-ve-server-build-django-1-3-python-2-7-mysql-5-5-php-5-3/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
