How tough are you without a UI?

To test your endurance skills, I really recommend trying to configure a remote server in linux from scratch.

And believe me, it's no fun to find yourself without the support of a nice and comfortable menu filled with round buttons and all sort of functions available at the distance of a click.

That's right, as mentioned on the previous blog post - R1Soft has sponsored a fully dedicated server and I had the task of configuring the mySQL databases to be used by sites that run on another server.

My first mistake was ignorance.

Little I knew about apache installed and running on a ubuntu machine.

I was already quite experienced on the tasks of configuring and running web servers based on XAMPP for either Linux or Windows and never really felt the need of running a non-portable Apache/MySQL/PHP/etc.

Yesterday, I started working on the mySQL database transfer from boot-land.net to the new server location.

At first, I noticed that I couldn't find the usual PHPmyAdmin web tool so I tried installing it. For my surprise the OS (ubuntu) replied back that it was already installed.

Hmm.. In a smart move I removed the package and installed it manually.

Now I could access phpMyAdmin but to my (second) surprise, I wasn't allowed to create any new databases since my default root user had no privileges for this task.

Well.. now began the intensive googling process for answers but few seem accurate and explain exactly what was required to achieve.

Tried literally dozens of different methods and none seemed to work as expected and I simply couldn't figure the logic related to this consecutive failure.

Gave a few more shots and after a few hours I could say to my deception that I had rendered the webserver functions of this server completely useless.

---

As last resort, decided to reinstall the OS from scratch and start all over again.

---

This time I took more time understanding what already came installed on the OS by default.

Looked on the work directories and still couldn't figure out why phpMyAdmin wasn't acessible from the web even thought this time after the restore I was perfectly allowed to manage mySQL from the command line interface.

Some more investigation proved quite relevant - I found an intriguing reference to "plesk" - but what the heck was a "plesk".

On a further google-crawl took to the respective product homepage where I was able to read their documentation.

So, plesk is a web based server administration tool (and a good one so it seems) but the most interesting fact is that you need to access throught a very particular port on your server.

Now why hasn't mentioned this on the first place?!?

Well.. adding the magic port number opened the doors to remote server administration with a nice UI.

I felt right at home at last..

From there was able to click on a shortcut to access phpmyAdmin and manage all my database related needs.

---

Now came the time to transfer the databases to the new server, the dumping of databases from the old server went fine (after some google for syntax examples to learn from) and transfered them with the simple wget to the new location (was a breeze to transfer 140Mb in little 10 seconds!).

Then it was time to upload the database into the mySQL from the new server - was also a breeze and went with no noticeable troubles.

Last but not least, edited the first site (winbuilder.net) with the details of the new server - but no dice!

Now why the heck wouldn't it work?

Used "telnet newmySQLhost -3306" and it wouldn't simply connect.

After too much time I figured that it was necessary to open the respective door on the server so that it was possible to reach it.

Now I could telnet, so I wrote a quick php script to test the connection and it would always complain back with some "connection refused".

Hmm.. more troubles?

Oh yes. Took me yet another good amount of time to discover that you need to need to allow the respective mySQL user to have enough previlege to access mySQL from an external location.

Sure thing, went back to phpMyAdmin and done as expected.

-----------

A bit tired since I'd been all day long on this very amusing task, I changed the configuration files for winbuilder.net and added the new mySQL settings - IT WORKS!!

Got too long and too tiresome for a task that could had been well documented from the start instead of wasting time on such things (yes I looked up for the documentation..)


Took little time to apply the same scheme for the other mySQL hosted sites like boot-land.net and the transition went smoothly.

------------

Guess I (re)learned the pleasure of learning and using the command line interface to get things done.

:)

Sponsorship from R1Soft

R1Soft is a well known company that is focused on server data protection in either Linux and Windows server machines.

I already knew the company after initially getting the top placement ad on the 911CD.net forum and later after acquiring the site.

The administrator of 911cd.net knew about our server woes on boot-land.net and was very kind to place me in contact with their company staff regarding the sponsorship of a dedicated server.

We have been experiencing really difficult work conditions since the past year as the site become more popular and started attracting more attentions. Now we are currently experiencing nearly 1.5Tb of monthly data transfer and over 150 000 unique visitors per month.

