MySQL – Setting up initial privileges

Ever install MySQL and wondered what to do next? Well, the first thing is to secure the root user (Note: The MySQL root user is different from the OS root user). These three simple steps should deal with it.

shell> mysql -u root mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD(‘new_password’);
mysql> FLUSH PRIVILEGES;

MySQL has really good documentation on their website. It is can be accessed here.

Dlink 614+ and Dynamic DNS

I purchased a server from Dell recently. Want to use it as a test server to play with at home. I have a small LAN at home setup using a Dlink 614+ router. I forwarded some services to the server, so that I can access it remotely. Since the IP address on my cable modem changes every so often, how do I access it remotely? Dynamic DNS from dyndns.org to the rescue :).

Register for an account over here.
Create a Dynamic DNS host on Dyndns.org
Log into the 614+ router
Go to Tools –> Misc.
Enable DDNS
Use members.dyndns.org as the server address
Enter the complete hostname (ex. Samurai.kicks-ass.net)
Enter the username and password that you have registered at dyndns.org
Click on “Apply” and you are all set.

Swimming Lessons – Day IV

This was the first day of swimming lessons that I didn’t manage to drink half the water in the pool :). I was not even planning on going to the lesson this week. I was pretty tired after a 12 hour shift a 3 hour Japanese lesson (more on that later). I come home and lay down. I came with the lame excuse of “1 week of missing lessons won’t matter :)”. But luckily for me, one of my colleagues woke me up regarding an issue at work. Although I am not a firm believer in God, this just seemed too much of a coincidence. So off I went to the lesson. The only new thing we learnt in this lesson was “frog kick“.

Frog Kick
1) Kick with your legs in a frog like fashion. Pull in legs and bend knees. Then kick out both the legs spread out. Click the legs together and then pull them in. Repeat..

2) The same time that you are doing the above with your legs, push your self forward with both the arms.

Terminal prompt – L[U]nix

While browsing through the forums at ArsTechnica, I came across this posting. One of the poster had a pretty cool prompt on his terminal login screen. Here is the command he used to get that effect

export PS1=”\n\[\e[30;1m\][\[\e[35;1m\]0\[\e[30;1m\]] \[\e[0m\]\[\e[36m\]\h\[\e[37m\]:\[\e[34;1m\]\w\[\e[30;1m\]$ \[\e[0m\e7\e[1G\e[1H\e[1K\e[30;1m[\e[33m\j\e[30;1m] [\e[32;1m\!\e[30;1m] [\e[36m\u\e[30;1m] [\e[31;1m\d\e[30;1m] [\e[35m\@\e[30;1m] [\e[0m\e[36m`uname -sr`\e[30;1m]\e8\]”

Or if you are using Redhat, you can just edit the /etc/profile file and place the above command in it. So each time you log in to the system, you get this pretty cool prompt. I keep saying that it is cool :), but don’t give any explanation. I think a picture is due here…

Terminal Prompt

For the initiated..you can come up with your own neat tricks by reading this.

DDoS attacks :: Article

Came across this article on security-protocols.com in which the author discusses DDoS (Distributed Denial of Service). I was particularly interested since we have been experiencing such attacks on our network recently. Unlike DoS (Denial of Service) attacks where the source of attack can be easily identified and blocked, it is very difficult to identify the source of DDoS attacks. The only way we can stop the attack is by blocking all traffic to the destination of the attack. And this is exactly what the attacking party wants. I don’t see a solution to this in the near future. A good point that the author mentions is that all routers should have ingress and egress filtering configured properly. This in effect allows only authorized networks to originate and terminate at a router, thereby minimizing the ability of an attacker to use a spoofed IP address.

Swimming Lessons – Day III

It has been a busy week. I didn’t get a chance to practise swimming at all. I was hoping that it would rain, so that the lessons get cancelled :). It was a bright sunny day as usual 🙂 and I had to go to the lessons. Didn’t learn anything new, but managed to drink up half the pool. There was a scary moment, when I thought that I was going to drown. Seth, the instructor says, “Vinay, whenever you feel that you are going to drown, just breath deeply and point your chin towards the sky. You will float”. Good advice, but frankly, when one is drowning there is no time to think clearly. You thrash around like a wild thing. Breath deeply and keep your chin up is the last thing you think about :). As if though my prayers were answered, it started thundering after the first 15 minutes of the class. We were all asked to come out of the pool to avoid being hit by lightening (more like avoiding potential law suites 🙂 ). Apparently we are not supposed to go into the pool for 15 minutes after we hear thunders. And the class only lasts for 45 minutes. So the instructor asked us to go home. Man, was I happy or what :). This reminded me of days in school, when the school would be closed for bad weather.

Note to self: Must buy kickboard and practise.

A bit of satellite technology

As mentioned here, I work in the satellite industry. I am pretty new to it and everyday is a learning experience. Today, I sat down with our in house satellite guru and found out how one calculates the bandwidth occupied by a carrier from the from the data rate on a satellite link. The formula is

BWAL = (Sr*1.4)

Where
BWAL = Bandwidth allocated for the satellite link in Khz.
Sr = Symbolrate of the link in Ksym/s (Kilo Symbols per second).

Sr in turn is calculated using the following formula

Sr = Dr*(1/MI)*(1/FEC)*(1/RS)

Where
Dr = Datarate in Kbps.
MI = Modulation Index (The values of MI for the different modulations are BPSK=1 | QPSK = 2 | 8PSK = 3 | 16PSK=4 | 16QAM = 4).
FEC = Forward Error Correction.
RS = Reed Solomon value. This can vary depending on what values are being used. Reed Solomon is an external codec as compared to Turbo which is a stand alone codec. If RS is not being used in the link, then a value of 1 is used.

Pretty confusing eh :). As if though this is not enough, there is another value called Information rate (Ir). And the formula for that is

Ir = Dr(1/RS)

Think that is enough satellite technology for one day :).

Link Speed – Maximum speed per session

I work at a teleport and most of our business is related to providing Internet service to ISPs in South Asia. One of the most frequent complaints that our help desk gets is “My link is slow, you guys are not providing us the complete speed”. Usually it is a case of the customer not understanding the finesse of TCP/IP. I came across this article by Adam Grow III. He uses the following formula to calculate the maximum possible speed per session on a link.

Throughput = 8*(TCPS/PropDelay)

Where
Throughput is measured in Kilobits per seconds (Kbps)
TCPS = Size of the TCP/IP stack in byte (Windows default is 8192)
PropDelay = propogation delay in seconds

Using the above formula, for a geostationary satellite (where the propogation delay is ~540ms), the throughput is ~120Kbps. So even if the client has a 1Mb link and he just has one session, he can only use a fraction of the link. Only multiple sessions can saturate the link.

Not saying No, means Yes!!

I subscribed to the Honolulu Advertiser back in August for 9 weeks. At the end of the 9 weeks I kept getting notifications to renew the subscription, but since I didn’t want the paper any more, I kept ignoring the notices. And as any normal person would think, if you have not asked someone to renew your subscription or paid for it, they should just stop delivering the paper right.. WRONG!! They delivered the paper for a couple more weeks and then call me today saying “Sir, you are overdue on your payment”. I was really mad, but then the poor lady who called is not responsible for that, so I was cool and paid the bill. So people beware…You should say “NO” :), or be ready to fork out the cash.