Skip to content

existence, refactored

With kindness comes naïveté. Courage becomes foolhardiness. And dedication has no reward.

Archive

Category: Hardware

WordPress Installed

Here’s a quick update to this mini-tutorial. Previous parts can be found here and here.

Installing MySQL

Installing MySQL is so simple that I don’t need to hide it behind the cut. The one in the Ubuntu repositories work just fine:

$ sudo apt-get install mysql-server-5.1

Note that you will be asked to enter a root password somewhere in the installation.

To wrap up the installation run

$ sudo mysql_install_db

to initialize the installed server and

$ sudo mysql_secure_installation

to secure it.

In mysql_secure_installation, you’ll be asked for your root password and then you’ll asked if you want to change it. Just enter “n” since there’s no reason to change it this early. Then you’ll be asked if you want to do some things to secure the database which is, of course, what we want to do so just hit Enter for each question to choose the default answer (“Y”).

continue reading…

phpinfo()

Here’s the next part of my basic web server administration tutorial.

At the first part, we set up the virtual machine. Now we’ll be setting up the web server itself.

Set Static IP Address and fake Domain Name

Before we could proceed with installing our web server, let’s do a couple of things to make our server behave more like a “normal” server.

First is to set our server’s IP address to a static IP address. There are a bunch of ways to do this (e.g. change the router settings), but we’ll just go with changing our server’s settings

Running ifconfig and route will give us the current IP address and gateway.

ifconfig and route

In this case, the new IP address is 192.168.1.125 and the gateway is 192.168.1.5. We can now apply these settings to /etc/network/interfaces. Open the said file via:

$ sudo vim /etc/network/interfaces

(For this tutorial, I’ll be using vim as the default text editor. If you find vim too daunting, you can replace all instances of vim with nano)

It will look something like:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp

Now replace the last line with the following:

iface eth0 inet static
address [address here]
netmask 255.255.255.0
gateway [gateway here]

for example:

iface eth0 inet static
address 192.168.1.125
netmask 255.255.255.0
gateway 192.168.1.5

To make sure you got the static IP settings correctly, you can restart the server via

$ sudo shutdown -r now

or you could just simply restart the network interface:

$ sudo /etc/init.d/networking restart

Here we see the /etc/init.d folder where the init scripts (like networking) are placed. Aside from being executed automatically upon boot to start services, they can also be used to stop or restart the said services just like what we just did with networking. We will see more of /etc/init.d/ later in this tutorial.

Now that we’ve set the IP address as static, it’s time to set a fake domain name.

Normally, when you’ve got a server with a static IP address, you’d have to go and buy a domain name from a registrar like Namecheap and you’d go through the steps in linking that name with the IP address and waiting for the DNS propagation.

For this tutorial, we’re going to skip all that by faking it with the hosts file.

First let’s update the server’s /etc/hosts file to add our fake domain name “mysite.dev”:

sudo vim /etc/hosts

Add the line at the end:

192.168.1.125   mysite.dev

You can verify the new setting by using the ping command.

user@ubuntu:~$ ping -c 4 mysite.dev
PING mysite.dev (192.168.1.125) 56(84) bytes of data.
64 bytes from mysite.dev (192.168.1.125): icmp_seq=1 ttl=64 time=0.172 ms
64 bytes from mysite.dev (192.168.1.125): icmp_seq=2 ttl=64 time=2.38 ms
64 bytes from mysite.dev (192.168.1.125): icmp_seq=3 ttl=64 time=3.34 ms
64 bytes from mysite.dev (192.168.1.125): icmp_seq=4 ttl=64 time=1.59 ms

--- mysite.dev ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3016ms
rtt min/avg/max/mdev = 0.172/1.874/3.342/1.161 ms
user@ubuntu:~$

Now let’s apply the fake domain name mapping to the host Windows computer. Like in Linux, the hosts file in Windows requires admin privileges so we first need to run the text editor as Administrator in order to allow us to modify it.

Run as administrator

Right-click Notepad and select “Run as administrator”. Once open, you can now add the “192.168.1.125 mysite.dev” to the end of the C:\Windows\System32\drivers\etc\hosts file.

Now you could change the PuTTy settings to use “mysite.dev” instead of the actual IP address.

The actual installation of the web server below the cut.

continue reading…

VirtualBox

So you want to be a bit productive this holiday/winter/end-of-year break and decide to learn how to setup your own website.

But for some odd reason you don’t want to settle with a free website service like WordPress or even a cPanel managed shared hosting site. Instead, you want to know how to setup your own web server, something like a Linode VPS or an Amazon EC2 instance.

Luckily for you, I’m having a bit of a writer’s block and I have time to write about how to learn setting up a Linux server without having to pull out your credit card.

What this post is all about

In this post, we’ll just discuss how to set up a virtual server on your computer.

Yes, that’s right. We’re not installing a server OS on a spare machine, nor are we dual-booting: we’ll be setting up a server in your desktop, running the former inside the latter. This is virtualization, dawg.

We’ll be creating a server with somewhat similar specs to what you’d get if you sign up for $8 a month at prgmr.com. This simulated environment will be enough for a newbie to learn the ropes in server management.

What you need

