How to compile nginx / fcgi / PHP from scratch in CentOS 5 the CORRECT way

There was no single guide that provided this answer, so here’s my own after tinkering around for the entire day on CentOS 5.4.

When I installed CentOS, I did not install a desktop environment, and only added development libraries and tools.

Update your packages
Assuming this is a fresh CentOS install, you’ll want to update your packages:


yum update

Say ‘y’ to every question asked. The update process may take some time depending on the speed of your connection. After this is complete, proceed below:

Download Nginx source
http://wiki.nginx.org/NginxInstall

As of this writing, I downloaded the development 0.8.36 version.

Configre Nginx
Where I have extracted the Nginx source to, I used the compile-time option #3 found at:

http://wiki.nginx.org/NginxInstallOptions


./configure 
  --prefix=/usr 
  --conf-path=/etc/nginx/nginx.conf 
  --http-log-path=/var/log/nginx/access_log 
  --error-log-path=/var/log/nginx/error_log 
  --pid-path=/var/run/nginx.pid 
  --http-client-body-temp-path=/var/tmp/nginx/client 
  --http-proxy-temp-path=/var/tmp/nginx/proxy 
  --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi 
  --with-md5-asm --with-md5=/usr/include 
  --with-sha1-asm 
  --with-sha1=/usr/include 
  --with-http_realip_module 
  --with-http_ssl_module 
  --with-http_perl_module 
  --with-http_stub_status_module

Compile and Install Nginx
In the same directory, perform


make install

To install Nginx.

Create The Nginx Service File

edit /etc/init.d/nginx in your editor of choice and paste in the following:


#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig:   - 85 15
# description:  Nginx is an HTTP(S) server, HTTP(S) reverse 
#               proxy and IMAP/POP3 proxy server
# processname: nginx
# config:      /usr/local/nginx/conf/nginx.conf
# pidfile:     /usr/local/nginx/logs/nginx.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

nginx="/usr/sbin/nginx"
prog=$(basename $nginx)

NGINX_CONF_FILE="/etc/nginx/nginx.conf"

lockfile=/var/lock/subsys/nginx

start() {
    [ -x $nginx ] || exit 5
    [ -f $NGINX_CONF_FILE ] || exit 6
    echo -n $"Starting $prog: "
    daemon $nginx -c $NGINX_CONF_FILE
    retval=$?
    echo
    [ $retval -eq 0 ] && touch $lockfile
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc $prog -QUIT
    retval=$?
    echo
    [ $retval -eq 0 ] && rm -f $lockfile
    return $retval
}

restart() {
    configtest || return $?
    stop
    start
}

reload() {
    configtest || return $?
    echo -n $"Reloading $prog: "
    killproc $nginx -HUP
    RETVAL=$?
    echo
}

force_reload() {
    restart
}

configtest() {
  $nginx -t -c $NGINX_CONF_FILE
}

rh_status() {
    status $prog
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        rh_status_q && exit 0
        $1
        ;;
    stop)
        rh_status_q || exit 0
        $1
        ;;
    restart|configtest)
        $1
        ;;
    reload)
        rh_status_q || exit 7
        $1
        ;;
    force-reload)
        force_reload
        ;;
    status)
        rh_status
        ;;
    condrestart|try-restart)
        rh_status_q || exit 0
            ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}"
        exit 2
esac


Save the file.

Register the nginx service


chmod +x /etc/init.d/nginx
chkconfig nginx on

#This portion exists because nginx will not start without it
mkdir /var/tmp/nginx

http://www.hikaro.com/linux/centos/nginx-init-script.html is the original source with some modifications.

Download PHP and Install
http://www.php.net/downloads.php

Extract the source to a directory.

I have my PHP configured with the following options:


yum install libtool-ltdl-devel
yum install openssl-devel

./configure --with-zlib --with-bz2 --with-curl --with-curlwrappers --enable-exif --enable-ftp --with-gd --with-ldap --enable-mbstring --with-mcrypt --with-mysql=mysqlnd --with-pdo-mysql=mysqlnd --enable-soap --enable-sqlite-utf8 --enable-zip --with-openssl

Compile and Install PHP
In the same directory, perform


make install

Copy the php.ini file
Still in the PHP source directory.


cp php.ini-production /etc/php.ini

You should edit the php.ini to match your wanted PHP configuration.

Download Spawn-Fcgi and install
(http://elasticdog.com/2008/02/howto-install-wordpress-on-nginx/ was very useful for this portion)

Spawn-Fcgi comes from the lighttpd project. We are not installing the lighttpd server, but one of the components from the project.

Download spawn-fcgi from:
http://redmine.lighttpd.net/projects/spawn-fcgi/news

As of this writing, I downloaded version 1.6.3. Extract the source to a directory, and change to it.

Configure and install with


./configure
make install

spawn-fcgi should now be installed to /usr/local/bin.

Create the service file for PHP Fastcgi
edit /etc/init.d/fastcgi in the editor of your choice and paste in the following:


#!/bin/sh
#
# php-cgi - php-fastcgi swaping via  spawn-fcgi
#
# chkconfig:   - 85 15
# description:  Run php-cgi as app server
# processname: php-cgi
# config:      /etc/sysconfig/phpfastcgi (defaults RH style)
# pidfile:     /var/run/php_cgi.pid
# Note: See how to use this script :
# http://www.cyberciti.biz/faq/rhel-fedora-install-configure-nginx-php5/
# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "$NETWORKING" = "no" ] && exit 0

spawnfcgi="/usr/local/bin/spawn-fcgi"
php_cgi="/usr/local/bin/php-cgi"
prog=$(basename $php_cgi)
server_ip=127.0.0.1
server_port=9000

#####EDIT THIS TO MATCH YOUR USER AND GROUP
server_user=marketdark
server_group=marketdark
############################
server_childs=5
pidfile="/var/run/php_cgi.pid"

# do not edit, put changes in /etc/sysconfig/phpfastcgi
[ -f /etc/sysconfig/phpfastcgi ] && . /etc/sysconfig/phpfastcgi

start() {
    [ -x $php_cgi ] || exit 1
    [ -x $spawnfcgi ] || exit 2
    echo -n $"Starting $prog: "
    daemon $spawnfcgi -a ${server_ip} -p ${server_port} -u ${server_user} -g ${server_group} -P ${pidfile} -C ${server_childs} -- "${php_cgi} -c /etc/php.ini"
    retval=$?
    echo
    return $retval
}

stop() {
    echo -n $"Stopping $prog: "
    killproc -p ${pidfile} $prog -QUIT
    retval=$?
    echo
    [ -f ${pidfile} ] && /bin/rm -f ${pidfile}
    return $retval
}

restart(){
        stop
        sleep 2
        start
}

rh_status(){
        status -p ${pidfile} $prog
}

case "$1" in
    start)
        start;;
    stop)
        stop;;
    restart)
        restart;;
    status)
        rh_status;;
    *)
        echo $"Usage: $0 {start|stop|restart|status}"
        exit 3