This frequently leads to "Error 500" server messages that keep everyone outside any of the sites hosted at boot-land.net

Yesterday, after some preparations and arrangements - the server was finally made available for our exclusive use.

It's a Pentium IV with 3.4 Ghz and 2Gb of RAM - more than enough to help balance our load.

Our current boot-land.net server is a tough survivor and has proven to resist several DDoS, frenetic spam bots and even supported the unexpected rampage of visitors over the years but heavy PHP/mySQL processing is still our weak point and they're slurping away all the available resources.

So the first step will be moving our databases to this external server as soon as possible.

After this operation is completed, it should be feasible to discuss and work on further features to take advantage of a fully dedicated server. One idea that comes to my mind is providing a much wider integration of winbuilder with the boot land community through the use of PHP to bridge the desktop software to the online world.

We certainly have more than enough horse power to discuss the improvement of boot-land.net so the future is looking very bright with no doubt.

As a conclusion note, my personal thanks to R1Soft, in particular to Mario Rodriguez.

You guys rock.

:)

1000 kilometers on pure electricity

I've just completed my first 1000 kilometers with the electric scooter that I've bought about two months ago.

It came from china and the price for this vehicle was lower than the one asked for "regular" gasolines ones, so here's is my feedback after wearing out the scooter on real work conditions for a couple of months.

- The chassis is poorly built - It's making a lot of noise everytime the asfalt has irregularities and this happens because some of the bolts that host the plastic cover have been broken.

- The engine sometimes does a few "funny" noises when the scooter is starting to move

- The light on the console panel that indicate whenever I had the direction change flashing light doesn't work anymore

- I "feel" that the batteries are not going as strong as when I've first bought the machine


And that's about it.

A lot of complaints for sure, but still a great way to move around and I really enjoy a lot.

:)

I feel sleepy

My vacations just began for the rest of the of month until mid-December and this is finally a good opportunity to stay in the house and help my wife take care of our son, but let me tell you - it's no easy task.

Because I needed to work, we decided that I would sleep on the bedroom while she would sleep in the TV room with our kid so that during the night I wouldn't lose my sleep while he woke up with the need to change the dipper or similar and this way she could also watch her favorite TV shows until late hours in the evening.

----

I needed to wake up everyday at 07h00 to get on my workplace on time and now that my vacations started I decided to stay awake later just so that she wouldn't be alone.

But let me tell you - her effort has been largely ignored by me. Only after staying with her a full night taking care of the baby I saw how difficult it was to get anything done or even try to get a few quality hours of rest.

The baby sleeps very tight and comfortable until 01h00 in the morning and then begins his activity time where he doesn't like to be ignored without attention for too long and will cry until someone picks him up in the arms.

It's been like this all night long and I woke several times whenever he cried a bit louder - my wife (poor of her) got even less sleep time than I did and she's been doing this 3 weeks now.

The only time break to sleep begins around 09h00 and lasts until about 13h00, that's the time interval when my wife usually sleeps a bit.

Not an easy task to be a parent, I try to help but in true honesty say that it's my wife who his having all the hard work. Yesterday we decided to go dinner outside and leave our son with our friendly neighbors that hosted Miguel in their house while we went to grab a nice romantic dinner on a close-by chinese restaurant and this was the only break she had this week.

Now, I've also decided to help more and cook myself the meals for us so that she won't have to worry about that either - but one should also note that I'm no expert in kitchen matters so our food is sometimes outsourced from Macdonald's, the local barbecue restaurant and includes a fridge full of frozen Pizza's..

Still, raising a young baby requires a lot of attention and it does leaves me quite sleepy all day long, sleep deprivation really makes people less focused on the things needed to be done on time but I hope that within a few months our son starts with longer and regular sleep time intervals.

He might cry a lot sometimes but it's a really amazing sensation to view him grow so much in such few weeks that makes me feel like all this effort is really worth while.

:)

Driver's License - finally!

I've finally completed my driver's license.

Today I took the final driving exam and all went well as expected.

It was a quite long tale to get a driver's license that began when I first turned 18 (age that you're allowed to drive a car). At that time I only drove small motorcycles and didn't had any money to support a car nor my parents had the conditions to afford buying me one.