Any relatively modern desktop or laptop computer will do. For this series of posts, I’ll be forgoing the use of my quad-core gaming rig and instead use my laptop (dual-core @ 2.1GHz with 3GB RAM). For the sake of the majority of the readers, I’ll be using Windows 7 as the OS though the steps will almost be the same when using Windows XP and Vista, and will still be similar even when using Linux or OSX.

You also need to be connected to a network, preferably one that gives out local IP addresses via a DHCP server. In other words, a home/office router. Fast internet also helps as you need to download >700MB worth of installer data.

As for the software, you will need to download VirtualBox and a CD image (.iso) for Ubuntu Server 10.04.3 Long Term Support 32-bit. The VirtualBox download and installation is pretty straightforward, but for the Ubuntu Server 10.04.3, you may want to choose downloading via BitTorrent for faster download speed.

Unlike Linux and OSX users who already have it built in on their terminals, Windows users will also have to download an SSH client like PuTTy, the one that you’ll see in this tutorial.

continue reading…

Last talk for the year (barring a possible surprise talk at Code Retreat): a talk about current trends in web technologies at DevCon UPHSD. This time it’s a 20 minute talk that I had to drag out to 40+ minutes to cover for the missing speakers. Good thing I wasn’t pressured to deliver it in English.

So yeah, we had 2 missing speakers, leaving Alvin and I to handle everything.

But surprisingly, this DevCon event was far better than the one in DLSU (read: a more prestigious university) mainly because the students were really interested in what the two of us have to say. Sure, our talks may have been boring for most of the audience, but by the time we left the campus, we’ve fielded over a dozen questions, mostly from students who approached us after the event ended.

In comparison, AFAIK, only one student asked a question in DLSU.

Pride? Apathy? I really don’t know.

Anyway, here’s my talk and the slides.

It’s been almost two and a half years since my post about hidden gems within the multitude of (often crappy) products found in CD-R King. Since that post, I’ve found a couple of new interesting finds worth a blog post.

No, there won’t be any obvious things here (e.g. the laptop, netbook, tablet, etc). I prefer not-so-obvious items that are mostly relevant to my interests.

continue reading…

I thought I’ve already done this to all of my machines but it seems that I haven’t done it on this laptop I’m using right now.

Anyway, I use gitk for my graphical git browsing because I’m too lazy to download other graphical packages. Unfortunately, gitk looks like this:

pre-tk8.5
(click pic for larger version)

The solution to this is to install tk8.5 and tell gitk to use it instead of 8.4. From SU:

To fix this the Debian (Ubuntu) way:

$ sudo apt-get install tk8.5
$ sudo update-alternatives --config wish

And then pick the wish8.5 alternative.

Here’s the result:

post-tk8.5

decisions..

Just a random dilemma I’ve been thinking about this past week.

There are 3 things I can buy with around 11,000 pesos. Sure, I can just buy all 3 at the drop of a hat, but that would take the fun out of this thought experiment. :p

continue reading…

Since I’ve been too busy recently to think thoughtful articles, I just thought “What the hell…” and came up with this one.

Last time I looked at computer parts was two years ago. Since then, a lot of things have changed in the market.

Basically, it’s just Moore’s Law: prices go down, performance goes up.

Thinking up of a gaming rig, however, isn’t that all exciting. There are literally hundreds of websites out there with people discussing (and debating) which combination of parts will give you the best gaming experience on the PC.

So to shake things up, I’ve decided to think of a PC build for software developers. Of course, if you’re developing for iOS, this article isn’t for you. But for the rest of us, having a good set of parts can really make a difference, especially since you’re going to be working in front of that machine for 40+ hours a week.

continue reading…

Plextor SSD

It’s no secret that I have a guilty pleasure of going to CD-R King to look for decent stuff in their inventory. And I do find some nice stuff once in a while, for example, I only recently found out that they sell digital scales that allow zero resetting, an invaluable tool in the kitchen especially when baking. The PhP 380 – 580 price range is just too low when compared to the scales you’ll find in stores like Gourdo’s which sell them from PhP 1,500 to 3,000.

Anyway, I’m just here to point out that CD-R King has a new 64GB SSD in their inventory. At PhP 3,990, it’s cheaper than the one I have on my rig right now, but based on reviews it’s supposed to be crappier.

Still, there are worse ways to shell out P4k (like, say, attending a cloud computing conference when you’ve already been using it for years) so slapping one on your on-the-go workhorse laptop isn’t that bad of an idea.

Last year, I bought two really cheap SSDs from the unlikeliest of sources: CD-R King.

Everything about it was just screaming BAD IDEA. Someone over at HardOCP’s forum even suggested the drives will have “gone to shit” in just 4 months.

Let’s see how much the performance has degraded a year later:

ssd performance a year later

As expected, the drive has degraded a bit, its performance half of what it was last year. For reference, here’s the HD Tune performance just after I first installed them (with a brand new OS and all) last year:

ssd performance a year ago

A 50% drop in performance might be disappointing, but when you take into account the expected performance of top non-SSD hard drives, it’s still pretty impressive. Here’s the graph of the comparison drive last year (Western Digital 10K RPM Raptor):

hdd performance

So no, performance still hasn’t gone to shit yet.