esac

Save the file.

Register the fastcgi service


chmod +x /etc/init.d/fastcgi
chkconfig fastcgi on

Test:


[root@localhost init.d]# service fastcgi start
Starting php-cgi: spawn-fcgi: child spawned successfully: PID: 9146
Starting fastcgi:                                            [  OK  ]

Configure Nginx for FastCGI and PHP
Edit the file /etc/nginx/fastcgi_params

And make sure the file looks like this
(From http://nakedtrout.com/site-performance/nginx-php-fpm-apc-awesome-wordpress-performance/42063


fastcgi_param  QUERY_STRING       $query_string;
fastcgi_param  REQUEST_METHOD     $request_method;
fastcgi_param  CONTENT_TYPE       $content_type;
fastcgi_param  CONTENT_LENGTH     $content_length;

fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
fastcgi_param  REQUEST_URI        $request_uri;
fastcgi_param  DOCUMENT_URI       $document_uri;
fastcgi_param  DOCUMENT_ROOT      $document_root;
fastcgi_param  SERVER_PROTOCOL    $server_protocol;

fastcgi_param  GATEWAY_INTERFACE  CGI/1.1;
fastcgi_param  SERVER_SOFTWARE    nginx/$nginx_version;

fastcgi_param  REMOTE_ADDR        $remote_addr;
fastcgi_param  REMOTE_PORT        $remote_port;
fastcgi_param  SERVER_ADDR        $server_addr;
fastcgi_param  SERVER_PORT        $server_port;
fastcgi_param  SERVER_NAME        $server_name;

# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_param  REDIRECT_STATUS    200;

fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_intercept_errors on;

Save the file.

Edit the file /etc/nginx/nginx.conf

My file looks like this:
(Source: http://interfacelab.com/nginx-php-fpm-apc-awesome/)



#CHANGE THIS TO THE USER TO RUN THE SERVER UNDER
user  marketdark;
#####################
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       80;
        server_name  localhost;

        location / {
            #CHANGE THIS TO THE PATH TO YOUR WEB ROOT DIRECTORY
            root   /var/www/marketdark;

            index  index.html index.htm index.php;

            # if file exists return it right away
            if (-f $request_filename) {
                    break;
            }

            # otherwise rewrite the fucker
            if (!-e $request_filename) {
                    rewrite ^(.+)$ /index.php$1 last;
                    break;
            }

        }

        # if the request starts with our frontcontroller, pass it on to fastcgi
        location ~ ^/index.php
        {
                fastcgi_pass 127.0.0.1:9000;
   
                #CHANGE THIS TO THE PATH TO YOUR WEB ROOT DIRECTORY
                fastcgi_param SCRIPT_FILENAME /var/www/marketdark$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
        }

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        location ~ .php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
            include        fastcgi_params;
        }

    }
}

Start nginx
Test:


[root@localhost init.d]# service nginx start
Starting nginx:                                            [  OK  ]

Test your install