As the years went by, I worked in very distant places and public transportation also seemed like the best option since I could use these voyages to work either on train or bus and don't worry about driving for hours.

Last, I've moved to the Azores and even thought I worked and lived at the same city, a car was never essential as everything was perfectly reachable by bus, friend's ride or even walk to where you wanted to go.

I also had several other reasons to avoid driving a car - they're not cheap to maintain and the oil prices make a significant weight on the monthly income.

Ironic my reluctance in driving a car, since kid that I had already collected permits for all kind of vehicles, had my first driving license when I was 12 to be allowed to ride a bike on the city street, later with 16 got my motorcycle license, with 19 I was allowed to jump off airplanes with automatic parachutes, 21 got my license for driving motorcyles above 125cc, with 23 was allowed to drive armored vehicles like artillery tanks and such but never - *ever* - desired to take formal lessons to be allowed to drive a car in the street.

Not driving a car was a personal statement that allowed to do things differently and I had lots of fun this way.

-------

But this year, many things changed in my life and I can no longer afford to think on my own personal preferences.

Becoming a parent brought many new things needed to take into account like the need of carrying my wife and our kid to wherever they need.

Also, where I work they even enrolled me on the driving course so that I could take this license without any costs so what would be the point in saying no?

-----

But even thought I am now allowed to drive a car, don't expect to see me buying one anytime soon. For the moment I will only drive my wife's car whenever she needs help, otherwise I'll prefer to keep driving my electric motorbike until I can get enough savings to buy myself an electric car - I don't consider myself an ecologist but I truly hate the thought of depending on gasoline to move around and being forced to spend so much money on this fuel.

It's revolting to think on the millions of people affected by this monopoly so I prefer to be amongst the people who use alternatives - who knows if maybe one day they don't become the main stream trend?

--

Next year by September I'll be moving again to main land, maybe then it will be a good occasion to take a trip around a few european countries and show my wife how things outside Portugal look like, she never even visited our neighbor Spain and I'd really enjoy some good vacations finding new places with her.

:)

Additional Network Certifications?

Since I've recently enrolled on the CISCO certifications, over the last months I've been wondering if the competition on network equipment field hadn't also decided to start similar certifications and ended up finding something quite interesting on SMC mentioned by a friend of mine.

They also have an academy that is offering certfications to people with network expertise, but with two fulcral differences:
  1. It's completely taught online
  2. It's free
Both of them are nice features, but more important than getting another certfication - what can you actually learn from it?

Well, I didn't knew the answers for my own questions so I went along and also enrolled for this certification.

To admit the truth - it was quite late at night when I started doing the first exam - the minimum grade was 65% to succeed and in some of the questions I admitedly used wikipedia to find the correct answers. In overall, finished the first exam with 71%.

To my big surprise, they won't make a .PDF version available for download, instead, they will actually send a neat looking printed version over to your house.

After finishing the exam and seeing this kind action from their part on a free course, I felt a bit bad about myself for cheating on some answers and not taking the test too seriously.

------------

The rest of the certification is composed with 3 more levels that increase of difficulty and I will certainly try to exactly as expected from a student perspective.

You're welcome to visit this academy here:
http://ulises.adam.es/smc/common2005/eng/etraining_p_home.asp

:)

CISCO - On the toes of a giant

Just finished another week of Cisco classes and on this sunny saturday we've been practicing the design of a middle sized network that employed around 16.000 machines working all together.

For me, as a network administrator, it's a very dazzling experience to work with these numbers of machines and imagine them all connected.

These guys can handle thousands and even millions of client machines and to think about the scale of such thing being possible is one of the things that I like the most about network engineering and makes it so attractive.

I've been really enjoying these last few weeks because the more I learn about the networks, the more I understand how I actually knew very little about them even after spending the past five years actively working on the administration of a LAN.

--------

And if I stay dazzled with the current level of work that we are reaching, then what should I expect for the next months?

Because to be honest, each new design or troubleshoot exercise can sometimes take hours to complete and it's a very exhausting mental process to get everything working together as expected.

On the first level where only LAN's were mentioned I felt how CISCO was really serious about networking and quickly made the difficulty level quite demanding to succeed on their proposed tasks.

