YouTube Linkedin Twitter
 

One of the nice features in MacOSX is the use of Spotlight. I hardly use icons anymore and just hit command+space and type what I need. While I am in Gentoo or Windows XP, I sorely miss this functionality. Well today I started to look and found a nice tool called Launchy.

This tool supports skinning and plugins to enhance the already nice tool. What is nice is by default I can do math in it like I can do in spotlight. When I want to call the tool I hit alt+space and it comes up. I will continue to play with this tool but so far I love it.

I would like to take an opportunity to show you an example of how to developer a simple php contact page. I will not use css or anything like that for this tutorial. Just quick and dirty using the php mail function. Lets watch a video, explaining the process



Here is the code

<html>
    <head>
        <title>Contact Us</title>
    </head>
    <body>
        <?php
            if($_SERVER['REQUEST_METHOD'] != 'POST') {
                $self = $_SERVER['PHP_SELF'];
        ?>
            <form method="post" name="contactForm" action="<?php echo $self; ?>">
                <table>
                    <tr>
                        <td>Name: </td>
                        <td><input type="text" name="cusName" id="cusName" /></td>
                    </tr>
                    <tr>
                        <td>Email: </td>
                        <td><input type="text" name="cusEmail" id="cusEmail" /></td>
                    </tr>
                    <tr>
                        <td>What can I do for you? </td>
                        <td><textarea id="reason" name="reason" rows="8" cols="40"></textarea></td>
                    </tr>
                    <tr>
                        <td><input type="submit" value="Submit" /></td>
                        <td><input type="reset" value="Reset" /></td>
                    </tr>
                </table>
            </form>
        <?php
            } else {
                $name = $_POST['cusName'];
                $emailFrom = $_POST['cusEmail'];
                $reason = $_POST['reason'];
                $emailTo = "john@jcwebconcepts.net";
                $subject = "Filled in form from website";

                $header = "From: $name <$emailFrom>\r\nReply-To: $emailFrom\r\n";
                $header .= "MIME-Version: 1.0\r\n";
                $header .= "Content-type:text/html;charset=iso-8859-1\r\n";

                $message = "From: #name, Email: $emailFrom<br /><hr />$reason";

                mail($emailTo, $subject, $message, $header);

                echo "Thank you for contacting us. Someone will get back to you as soon as we can. Thank you.";
            }
        ?>
    </body>
</html>

As many bloggers have already done, we have lost someone this past week that was dear to a lot of Mac fanboys. He will be missed but I am sure he was working on his successor for a long time. I wonder how many people added to their Netflix queue, “Pirates of Silicon Valley”? As I am sure everything in that movie had some things that did not happen, Steve gained my respect. So good luck Steve to where ever the road takes you. Good bye.

Blogofile is a simple blogging engine that brings something nice without the use of a database. I have been testing this out and I am starting to like this. I have even been thinking of replacing it with this. I am really enjoying this framework. Go ahead and watch this video below. After the video I will post the step by step instructions just in case you do not want to watch how to do it.



Here is the steps:

On the server

Install the python tool easy_install

sudo apt-get install python-setuptools

Install blogofile

sudo easy_install blogofile

If you do not have Git

sudo apt-get install git

Go to where you want the git repo to be installed and do the following

mkdir blogofile.git
cd blogofile.git
git --bare init

Now configure the post-receive file