Where you have defined your web directory path (where I have it noted #CHANGE THIS TO THE PATH TO YOUR WEB ROOT DIRECTORY) ,
create an index.php file with the following:




Now, figure out the IP of your server and go to it in a browser (for example, since I have my centOS installed on hyper-v under a private NAT, it would be http://http://10.1.10.10/).

At this point you should see the PHP information page!

Native Compile for PL/SQL on Windows Oracle 10g R2 x64

I couldn’t find any definitive guides on how to compile PL/SQL natively on Windows, so after reading lots of documentation, I finally managed to figure it out. You will need the following:

- Visual Studio .NET 2003. .NET 2005 does not work (at least from what I’ve read), and if you use the x64 version of Oracle, MinGW will not work either. It’s gotta be Visual Studio .NET 2003 with the C++ component installed (ALL components, including the unchecked win platform one)
- Microsoft SDK for Windows. Our boxes are Windows Server 2003 R2, so I downloaded the corresponding SDK for it.

- Important: Make sure when you install the Microsoft SDK, you install it into a directory called ‘C:Program FilesMicrosoft Platform SDK’. The default will be something like ‘C:Program FilesMicrosoft Platform SDK for Windows Sever 2003 R2′; you do not want this! Oracle will look specifically for the directory named ‘C:Program FilesMicrosoft Platform SDK’.

- Important: Make sure you have enough RAM to increase your SGA and PGA memory size. I’ve had cases where I’ve used native compilation only to find that the native version runs slower than the interpreted complation! Or worse, your programs will just crash.

Install both, and open up a sqlplus session (probably under the ‘system’ user), and run the following:


   alter system set plsql_native_library_dir='C:oracledb10gnative' scope=both;
   alter system set plsql_native_library_subdir_count=5 scope=both;
   alter system set plsql_code_type='NATIVE';

- plsql_native_library_dir should be pointing to a directory you specify. I created a ‘native’ directory in my Oracle installation and pointed it there. All the compiled PL/SQL will go into that directory.
- plsql_native_library_subdir_count determines how many directories to use when generating the compiled objects. The reason why this exists is if you have a large amount of procedures / packages to be compiled (large as in > 10,000), there will be I/O issues if you store all the compiled items in one directory. If you specify the count to be more than one, then each compiled item will be put in a subdirectory, round-robin style.
- Since plsql_native_library_subdir_count=5 in the example above, you need to manually create 5 directories in the ‘native’ directory created, called dn (where n is a number starting with 0 to subdir_count) ie:

C:Oracledb10gnatived0
C:Oracledb10gnatived1

C:Oracledb10gnatived4

At this point, try compiling your PL/SQL packages or procedures. You can check your subdirectories to see that things are being compiled.

Congrats! You should now have a (slightly) speedier Oracle system. Unfortunately, there are no speed improvements using native compilation for SQL statements. Instead, you need to do your standard optimization techniques for your schemas, such as creating proper indexes, partitions, etc. If you use heavy algorithms PL/SQL, native compilation will benefit this most.

And, if in the event you want to switch out of native compilation, use the following:

ALTER SYSTEM SET plsql_compiler_flags = 'INTERPRETED';
ALTER SYSTEM set plsql_code_type='INTERPRETED';

For more information, see the Oracle PL/SQL NComp document.

The CORRECT Way to Succeed in College

YAY!

So You Want to Be Successful After College

I felt I had to write this article after seeing countless college graduates/friends have issues finding jobs. It can happen to anyone, liberal arts to engineering (However, I find that liberal art graduates have greater difficulty in finding jobs). This is my personal guide on how to do it right. My article will provide concrete examples from my own experiences, where things go right and wrong.

Number One Mistake To Make

I’ve encountered many college students who have this perception that they automatically get a job after they obtain their degree. Not true. The degree is not a golden ticket to a job. It will help you in certain situations where corporations may require it as a base qualification.

Think of the degree like having a high SAT score. Although it’s not the same at all, but like many people who have high SAT scores, there are many people who also have a degree.

So, when someone looks at a set of resumes, and everyone has a degree, how do they figure out who to hire?

Things You Need To Do In School

Aside from ensuring that you pass your classes and graduate, there are several factors aside from your degree that will determine your marketability – the ability to sell yourself to an employer.

Make Connections

Connections will be your lifeline to finding a job. Getting to know people whether at parties, clubs, or any social gathering is important as you’ll never know who you’ll meet. The more people that know you, your talents, and can vouch for your abilities, the higher your chances of getting connections for jobs.

Joining campus clubs are usually one way to get connections – many of them have liaisons to companies in the field, and I’ve seen many clubs hold events where a representative from such company will visit the club and talk about job opportunities, and accept resumes.

Example

Prior to my years of experience, I used to party often (as hard as it is to believe now); this included nightclubs, social gatherings, mixers (business networking parties), etc. Out of the many parties, there were two specific people I met  that helped pave my path:

- I was having a drink with an software engineer I’ve never met, and we ended up talking about our projects (I’ll talk about projects later), and exchanged information at the end of the night. One month later, without ever having any contact with him, he randomly IMs me asking if I wanted an internship at the company he worked for. I accepted the offer, where I began to expand my software engineering knowledge by working in my first startup.

Being there helped me move on to NASA, where being there helped me get a job at Stanford.

- A female who did not seem like it, but she was heavily into old-skool hip-hop music, and even performed in a hip-hop group. At that time, I had negative preconceptions about hip-hop, and she invited me to watch her group. Accepting the offer, I visited her and her group the following week, and got a great lesson in the history of hip-hop, and the emergent subcultures that branched from it. By the end of the day, I was hooked, and ended up joining the group, learning routines for one full summer until they had to return to Japan (they were all visiting Japanese people).

Because of them, I love to dance, even though I’m horrible at it.

Demonstrate Passion

I once went to a Stanford admissions Q&A as I was interested in transfering to Stanford at the time. The number one response from admissions when it came to the application was, “Show us your passion!”

That phrase is not just applicable to college admission essays, but also to job hunting as well. When I interview prospective employees or read resumes, I look for evidence of passion. Show that you really are into being a marketing major; start writing articles about lead generation for example, or how to use product design to captivate potential customers.

Showing passion usually leads to demonstrating authority and credibility. Passion lets employers know that you have the gusto to do the job, that you really want to do the job, and that you’re not just doing the job just because.

Example

I love teaching as much as I do learning. When I ran the Emotion Lab at Stanford Psychiatry, one of the interns posted a flyer up for Stanford HELP (Health Education for Life Program), where one can teach health and science at a local elementary school. I immediately joined, and found myself teaching an entire classroom of 6th graders. Topics ranged from teaching basic cell biology to sex-ed (I doubt I can ever post my sex-ed stories here).

I think a lot about innovations and creative means to teach, and this sixth grade class was no exception. A notable story would be when it came to teaching the effects of alcohol. Prior to this lesson, I asked my students to bring in a black shirt, and preferably wear black pants if possible.

Meanwhile, I had my friends help me with some papercraft I was working on – paper ninja stars, nunchucks, and bows and arrows made from straw and newspaper – an entire ninja arsenal.

On the day of the lesson, I came in dressed up as a shirt ninja. The kids were beyond stoked that a ninja had appeared in their classroom, rather than the usual Theo. Majority of the kids wore black, and I taught them how to fold their black shirts into a ninja mask to wear. At that point, I had around twenty little ninjas in my class.

“You are now my grasshoppers, and today we are going to talk about alcohol…”, I exclaimed in a makeshift ninja-voice as an opening for my lesson, “Now tell me what can ninjas do!”

I had several responses from my grasshoppers, such as, “Kill things! Run fast! Climb trees!”, and wrote each response on the board.

With all the responses, I now posed a new question, “Can a ninja fulfill their mission when under alcohol?”

(I’ll tell you the answer for this lesson will be , no; however, Drunken Ninjas are an exclusion to this rule.)

The kids remained silent. I had expected that only few would know the actual response, and gave the answer. But what really mattered was why and how.

“We will find out… WITH A FIGHT TO THE DEATH!”, I yelled out, as I took out my arsenal of hand-made paper weapons.

The kids went beyond ballistic after seeing me pull out a paper ninja star and started making grabby-hand motions at the large bag I held.

Not only will we fight, but we will fight… drunk!”

In my other hand, was a bucket full of drunk goggles – goggles that have lenses that completely distort the wearer’s vision.

I took the kids out to the grassy field, and everyone got their own set of equipment. They were evently spread out, and drunk goggles were placed over each of them. It seemed my squad was ready for bloodshed.

“Okay… NINJA FIGHT!”

Screams and giggles erupted as my ninjas flailed helpelessly about, attempting to attack their victims, and failing horribly, barely making any kind of contact, or none at all. No one was (fortunately) assassinated.

Back in the classroom, I went over what happened on the field, “So what did you learn about being a ninja under alcohol’s influence?”

The majority of responses were around, “You can’t kill things, it was hard to move around, I kept falling… “

I summarized that alcohol can affect one’s judgement, ability to react, and maintain balance – things that a ninja need to succeed in their missions.

Now, my closing statement. I’m not one to tell someone they can’t do something (usually), so I ended it with this note, “In years to come, you might find yourself in a situation where you will be offered alcohol. It’s up to you to determine if you’re going to drink it or not. What I want you to think about when that happens is what happened to you as a ninja today when you were under the influence. And, that’s the lesson, my grasshoppers.”

Realistically, I don’t expect to reach everyone with my lessons, but when class was over, I had five students stop by and tell me that they won’t drink when that time comes. It was a great feeling, and it would not be the first in my future lessons. I know that they might hold true to their word when the situation happens, and I also know that some of them may not.

What mattered was they made a rational choice after being presented the possible consequences.

———

I love teaching. Did you see my passion in my story?

Apply Yourself

Don’t start your credibility and authority after you graduate, start it during your tenure at school. Find ways to apply what you’ve learned in your classes. Demonstrate that you not only know your classroom material, but that you can apply the concepts as well. It’s like having a high IQ. High IQs are great, but will mean nothing if the person who has that IQ does not know how to use it.

Example

One of my projects, Notemine, was formed while I was in university, and was taking my upper-division classes. As I was taking these classes, I was applying concepts like object orientated design I learned in class when I started writing Notemine. The project grew as I learned more material from my classes, and really is a tangible testament to what I have learned. I was like a train engine without an emergency break – I would come home to do my homework, and spend ALL my free time programming Notemine into the early hours of the next day until it was either time for school or work again. The first version of Notemine was built in one month as a result.

It was Notemine that greatly helped with me getting my current and first full-time job as a software engineer.

Keep Up In The Field

This relates to passion in a way. To be an authority or have credibility in the area you want to work in, you need to understand what’s going on in the field. This means keeping up on blogs, reading news, journal articles, etc.

Essentially, be well versed in what you want to be doing.

Example

As someone who’s field is in technology and science, I frequently read sites like Slashdot, Digg, and Engadget. Digg is more of a news aggregator that spans a variety of different areas, so I usually use that site to understand what’s currently hot or how-to guides in tech, design, programming, etc.

Not only that, I do my best to keep up in current events as well. I get my conservative spin from the Drudge Report, and my liberal spin from CNN / Digg. Despite being inherently liberal, I do my best to have both points of view, which is why I see what one political group likes to say about another.

Maintain Grades

You do not need a 4.0 to become successful in life. In many cases, grades will not matter. However, there are cases that do. Keeping your grades at a B-level will be sufficient for most scenarios where grades do matter.

Example

One of my best friends recently graduated in the most difficult field – computer engineering. However, his grades were extremely poor – a 2.0, or barely passing. Where he works now, he makes less than the baseline for that major, and isn’t even doing anything computer engineering related! He’s now back in school, taking even more classes because he can’t get into grad school due to his GPA. He believes doing grad school will take him towards the right track and the right salary.

Make Yourself Known / Establish Authority

How will employers find or know of you if they don’t know you exist? Aside from hitting parties and clubs, there are other things you can do, such as starting a blog and writing about things you experience while learning material in your field, or joining professional places like LinkedIn, establishing a profile, and answer questions in the Q&A section to show that you’re knowledgeable in your field.

Example

- I frequent LinkedIn often, and hit the tech Q&A sections frequently, answering questions that I know the answers to, and also providing evidence or additional authoritative resources to augment my answer if available. If you look at my Q&A section, you can tell I’m well-versed in web development, server configuration/maintenance, database design and management.

- I write in my blog, specifically this one. I write about my passions – chemistry, computer science, genetics, the entire shebang. Do you get a feeling that I actually care about all these things reading my blog? I hope you do.

Get an Internship

Most colleges have a college and career center, where they maintain postings for jobs, ranging from full-time to internships. It is to your benefit that you find an internship that pertains to your field, since it will help you build experience.

What most college grads find is that to get a job, you need experience; getting an internship will help build experience, but even some internships require a base amount of experience to apply. It’s a bad catch-22.

Get ahead of that game by seeing what you want to do really requires, and do your best to find an internship while in school. It seems to be easier to get internships while in school since employers feel that they have to pay significantly cheaper rates since the student lacks a degree.

If you are on financial aid, you most likely have work-study, where you work on campus, and the money from aid is given to you. Most students will end up working in places like the bookstore or cafeteria. Do not do this if you can! If this is the only job you’ll hold in school, be aware that it might be the only thing on your resume when you graduate.

Most professors are doing some sort of research when it comes to a university setting. Ask your professors if they have any research assistant positions available, where you can help them with their research. Not only would you most likely be paid from work-study, but you’ll also get experience.. in your field!

Example

(Long post from one of my old journals)
——

One day in October 2004, while walking through the students records building of Foothill College (I’m a Foothill student), I noticed a NASA/AMES banner calling for yearly internships.

Something clicked inside and said I should do this… for Stanford!

For those curious about the program, the website for it is located here.

“NASA internship positions are available in a wide range of settings that include private industry, and correspond to almost every college major. Student interns work directly with scientists, programmers, accountants, engineers, administrative assistants, web developers and other professionals as they carry out or support research related to Astrobiology, Aviation Operations Systems, Information Technology, Psychology, Life Sciences and Space and Earth Sciences.”

Eventually, I filled in an application and sent a resume; days later, I received a call from NASA/AMES to go for an interview in the middle of November for three positions: web programmer, systems administrator, and technology lab assistant. I’ll go into detail about what each of these jobs are later.

I didn’t know at all about how the interview process worked, so I searched the intern website for more details. An excerpt from Erina Birman who wrote about her experience in “My Internship Experience” caught my eye:

“One of my instructors announced, during class, an opportunity to intern at NASA. Every student seemed interested and everyone was encouraged to apply. When I showed up at the information meeting. I felt that my chances were slim due to the large number of students who were applying. Although I initially felt discouraged, I reassured myself that I would regret it if I were to not try. Of these, only 30 got offered positions.”

Holy crap, only 30 received positions? I wondered what I would be up against. During the week before the interviews, my friends from my honors classes notified me that they are applying for it as well.

Knowing now that I could be up against some pretty high odds, I contacted my best friend Victor Gonzales to assist me in preparing.

“Theo, do you have a cover letter?”

“What’s a cover letter?”

“A suit?”

“Yeah, but it needs to be drycleaned…”

“Business card? Portfolio?”

“No, but I can produce one.”

“Resume?”

“It’s complete, but it needs revising.”

“Do you know what interviewers ask during a job interview? Do you even KNOW what the job you’re applying for entails?”

“No…”

So, at this point, I felt I was pretty unprepared and possibly screwed, but I didn’t give up. Theo never gives up!

And so, I spent most of my entire week at Vic’s house, writing out my cover letter, revising my resume, doing mock interviews with Vic, where he would ask me common questions interviewers ask and I would respond as if it was a real job interview. We spent some time on how to properly shake hands, pre and post interview procedures (like obtaining a business card).

My friends already had their interviews, and gave me a fair warning that the interviewers are TOUGH. One was slammed with a five-person panel for psychology, while the other was denied an interview because she lacked some certain requirements.

Eventually, the final day came, November 17th; Vic let me borrow his shoes and executive leather case to hold my stuff in. My suit was ready to go from the cleaners… I became Great Job Interviewee Theo!

***

All the interviews were at NASA/Ames in Moffett Field, near Mountain View. I had to stop by the Visitor’s Center to grab a visitor’s badge:

The orientation meeting was at 12:15PM; luckily I came early, since the place is really, really, huge – even with GPS (the GPS unsurprisingly lacks the map for NASA), I ended up getting lost as some streets are literal loops.

Eventually, I make it into the orientation room; there’s around thirty people there, and I notice I’m the only one in a suit. Everyone else has casual-but-a-little-more-than-casual clothing. I smirk knowing that Vic has prepared me Well.

(Just a side note, the NASA interviews run all week, so I’m apart of one group, as my friends are apart of another where they have their interviews on separate days.)

***

My first interview was for web programmer. It was supposed to be at 1:45PM, but I made it early by an hour to the Human Factors Research & Technology building (HFRT) to my interviewer.

(I want to note that if you are the first one to be interviewed, come EARLY. Each of my interviews was only 45 mins max. It seems like a long duration, but you’ll soon realize that it might not be enough time. By coming in early, you might have a shot to get your time extended and give yourself a huge shot in getting in because the interviewers will then get to know know the most about you.)

Coming in early was well worth it; I was in a small office room of the Outreach Manager for HFRT. Between me and the female interviewer was a desk. I’ll admit I cannot fathom the specific questions asked to me during the interview, but it all went well as she asked me to show my portfolio.

I believe it was the portfolio that sealed the deal. It had my most recent work and conveyed all aspects of my Information Technology and programming career from the last year. We went through eage page as I explained each program I wrote and the people I worked with.

She was impressed that she called in the current intern (male, so I can refer to him as ‘he’ hereafter) to look at my portfolio as well; they both agreed that I should see the work that they are currently working on. To my amazement, it was the exact same stuff I did at Entetel and for Notre Dame – content management systems. NASA recently adopted a new look for their website and administration has ordered all public websites within NASA to convert to this design.

Along with that, they’re also working on their own content management system as well as some other things. I made my comments and observations about their work and they asked me for places where it might be improved, and I gave my feedback. The intern and I got along very well, as we were avid gamers and talked about PC games and whatnot. He ended up giving me his AIM sn as well as e-mail to keep close contact.

Before I left, I remembered Vic telling me to ALWAYS get the business card of the person who interviewed me so I can send off the final “weapon” – a thank you card. He said that if the other applicants match you in ability, it’s usually the thank you card that puts you on top as it shows you are organized on following up or something like that.

Overall, the interview went great. They basically asked me if I wanted to work for them in the end. I was unsure at first because I don’t know what the other two job positions will ask for.

***

The second interview was around a mile away from the first one; it was only now 2:10PM (that previous interview lasted LONG).

So, I make it there (I can’t remember where “there” was, but it involved Aeronautics) and I’m greeted with a three-person panel. This was for systems administration, and the process was completely formal. It lacked the friendly air of the previous interview at the HFRT.

Sadly to say, they cared more about my degrees (or lack thereof) than my actual work experience. I was asked many questions about my lack of degree and when would I get it, etc. Then, they explained the “systems administration” job, which wasn’t even sysadmin at all, it was just another web programming job, but more undefined. They didn’t know what the heck they wanted, or even want to define what they wanted in their web application. I just know it has to do with a screwed up inventory keeping program that the previous intern screwed up on badly.

It just felt stiff, and completely unfriendly. Out of the door, I determined that this job I would decline if offered, because they only seemed to care about my school credentials as opposed to my actual work experience. In sociology, it’s called “credentialism” – you favor someone more for the school they came from / degree; it’s like saying, “I need a lawyer, get me someone from Stanford!” – just because it’s Stanford, doesn’t mean it’s the best.

***

The final interview was at Foothill, which I soon learned wasn’t a NASA position, but Foothill looking for the “leftovers” to do meager tasks. Again, it was a formal interview, but this time the interviewers read off of an interview sheet. It felt quite structured, and it was exactly like Vic and I practiced during or mock interviews.

Basically, a Technology Lab Assistant is just sitting your ass in a computer lab, watching over people who use the computers all day. Do boring things like help people with software, give e-mail accounts, etc. I know I made that one for sure, but it’s not something I wanted to do.

***

The day was over, and I was exhausted. Throughout the day, I let Vic and Deborah know of my progress with each interview, and I told them that I pretty much got the first and third jobs based on impressions alone.

And, I was right. I did get the job. Days later, NASA/Ames called me informing me that I received the web programmer job and to call my interviewer to formally accept the position. It’s the job position that I went in early for, the interviewer who was kind enough to actually know and understand my work, and the intern that showed me all his cool work, and our internal contacts thereafter through e-mail that most likely gave me the position.

My orientation date for my job is officially December 13, but it’s most likely I will be going in earlier as the previous intern needs to hand off his work to me before he leaves to Europe for another position.

If I do really well at NASA, I have the possibility for a permanent position or a second year of internship.

Welcome, Great NASA Intern Theo!

It’s so amazing. In less than a year, I’ve made it this far.

———–

Have a Backup Plan

Always have a backup plan. I cannot stress this enough. One downside to specializing is that if jobs in that particular field are being cut back, that means your chances for a job are low.

Understand Where the Jobs Are At

I know you want to do art, which is why you’re an art major. However, have you actually thought about if it was difficult to become an artist? What kind of artist do you want to be, what do you think you might do?

Hopefully, you’ve asked these questions while in college, and not after you graduate. Most students are completely unaware of the job market for their field of study, and don’t know about how large the hiring pool is, what kind of hours, or salary one can expect, etc.

Being informed also means knowing what you’ll be getting into. You don’t want a situation where you graduate, do your job, and learn and regret that it’s something you can’t do, don’t have the talent for, lack the connections for, etc.

Doing what you want to do is one thing, but also having the finances and stability to do it is another. Which brings me to another topic…

Diversify

If you’re a liberal arts major, the chances of finding a job will be smaller than someone who has done science (in my experience). If you know that what you want to do will not lead to security (job, finances, etc), then you need to think about a Plan B, and that may mean taking up another major to augment situations where you do need to resort to diverging from your primary field of study in order to be stable.

For liberal art majors, I always recommend doing a major in science. I know that science is difficult for many, but get as close to a science as much as possible, or a least a field of study that is widely in demand and offers security.

Example

Note: I don’t suggest you do what I do, it may not work, but for me, it’s beyond successful.

I originally did multiple majors because I wanted to maximize my chances of transferring to Stanford. However, I eventually learned that having multiple degrees was beyond beneficial since it meant that I could jump from one field to another easily.

- At Stanford, I was highly valued for my experience in computer science and psychology/sociology/social sciences. I was the only research assistant in the labs that had a combination of both backgrounds, and the other professors were jealous of my mentor because I was able to do beyond what the normal research assistant could do. Not only that, I also ended up working with Nissan, who was collaborating with the lab, writing programs for the lab’s first driving simulator for studying hypnosis.

- How I aced the interview for my current job was I was able to apply unrelated concepts into a marketing concept – I was able to draw my knowledge from bioinformatics, where I used a genetics algorithm as a hypothetical solution to their lead scoring methods.

- In my current chemistry class, I was able to use my linear algebra to come up with an algorithm to quickly solve problems found in Hess’ Law. No one has ever done it before, but it’s proving successful on every Hess problem I use it on. My professor thinks it’s really neat, although he doesn’t know how to assign points for work if it’s ever wrong since he doesn’t completely understand how I do it yet.

Be Aware a Bachelor’s Degree May Not Be the End

For certain majors, you will need at least a masters degree to do something significant. One that usually comes to mind is psychology, where if you want to do things like case studies in therapy, you will need either a masters or a Ph.D.

Be Aware Of the Salary For the Degree

Some fields of study are more valued than others. Computer engineering will average around $70-80k starting, while biological sciences may average $30-50k base (my estimates are Bay Area estimates). Think about where you will be living, the cost of living, your future debts, etc, and think if your major can ensure some semblance of security. If you’ve diversified, you can be worth significantly more since you may have the ability to solve problems in unique ways due to your knowledge in different fields.

Masters and Ph.D degrees do not differ too much in terms of salary. My experience with Ph.Ds is that having one seems to be a risk as the company thinks that they have to pay you a very high salary due to the degree you have, and as a result won’t hire you. If you want to teach at a university level, or do work in research as opposed to industry for example, you’re going to need a masters or Ph.D.

Know the Players

There are major players in every field, who I’ll term gatekeepers. They hold a lot of the keys to your entryway into a job. Steal some of these keys by knowing what they (they being a company, a person, etc) do so that you can open doors on your own.

Like Apple products and want to work for Apple? Then, understand the Apple product lineup, who are the players in the space, shortcomings the company may be facing, who or what their competition is, etc.

Know the space inside and out. Show that you know what’s going on in this area; know key people, what they do, how they’re advancing the field, etc. Find people in the area that inspire and motivate you.

Interviewers will be impressed that you have an understanding of the movers and shakers, and that you not only carry your talents, but you essentially have a general idea of how the industry works.

Sides, if you don’t know who the gatekeepers are, then how are you going to be able to let yourself in?

Conclusion

I can share several stories of success and failure, and I’m sure I’ve only gave half of what I’ve intended to say. Be passionate, demonstrate that you care about what you learn, show that you can apply what you’ve learned, and most of all, have a backup plan when things go wrong. Don’t be in the situation where you regret what you’ve studied, and end up going back to school or grad school to have the proper means to get the job you want.

If there are any questions I haven’t answered, or things I eventually think of, I will write a part II to this article.

Having Courage in Failure

If everyone raised their hand

It was a normal day in chemistry class, where we discussed Lewis Structures, which was a way to diagram how atoms might link together. We spent a good deal of time learning about the rules of how to create these diagrams, and got up to the point where we were learning triple bonds. Looking at the examples of triple bonds, they were a bit more difficult than the double and single bonds.

It was now time to practice triple bonds, and our professor drew up some example problems on the board. As with all problems written on the board, there is a request for someone(s) to come up and provide the solution. And, with such requests, there is always that momentary air of silence, before someone stands up to go up and solve it.

However, today was a bit different. The professor wanted us to provide the wrong answer to the problems. Once he mentioned that, the silent veil was lifted, and students were more willing to go up and attempt the solution (or rather, produce the incorrect solution).

It was at that moment I realized how difficult it is to have the courage to be wrong. As soon as the professor stated that he encouraged incorrect answers, the stigma of failure was immediately subdued. Not only that, I think more students learned from that particular experience because they went up there, produced their incorrect solution, and also obtained feedback on why it was incorrect.

I admit that I’m a partial offender – I love going up there to attempt solutions, but I sometimes have to defend my work with, “I’m unsure if it’s correct”, as if to diffuse any tension in the event that I may be wrong. In every classroom scenario though, no one ever cares if you’re wrong (or even if you’re correct in certain cases) in the end, as long as the solution can be provided.

Everyone wants to be right, to be perfect, and to be accepted by their peers. It’s easy to say that you’re correct, but it’s much more difficult to say that you’re wrong, because it means that there is fault within the self. I admire those who can admit failure, because it means that there exists a capacity for self-reflection, a mechanism for correction, and the courage to acknowledge that to err is human.

I’m also finding that the ability to handle failure may be directly related to risk taking and developing intuition. There are many scenarios I’ve encountered where there may be a foreign object or interface that me or nobody around me has encountered before. What I notice 99% of the time is people are afraid to try anything out given such an unknown.

It could be fear of failure, or lack of curiosity, or a combination of both, but my answer to these kinds of situations is just try something; push that red button, see what it does. If something breaks, then understand why it broke, and attempt to reverse the action.

I wonder what would happen if in classes, professors encouraged you to work on a problem on the board, and change one part of your solution so that it became an incorrect one, so that hopefully someone can find fault within, and teach everyone how to correct it.

That way, it won’t be just you and me that can be one step towards perfection, but everyone around us as well who were afraid to admit they made the same mistakes.

Finding an Automated Algorithm to Solve Hess’ Law II

Update: You can see my current progress here. As of now, I have the modified Gaussian elimination completed, meaning part I is now done (unless more matrices break under it). It’s beta code and shouldn’t be considered complete until a battery of linear equations are run against it to check for validity.

Well, it’s been almost one week since I started working on this problem. To start off, I had several great answers from my question posted on LinkedIn, but it was shut down since someone flagged it as “commercial services”, which it really isn’t, but the person who shut down the problem clarified why it was, and that made sense.

Overall, I put out $100 because I wanted to put my money where my mouth was – it gave this problem value to others, and it also motivated me to work on it, as I was putting my own money on the line.

Anyways, I’ll be splitting the $100 to two people who were really helpful with providing their own pseudo-algorithms for this, Viacheslav Usov and Mkrtich Laziev, which helped me find a path towards developing an algorithm to do what I want.

I’ve spent probably over 15 hours on this program and managed to finish 99% of my initial code to solve the matrices that may represent Hess Law equations (I’ll explain why I said may at the end). I’ll never know if it’s possible to solve these problems until I run a lot of problems against the algorithm to see if I can get the expected values.

Then, there’s another issue once I feel I’m done with my algorithm. Although at first I thought I figured out how to translate a set of chemical equations to a matrix, there are some special cases where I cannot fit the equations into the rules that I use to form the matrix. Instead, I have to re-arrange it a bit to have a proper matrix that is solvable.

By the end of this, I hope to:

1. Have a PHP version of my own algorithm for Gaussian elimination with partial partitioning, backsubbing, as well as a least squares algorithm implemented. (99% done),

2. Be able to demonstrate that with any given Hess Law set of equations, that it can be applied to a matrix and that there will be one unique solution (assuming the set of equations has a solution, as textbooks tend to).

Needless to say, it’s been really fun doing this so far. I’ve never been so involved in working with algorithms or math for that matter. I had to do hours of research on linear algebera and figure out with my limited knowledge how to translate scary math notation into code.

Finding an Automated Algorithm to Solve Hess’ Law

Last week in my chemistry class, I was exposed to Hess’ Law and while doing some example problems in class, I immediately wondered if there was some way to apply linear algebra to automagically solve the equations. I asked my professor if he knew if linear algebra could be applied to solve them, but he said he was unsure since he’s actually not a math person.

I really hate throwing things like that out in class where it doesn’t really apply to what’s being taught (you know, those jerks that ask these stupid wiseguy questions in class just to look like they know more than everyone else), but I just had to get some affirmation if it was possible.

During the weekend I tried to see if I can do it with matrix operations, but I eventually realized that the linear algebra I know is too limited to find a solution. I’ve completely mapped out what the problem looks like, I know how it can be solved via human guess and check, but I really feel there’s a set of consistent mathematical operations that would just give me what I need (kind of like gaussian elimination to solve linear systems of equations).

If anyone knows the algorithm, I will give $100 USD to the first person who does. Note that I’ve also posted this on LinkedIn, meaning whoever is the first, gets it. The algorithm needs to be able to solve all matrices that can be assembled from problems found in Hess’ Law without human intervention (other than inputting initial and final values of the problem). What I’m looking for is an automatic generation of the intermediate Xn values that are required to multiply each row to get the final values.

Edit 1: Piyush Pant discovered that Wolfram Alpha can be used to solve these problems. However, it does not give the algorithm.

http://www95.wolframalpha.com/input/?i=Solve+{w,x,y,z}.{{1,0,0,-3,-1,3,0},+{0,2,3,0,-1,0,0},+{0,0,1,0.5,0,0,-1},{0,0,0,0,0,-1,1}}%3D{-2,4,0,3,0,0,0}

Here is an actual application of this possible algorithm:

Solution: http://www95.wolframalpha.com/input/?i=Solve+{w%2Cx}.{{1%2C3%2C-2%2C-3%2C0}%2C+{0%2C3%2C-2%2C-2%2C1}}%3D{-1%2C0%2C0%2C1%2C1}

Do you use analytic functions?

I’m currently programming a who’s online for leads at work, and was having lots of difficulty in getting the results I needed to properly display the most recent activity.

We have three tables that need to be looked up due to the way the schema was designed. The primary table is a user_log table that stores all actions that a user performed along with a timestamp. However, this log table does not include any user information aside from a user_id. So, to get the information about a user, we need to join that user_id to the user_id in a users table.

But, here’s where it gets really messed up – the users table doesn’t contain the information we need. Instead, it has a contact_id field in the users table, which must be then joined to a contacts table.

So it goes like this:

.. WHERE user_log.user_id = users.user_id AND users.contact_id = contacts.contact_id

Yeah, three tables just to get contact information.

I was finding that the standard SQL Distinct/Group By keywords were proving ineffective in getting the results I needed, which would be to just give me one user_id and the most recent created timestamp in the user_log table. Instead, I was getting multiple rows for the same user_id.

Fortunately, I found out about analytic functions in Oracle, which helped me isolate out unique user_ids and get the latest timestamp for that user by using ROW_NUMBER( ) where the sequence_number = 1 (giving me the topmost result for each user_id).

Unfortunately, I also learned that mySQL does not have analytic functions built in, but it can be emulated in native SQL (Part 1) (Part 2).

The best explanation I can give about the common aggregation functions that most people tend to use like SUM(), AVG(), etc vs analytic functions is:

Assume you have a set of rows.

The aggregation function will take that set of rows and output only one row with the results, while an analytic function will output that set of rows with the results appended.

The analytic functions do not have to work this way, but it’s useful for performing ranking analysis or sorting rows into individual sets of results.

How to stop or kill data pump jobs in Oracle the CORRECT way

In my never ending frustrations with using Oracle (seriously, I loathe Oracle above all else), I could not find an absolute answer on how to stop or kill or delete data pump jobs being executed. I found the answer via Metalink, and I’m going to share it because I feel these answers should be easily accessible. It’s a two step process.

1. Get the list of datapump jobs:

SET lines 200
COL owner_name FORMAT a10;
COL job_name FORMAT a20
COL state FORMAT a11
COL operation LIKE state
COL job_mode LIKE state

-- locate Data Pump jobs:

SELECT owner_name, job_name, operation, job_mode,
state, attached_sessions
FROM dba_datapump_jobs
WHERE job_name NOT LIKE 'BIN$%'
ORDER BY 1,2;

The output might look something like this:

OWNER_NAME JOB_NAME             OPERATION   JOB_MODE    STATE       ATTACHED_SESSIONS
---------- -------------------- ----------- ----------- ----------- -----------------
SCHEMA_USER SYS_IMPORT_SCHEMA_01 IMPORT      SCHEMA      EXECUTING                   1

There are two things needed to perform the kill:
1. OWNER_NAME (Which is SCHEMA_USER)
2. JOB_NAME (Which is SYS_IMPORT_SCHEMA_01)

With that information, we can now stop and kill the job:

SET serveroutput on
SET lines 100
DECLARE
   h1 NUMBER;
BEGIN
  -- Format: DBMS_DATAPUMP.ATTACH('[job_name]','[owner_name]');
   h1 := DBMS_DATAPUMP.ATTACH('SYS_IMPORT_SCHEMA_01','SCHEMA_USER');
   DBMS_DATAPUMP.STOP_JOB (h1,1,0);
END;
/

Check that the job has stopped:

SQL> SET lines 200
SQL> COL owner_name FORMAT a10;
SQL> COL job_name FORMAT a20
SQL> COL state FORMAT a11 
SQL> COL operation LIKE state
SQL> COL job_mode LIKE state
SQL> 
SQL> -- locate Data Pump jobs:
SQL> 
SQL> SELECT owner_name, job_name, operation, job_mode,
  2  state, attached_sessions
  3  FROM dba_datapump_jobs
  4  WHERE job_name NOT LIKE 'BIN$%'
  5  ORDER BY 1,2;

no rows selected

Installing SuSE Enterprise 10 Linux on Hyper-V (The CORRECT way)

Things I learned:
1. Mouse still does not work in a Remote Desktop session. You’ll have to use VNC, and if you’re using Windows, the port is 5901 not 5801 like the VNC server in SuSE tells you.
2. Contrary to what the other blogs are saying, you do NOT need to run ./setup.pl x2v or do any kind of patching/compiling. All you need to do is insert the integrated components disc (Download from Microsoft Connect for free), and run ./setup.pl drivers
3. When you install SuSE, you’re better off not installing any kind of network adapter. Install the normal network adapter after installing the IC drivers.
4. There is no heartbeat monitoring in the IC drivers.
5. When you configure your time settings, use local time, not UTC time, or your system clock will screw up like mentioned above.
6. The system is significantly faster with the IC installed.
7. Be sure to use version SP2. This is what I used. My first mistake was to use the version prior to SP1.
8. DO NOT UPDATE THE KERNEL if you already installed the drivers. Or if you want to, always take a snapshot of the system first so you can roll back, reboot then reinstall the drivers. It needs to be recompiled for every new kernel version.
9. THE DVD DRIVE IS NO LONGER RECOGNIZED after driver installation :/

MySQL to pure utf-8 character set configuration

I’m programming a new version of my Japanese translator in the python Django framework as practice. Aside from some hard lessons, such as you cannot install a Python 2.5 x64 binary in Windows and expect the mod_python installer to work, the following was my next problem:

Had some trouble importing a file with Japanese in UTF-8 encoding into mySQL. The import would go fine, then would completely come out garbage on output. I eventually figured out what to do. Edit the my.cnf for the server, and use the following parameters:


[mysqld]
default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'

[mysql]
default-character-set=utf8

Now, if I did the following in mySQL:


mysql> SHOW VARIABLES LIKE 'char%';
+--------------------------+--------------------------------+
| Variable_name            | Value                          |
+--------------------------+--------------------------------+
| character_set_client     | utf8                           |
| character_set_connection | utf8                           |
| character_set_filesystem | binary                         |
| character_set_results    | utf8                           |
| character_set_server     | utf8                           |
| character_set_system     | utf8                           |
| character_sets_dir       | C:xamppmysqlsharecharsets |
+--------------------------+--------------------------------+
8 rows in set (0.00 sec)

mysql> SHOW VARIABLES LIKE 'collation%';
+----------------------+-----------------+
| Variable_name        | Value           |
+----------------------+-----------------+
| collation_connection | utf8_general_ci |
| collation_database   | utf8_general_ci |
| collation_server     | utf8_general_ci |
+----------------------+-----------------+
3 rows in set (0.00 sec)

If everything is utf8, then you are golden!