It's funny because looking back to those tought tasks of the first level - now they almost seem like kids play compared to what we've been doing for the last few days and leaves me with some concern regarding what to expect in upcoming levels 3 and 4 of the CCNA.

The interest is not in finishing this course as quick as possible but rather learn as much as possible, it's amazing to see how so many network concepts were so well designed that survived for over 40 years and treat the past and future tecnologies with the same pragmatism.

Learning more about networks at this precise moment means an investment for the next 40 years were many of the concepts we see available today will still be there in the future decades simply because their design was built to resist time - amazing achievement if we consider that computers evolved so much in the same time period.

---

I was a bit tired after spending all day talking about networks but I guess that there's always a bit more of energy to dream on the possibilities.

:)

The C quest - how good are you when coding C language?

Well.. Imagine yourself left with a reputated and ancient language such as C that you had to solve a given code challenge.

How would you react?

This week I've been put to the test and had to solve a small code situation where I saw that my C skills were nowhere good at all.

Not that I don't know how to code but rather because my mind seems grounded to the delphi roots and refuses to use anything else (perhaps php being the exception)

Enough jiberish, let's cut to the chase and propose the challenge:

"Code a program where the user selects a positive integer number and your program outputs all the possible combinations of three numbers that summed up result in the number selected by the user. No number can be repeated after used once in any given combination"

For example, the user selects 12, and the program should output:
12 = 1 + 2 + 9

12 = 3 + 4 + 5

-----------------

This sounded like a fun task (except that it needed to be done in C but I do need the practise).

I spent the first two days of the week thinking about the possible approaches to solves this challenge programatically in mind or ocasionally jolting down something onto paper.

Before you ask - no, I didn't had a compiler. Never had coded anything before on Linux and now I was in need for a good IDE where I could code and just press the compile button to see the results. Eventually found myself enjoying code::blocks as it was as simple as an IDE can get.

To my dispair, I thought on many possible solutions but being stuborn as I am, none was simple and direct enough to please my taste for a clean solution.

I wanted to make the smallest possible code that would output what was asked and all my solutions seemed bloated and self-confusing.

Last night, I was working for 36 hours without breaks and decided to dedicate these boring work hours to solve this seamingly tough dilemma - who knows if I stare to code long enough some answer will come up? (does this ever work?)

And so I went to code.

Took four hours to try out the first ideas - used arrays, ini files, pointer and multiple loops and none worked.

Last, tried the route that I've should have taken from the start: Manually simulate the behavior of this program by testing some number and checking how it should iterate through the number sequences.

I tried 70 as the test number and used excel spreadsheet (or better yet, the openoffice version) and numbered a column from 1 to 70.

Next, I started to create sequences and removing the numbers from column as they were placed on the combination and behold at my results:

70 = 1 + 2 + 67 --> OK
70 = 3 + 4 + 63 --> OK
70 = 5 + 6 + 59 --> OK
70 = 7 + 8 + 55 --> OK
70 = 9 + 10 + 51 --> OK
70 = 11 + 12 + 47 --> OK
70 = 13 + 14 + 43 --> OK
70 = 15 + 16 + 39 --> OK
70 = 17 + 18 + 35 --> OK
70 = 19 + 20 + 31 --> OK
70 = 21 + 22 + 27 --> OK
70 = 23 + 24 + 23 --> WRONG!

It turns out that looking on the possible combinations for 70 it is so plain easy to understand exactly how a code function can replicate the same results, doesn't it?

My code ended up like this:

#include

int main(){
int a,b,c,max;

printf("Type a number bigger than 5 to showcase the possible sums with three numbers\n-> ");
scanf("%d",&max);
if (max < a="1," b="2," c="max-3;" a="a+2," b="a+1," c="max-(a+b))" d="%d" max=""><=11)printf("\n\n Only one combination is possible for %d\n",max); else printf("\n\n %d combinations possible for %d\n",a/2,max);}


So the relevant code here is
for (a=1, b=2, c=max-3; b
printf("\n%d = %d + %d + %d",max,a,b,c);

It's truly amazing what a FOR statement can do in C language and how it can produce all the required combinations for our goal.

--------


In conclusion, from this challenge I can say that I've learnt at least two things.

  1. C is growing outdated but features like these on FOR make it a tool worth digging some more attention
  2. Next time I have a code task like this one, I'll certainly remember beginning with the manual simulation of the expected results.

-----------

What about you?

Do you feel confident to produce an even smaller or more compact solution for this challenge in C?

You're invited to post your code suggestions!

:)

