Hello world!

By admin

Dudes, Wordpress is pretty easy to install. Took me 4.35 minutes.  My awesome host (Black Dog Hosting) hooked me up pretty quickly. He has PHP 4.4.4 and Mysql 5.0.32. I’m suprised he hasn’t upgraded to Php 5. When are we gonna see Php 6? I think that people will have the same reaction to Php 6 will probably be like Perl 6: Who cares, we’re all using Ruby and Python now ! Damn, I just burned my whole Php readership. This blog is off to a bad start.

categoriaUncategorized commentoNo Comments dataDecember 15th, 2008
Read All

Shallows, PM

By admin

Veteran's Day session, there was actually some nice sets rolling through…

categoriaSurf Journal commentoNo Comments dataNovember 11th, 2008
Read All

Shallows, PM

By admin

Dude, i had it all to myself. It was fun for about 30 minutes, had a couple good ones and then it was dead…

categoriaSurf Journal commentoNo Comments dataOctober 26th, 2008
Read All

Awesome incident of the month

By admin

I'm (finally) getting more structured and object-oriented with my JavaScript. My co-worker is a guru at this stuff.

I was working on an awesome class called FirstTree. It was super-object-oriented. I went to go use it in my code like this:

var myObject = FirstTree.new({config: configuration});

I pounded my head on this for like 20 minutes. Why was it giving some strange error?!?!? I thought JavaScript would let me be object-oriented!

So, I asked the guru to look at my code. And he pointed out, “Dumbass, you write that line of code like this”:

var myObject = new FirstTree({config: configuration});

Moral of the story: Stop thinking in Ruby!

categoriaProgramming commentoNo Comments dataOctober 17th, 2008
Read All

Apache SSL with 2 IPs and 2 Certificates

By admin

Yesterday we had to set up Apache to host 2 SSL certificates for 2 different IPs. There’s all kind of crackheads on the internet who think you can install 2 SSL certificates for 1 IP but it simply can’t be done. So, here’s what I did:

There’s info on the Apache VirtaulHost Examples site. The best examples are “Mixed name-based and IP-based vhosts” and “Mixed port-based and ip-based virtual hosts.”

Let’s say we have 2 domains: mauka.com and makai.com.

We change our DNS so that the IP xx.xx.xx.1 points to mauka.com and xx.xx.xx.2 points to makai.com points to xx.xx.xx.2. This means the server has to be set up with 2 IPs.

Before we change anything in Apache, we need to generate 2 ssl certificates. We will make these wildcard certificates for the names *.mauka.com and *.makai.com. There’s plenty of information out there about how to generate the key, this site has some good stuff: http://www.madboa.com/geek/openssl/
So, we generate our keys and certs and place them in /etc/pki/tls/private/wildcard-makai.key, /etc/pki/tls/certs/wildcard-makai.crt, /etc/pki/tls/certs/wildcard-mauka.crt and /etc/pki/tls/private/wildcard-mauka.key.

Here’s what the set up will look like for our domain to configure the following urls. :

http://www.mauka.com
http://www2.mauka.com
https://www.mauka.com
https://www2.mauka.com

http://www.makai.com
http://www2.makai.com
https://www.makai.com
https://www2.makai.com

in the main http.conf

NameVirtualHost xx.xx.xx.1:80
NameVirtualHost xx.xx.xx.2:80

Add after our mod_ssl setup, for us it is a file ssl.conf

DocumentRoot /www/www.mauka.com
ServerName www.mauka.com
DocumentRoot /www/www2.mauka.com
ServerName www2.mauka.com
DocumentRoot /www/www.makai.com
ServerName www.makai.com
DocumentRoot /www/www2.makai.com
ServerName www2.makai.com

SSL Configurations
Add after our mod_ssl setup, for us it is a file ssl.conf

NameVirtualHost xx.xx.xx.1:443
NameVirtualHost xx.xx.xx.2:433
DocumentRoot /www/www.mauka.com
ServerName www.mauka.com

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/pki/tls/certs/wildcard-mauka.crt
SSLCertificateKeyFile /etc/pki/tls/private/wildcard-mauka.key
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
DocumentRoot /www/www2.mauka.com
ServerName www2.mauka.com

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/pki/tls/certs/wildcard-mauka.crt
SSLCertificateKeyFile /etc/pki/tls/private/wildcard-mauka.key
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
DocumentRoot /www/www.makai.com
ServerName www.makai.com

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/pki/tls/certs/wildcard-makai.crt
SSLCertificateKeyFile /etc/pki/tls/private/wildcard-makai.key
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
DocumentRoot /www/www2.makai.com
ServerName www2.makai.com

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/pki/tls/certs/wildcard-makai.crt
SSLCertificateKeyFile /etc/pki/tls/private/wildcard-makai.key
SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire

Note: This is very general, there’s a lot of other options that are missing here. This is to give you an idea of what it looks like.

categoriaTech commentoNo Comments dataOctober 17th, 2008
Read All

Lighthouse, AM

By admin

wow, it's been a long ass time. don't worry, i have forgetten about my fanclub, just busy with grad school. Nice day to be out though…

categoriaSurf Journal commentoNo Comments dataOctober 13th, 2008
Read All

git: Get a single file from another repository

By admin

This is so easy it's almost stupid. Let's say want to copy a single file from b0 to another branch, b1, without doing a merge and all that crap. all you do is this:

# change to b1
get-checkout b1
# checkout the single file
git-checkout b0 path/to/file

Then you can do something like to see the differences:

git-diff HEAD path/to/file

and when you are done:

git-commit -m “Commit it, baby” path/to/file

“Commit it, baby” as a comment is mandatory.

categoriaTech commentoNo Comments dataSeptember 25th, 2008
Read All

Make irb remember your history with the irbrc

By admin

I always forget this one too. To make ruby's irb remember commands you entered in the last session(s), you need to add the following lines to /home/kenglish/.irbrc:

require 'irb/completion'
require 'irb/ext/save-history'

IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = “#{ENV['HOME']}/.irb-save-history”
IRB.conf[:PROMPT_MODE] = :SIMPLE

Isn't IRB-RC an awesome name for a file?

isn't Camber First

categoriaTech commentoNo Comments dataSeptember 17th, 2008
Read All

git – adding e-mail alerts & hooks

By admin

Before you do anything, you may want to back up the file .git/hooks/post-receive in your project directory or at least view it to make sure that there's nothing in it.

Now, get a copy of the git source code:

git clone git://git.kernel.org/pub/scm/git/git.git

Overwrite the post-receive in your hook folder with the file git/contrib/hooks/post-receive-email :

cp git/contrib/hooks/post-receive-email /var/data/repos/myproject/.git/hooks/post-receive

Now, go to your project home and add the git-config variable:

cd /var/data/repos/myproject/
git-config hooks.mailinglist “kenglish@someweakdomain.org”
git-config hooks.mailinglist “[GIT-MYPROJECT] “

Now test it out, do a git-commit -a on your repository and push it to the master. Should send an e-mail about the checkin.

BONUS:
By default, the script will just e-mail you that files have checked in. If you want to Email the diffs of the files themselves, basically, copy the diff of from that guys post into your post-receive file. THen set hooks.emailprefix=1

with:
git-config hooks.emailprefix 1

categoriaTech commentoNo Comments dataSeptember 15th, 2008
Read All

Ignoring local changes

By admin

If You have something checked into the repository that you will change locally but never want to check back in, you can do this:

git update-index –assume-unchanged config/initializers/ruby_inline.rb

categoriaTech commentoNo Comments dataSeptember 11th, 2008
Read All