vim hooks/post-receive
unset GIT_DIR
cd /path/to/where/clone/repo/is
git pull
blogofile build
cp -a _site/* /var/www

Local computer

Now lets go to your local computer to where you want the source files and do the following

mkdir blogofile
cd blogofile
blogofile init simple_blog
git init
git add .
git commit -m "Some message"
git remote add origin username@yourservername:/path/to/repo/somerepo.git
git push origin master

Now we need to setup our exclude file so we do not commit the _site folder.

vim .git/info/exclude

Now add this to the bottom of the file

_site/*
_site/

Now if you want to test out your blog you will do the following:

blogofile build
blogofile serve 8080

The 8080 can be any unused port you like. I hope this helped you as much as it has helped me.

One thing that I have always wanted to do was dual boot my Mac computer so I could run Linux on real hardware instead of emulation. This tutorial is going to show you how to accomplish this. A thing to note is you can do this with any Linux distro. Also the Mac that was used in this tutorial was a 13 inch White MacBook 5,2 version.

Things needed for this process:

  • Boot manager: rEFIt
  • Gentoo minimal ISO: Gentoo x86
  • USB keyboard and mouse
  • Wired internet connection

Partition HD

  • Mac Already installed

    • Open boot camp assistant
    • Set the partition size to the size you want
    • When this is done go ahead and click quit and install later
    • At this point you are done with partitioning your drive
  • Mac not installed

    • Turn on your Mac and hold option key down until the selector comes up
    • Insert your Mac CD in and wait for it to show. Click on it
    • When cd is loaded you will what to open disk utilities in the menu up top
    • Click on your hard drive and then on the right click the partition tab
    • Under volume scheme you want to select two partitions
    • !!!!!!!Need to work on it ending of this part

You are down with the drive partition now. We now need to move into the boot loader tool that is going to help us along the way

rEFIt

  • Now go ahead and install the rEFIt appliacation
  • Note: There is nothing fancy with this install
  • Now reboot to verify that the boot loader app comes up. If it doesn’t, try rebooting again

You are now done with the boot loader and we are now ready to install Gentoo

Installing Gentoo

After downloading and burning the ISO file to a disc you are ready, you are ready to start. Plug in your USB keyboard for now, insert the gentoo disc you burnt and restart. Remember to hold option key down so you get the option to boot to your CD. Now I am not going to go thru all the steps to install because this is well documented on Gentoo’s website. This can be found here!

So lets highlight the sections that you need to make some adjustments since you are not doing a typical dual boot on a regular PC

Boot parameters

When you get to the book parameters, you will want to type the following:

gentoo maxcpus=1 vga=791

Partition table

Here is the partition setup I have and you are welcome to follow it. Now yours might be different but should be close. If you are a cfdisk fan like I you will need to open your sda parition in fdisk, to delete the partition created by apple. Also do not worry about the warnings about unsupported GPT table. Its ok, so here is what my partitions looks like after I am done setting up the partitions that the guide tells us too

  • sda1 – GPT
  • sda2 – Mac HFS/HFS+
  • sda3 – Linux root
  • sda4 – Linux swap

After you are done with this you will want to type the following:

modprobe hid-apple
This is done so your drivers get loaded for the apple keyboard. At this point you can remove the USB keyboard.

When downloading the stage3, make sure you download the i686 one

Now I do not use the genkernel. If you follow the install guide you use ext2 for the boot partition. So for some reason the kernel does not have this enabled so that is the only thing at this time I enable, beyond what is already enabled. After you exit you will want to back up the .config file. I like to do this so I can keep my kernel config files backed up.

When you are setting up your grub or lilo, you want to make sure on the kernel line that you add the following:

maxcpus=1

After Gentoo install

After you are done installing and you reboot you will want to leave your reboot until you get to the rEFIt menu. It does take a little bit to get to it so do not be too concerned. When you get there select the partitioning tool. You will get an error but that is ok. Hit any key and shut off your Mac. Now turn it back on and when you hear the ding hold the option key. Select the hard drive that says Windows. you should boot into Gentoo. If so then clap your hands. Log in as root and restart your computer. Try going into your Mac OS. If you can then you can go to rEFIt site and get the uninstall directions.
Congratulations, you have just installed and got Gentoo somewhat working on your MacBook.

This is part 6 of my using Linux for everything blog posts. Some time ago, if you wanted to listen to music or watch videos, you ran into issues. Today’s Linux has changed all that. Honestly the only issues I have had is that my iTunes purchased content cannot be played. This is hugh since I do a lot of purchasing of music on iTunes. If you do not use iTunes then this is not an issue.
So with this being said I would say that I could not make the switch to Linux fully since I would lose the ability to watch my movies and listen to my music. Maybe someday this block will not be here.

Version control is something that a lot of developers use. I have been using SVN for the longest time and ignoring Git. I found it confusing and I just left it alone. I did the same thing before I started to use SVN. I thought I would have learned by now. So take a look at the video below and I will also put the steps at the end of the post.



On where the master git server will be hosted

mkdir /home/git/somerepo.git
cd /home/git/somerepo.git
git --bare init

Now lets go to your computer

mkdir somerepo.git
cd somerepo.git
git init
**Create a README file or you can type: touch README
git add .
git commit -m "Some message"
git remote add origin username@yourservername:somerepo.git
git push origin master

Now this setup is just using the users that are already on the server. You can setup that you do not need to type in password. You can create just a git user. I hope that this tutorial has helped.

This is part 5 of my using Linux for everything blog posts. As a web developer I started to use Photoshop. As I started to use Linux I realized that I could not use Photoshop to its fullest. So I then heard of GIMP. It is a nice tool and it can get the job done. I just did not like the interface that came with it. I also missed some features that were in photoshop.

As GIMP has grown it has started to become an app I could see myself using. So for this part I would feel comfortable switching to pure Linux.

This is part 4 of my using Linux for everything blog posts. As of right now my main job is writing Selenium automation using Java and my side job is web development. So could Linux handle all of this with no issues. The answer is no and I will tell you why. As a web developer selenium developer I need to test sometimes against Internet Explorer and or Safari. You can look in my previous post to read the reasons to why this is not possible for me to emulate. Other than that I can install Eclipse and Java in Linux with no issues. So writing my code I can be in Linux.

Web developing in Linux I again have no issues. I can pull up VIM and I will be just fine. Even though I might miss TextMate since I have recently fell in love with it.

So this is part 3 of my replace Linux everywhere blog. In this part we will be discussing web browsing. So looking at browsers the only major browser that is not in Linux is Internet Explorer. Now yes I could install Wine or some other emulator to solve this. But this is not going to solve this issue. Using Wine there is something in me that states are we really seeing Internet Explorer.  Now the only reason I need internet explorer is for work. With me at the time doing QA work I need to test the quality of a website in Internet Explorer. Now to be honest I have the same issue in Mac so Linux is not alone here.

So, is there something I am missing here? Is there an solid option that would allow me to get the real Internet Explorer experience? Look forward to hearing your comments.