First impressions from Ubuntu 8.10

WOW..

Everything works on my HP laptop straight out of the box.

I connect my Vodafone USB Internet box and it gets recognized. The touch screen is working, all codecs and proprietary drivers were presented to be activated and my machine is even running faster as I've stumbled on small tool to tweak the clock rate of the CPU to peak performance.

Since I was reinstalling from scratch, this was a perfect opportunity to clean things up since I've been doing a lot of experiments that leave too many junk files behind.

This new version is simply working great and was so simple to setup. I even installed this new OS version using a pendisk and the process to create them is remarkably easy when compared to the respective windows counterparts.

Ubuntu is getting better and better at large steps without doubt.

Instaling VirtualBox 2.x on Ubuntu 8.10

This is very easy and I'm not kidding.

Visit the download site for virtual box:
http://www.virtualbox.org/wiki/Downloads

Get the version that matches your Ubuntu, install the .deb package by double clicking and follow the instructions.

This should get your Virtual Box up and running, but what about USB support?

I'm proud to mention that this step just got a whole simpler.

Type this on the console:
echo "none /proc/bus/usb usbfs devgid=$(grep plugdev /etc/group | sed 's/plugdev:x:\(.*\):.*/\1/'),devmode=664 0 0" | sudo tee -a /etc/fstab

And then:
sudo /etc/init.d/vboxdrv setup

After these steps all you need to do is reboot and start working with VirtualBox.

USB can now be selected from the virtual machine configuration.

----------

These instructions came from this article:
http://ubuntuforums.org/showthread.php?t=828927

Have fun!!

Got myself a new cellphone!

It's not Christmas yet but I've just bought myself a new treat - a new cellphone.

This was a necessary measure.

Last time I bought a cellphone for myself was a Sony Ericsson from mid 2005 about 3 years ago.

This machine was not expensive at all and my whole family got a lot of them from the same series which was kind of cool since I didn't had to worry about finding a power charger as they were spreaded everywhere around the houses of my relatives.

Two weeks ago, my wife's phone went kaput and the screen display refused to work even thought the rest of machine "sounded" ok.

As I don't care much about cellphones I lend her my own phone and got hers instead.

This ended up not being a good decision as everytime I got call I wouldn't have any idea about who was on the other side of the line which kind of provoked some confusions on people because I had some troubles in recognizing their voices.

----

So, I decided to buy a new machine once for all.

And I got hipnotized by an HTC equipment - the Pharos.



Looking on internet reviews it was called as the lower end price HTC device when compared to other similar machines from the same brand - but what the heck?!?

This HTC has GPS, Windows Mobile 6.1 and fits so well on the hand that is confortable to take anywhere and make calls or send messages. My last PDA was bought in 2003 and I had to order it from the US since they were way too expensive. I know technology has evolved since but I'll certainly be quite happy with such gadget.


The price was very affordable for this sort of machine - 200 euros, but still a bit above my budget so I decided to sell my china-cellphone-wristwatch-toy for 80 euros to alleviate the PDA cost - all in all it's a good trade as the watch was mostly a toy with little professional use and at least the PDA can both be fun and help out at work.

So I'm now the proud owner of an HTC Pharos that costed 120 euros.

----------

What have I been doing with it?

I've installed Sudoku (no better way to pass the long waiting time), also got installed some GPS software to track down the velocity I'm moving - one interesting program counts the time and distance that I do over a football field (for example) or beeps an intense alarm if I'm going in excess of speed on the highway.

Copied a lot of my favorite MP3 albuns to listen while I drive or want to hear some music - for some sad reason it's difficult to play .AVI music videos that I converted from YouTube.

Tried a lot of software to make my HTC look like an IPod but didn't ended liking the Ipod interface because it was good looking but a bit too limited.

Took some pictures from the weekend trips.

Oh well.. Did everything except making or receiving any phone calls for some coincidental reason.

Guess I don't really need a phone, at least I got a PDA to play with on my free time.. ;)