Skip to main content

Posts

Locked and loaded

Today is the second day of the Senior Summer Trainings 2006 . Yesterday, we have started off MySQL running on Ubuntu. We did just simple exercises but very worth-doing even if I had previous experiences with the subject. To Ma’am Flisha Fernandez, thanks a lot. The Ateneo Spirit of Magis has a way of rewarding people like you. [Kernel] Please welcome “The Instrument of Doom” linux-2.6.14-kee-innovative with nVidia support. I have purchased a second-hand graphics card (GeForce FX 5700 256mb 128bit) from a friend. Good to go! [Gig] I hope the training will end up earlier than the usual time. I have to warm up for the gig tonight at Park 88.

Getting the feel of the groove

Junior year’s over. New daily schedule has emerged. In a day there must be at least 2 hours of bass exercises which include music bass theory, scales, funky bass lines, and jamming sessions. 6 hours of programming (right after this sissy FoxPro RDBMS project). In weekends, there must be at least 2 jamming sessions with my band for compositions and reviews. Play at different bars at night, for pleasure and income. My top priority for this summer break is to code some modules for our final project ahead. Of course, schedule is subject to change due to unpredictable and uncontrollable forces such as heavy household chores, family affairs, family business, or anything that concerns morality.

Palindrome syndrome

I really do not enjoy coding in MS Visual FoxPro but I have no choice. Damn! I swear not to use it any longer after this RDBMS project. I was asked by a friend to code a simple program to check if a string is a palindrome. I miss coding in C and assembly a lot! So to satisfy my urge, I tried to do it in a different manner. A timed coding session! #include<stdio.h> #include<string.h> #define MAXSTRING 50 int main(void) { int i; int ctr = 0; char c; char string[MAXSTRING] = "\0"; char temp[MAXSTRING] = "\0"; printf("Enter a string: "); for (i = 0; (c = getchar()) != '\n'; ++i) string[i] = c; string[i] = '\0'; for (--i; i >= 0; --i){ temp[ctr] = putchar(string[i]); ++ctr; } if (!strcmp(string, temp)) printf("\nString is a palindrome!\n"); else printf("\nNot a palindrome!\n"); return 0; } I finished coding in 4 minutes and 37 seconds. Not a good record though. So sad.

LPT1 stepper motor control

Last Sunday, I was coding some modules for our RDBMS project and playing Dungeon Siege: Legend of Aranna (quite old but it would be a waste of time if I did not) in parallel. I received a phone call asking a favor to write a program for sending signals through the parallel port. It sounds a little scary at first because I did not have any idea on parallel port interfacing. Let me explain the project. The project is a Car Control System. They have 2 bipolar stepper motors. One is responsible for the forward-reverse function and the other one is for the left-right function. Signals recognized by the floppy drive stepper motor: Clockwise 18-degree turn 1001 or 0x9 0110 or 0x6 Counterclockwise 18-degree turn 0110 or 0x6 1001 or 0x9 Now, how is it possible to send these signals using the parallel port? Not all 25 pins are needed. For this project, only the data pins are needed. Pin Function 2 D0 3 D...

Ethical hacking, a glimpse of my Philo paper

Is hacking ethical? It is if viewed within the context of the three definitions offered: hacktivist, hobbyist and researcher. We have the right in this country to protest, and if our activism takes a digital or electronic form, we have the right to do so. But don’t take my word for it. Who are ethical hackers? These early efforts provide good examples of ethical hackers. Successful ethical hackers possess a variety of skills. First and foremost, they must be completely trustworthy. While testing the security of a client’s systems, the ethical hacker may discover information about the client that should remain secret. In many cases, this information, if publicized, could lead to real intruders breaking into the systems, possibly leading to financial losses. During an evaluation, the ethical hacker often holds the “keys to the company,” and therefore must be trusted to exercise tight control over any information about a target that could be misused. The sensitivity of the in...

A change-gas

The danger of reading Randall Hyde’s book, The Art of Assembly is that it contains addictive substances. Yesterday, I have decided to joset@kee $ su -c "emerge -C nasm" After cleaning up, a tune-up followed .data msg: .ascii "A small step for me is a big leap for... me!\n" len = . - msg .text .global _start _start: # write string to stdout movl $len, %edx movl $msg, %ecx movl $1, %ebx movl $4, %eax int $0x80 # exit movl $0, %ebx movl $1, %eax int $0x80 Now I have finally made a change-gas. Expecting a lot of maintenance work to follow.

ADZU openlab scutworks

I really do not enjoy network administration a lot but the tasks listed below are rewarding. Let optimism light the path. 0] Tweak and secure box 1] Video screen capture 2] ADZU Debian repository 3] OpenAFS and Kerberos 4] IPv6 5] Honeypot 6] SETI Expect postponement of blog posts. Everything will be documented here upon completion. Signing off through a quote by Mr. Oscar Wilde Experience is one thing you can’t get for nothing.

Verify user in /etc/passwd

This is a product of wonder. In file verify.c #include <stdio.h> #include <string.h> #define MAX_LENGTH 1024 int is_local(char *user) { FILE *fd; char line[MAX_LENGTH]; int local = 0; if(!(fd = fopen("/etc/passwd", "r"))) { puts("Can't read /etc/passwd, exiting."); exit(1); } while(fgets(line, MAX_LENGTH, fd) > 0) { if(!strncmp(line, user, strlen(user))) { local = 1; break; } } fclose(fd); return local; } Use at your own risk. Disclaimer: Please refer to my first post ‘General notice’ Posted using Scott Yang’s mtsend.py python script. Thanks to Niel for his cool vim mappings.

A hidden post made visible

I was afraid to make this available in public. When I tried to browse some counterpart of it in other distros, I have realized that there are a lot of similar topics found even in the official forums of major distros. There are many people doing this already. So for people ranging from lowerclass to middleclass, who can not afford a digital subscriber line, here is a wiser alternative. If you have a Smartlink chipset winmodem in possession, then you are a bit luckier than those who own a Conexant chipset winmodem. Smartlink drivers are available for free eversince. Conexant drivers (lin*xant) were freely distributed during the 2.4 series era. This means, 2.4 kernels can still abuse the driver’s full-functionality. Bad news for 2.6 starters, 2.4-2.6 shifters, and 2.4 starters who hold Conexant chipset winmodems. Why? 1. Free drivers for 2.4 series are no longer available in the official repository. 2. Drivers for 2.6 are free but limit your bandwidth to 14.4kbps. Free isn...

Test mtsend

mtsend.py is a command line tool written in python. It uses Movable Type’s XML-RPC interface. It appears that it also works with WordPress’ XML-RPC interface. So I have decided to give it a try. In file ~/.mtsendrc [global] default=eradicus [site-blogsome] url=http://eradicus.blogsome.com/xmlrpc.php username=***** password=***** encoding=UTF-8 [blog-eradicus] site=blogsome blogid=1 It works! joset@kee$ ./mtsend.py -B blogsome +----+-----------+-------------------------------+ | ID | Blog Name | URL | +----+-----------+-------------------------------+ | 1 | Sophie | http://eradicus.blogsome.com/ | +----+-----------+-------------------------------+ joset@kee$ ./mtsend.py -C +----+----------------------+ | ID | Category Name | +----+----------------------+ | 5 | Healthy Vices | | 2 | Of Love and Romance | | 1 | Progressive Studies | | 3 | Uncategorized | | 6 | Unsolicited Opinions | +----+------------------...

Queued tasks

Hopefully these features would be added on the game soon. 1. Nick completion 2. Default turn time limit 300/150 3. Display number of players 4. Notify if a player leaves 5. Sortable columns in lobby The root of all evil in programming starts at early optimization in coding. - Donald E. Knuth

Wesnoth terrain

How are maps created? How are terrains organized? These questions are no way different from asking how GNU/Linux works. The brief explanation is, it is very complicated! Conceptually it works like this: Terrains are defined in terrain.cfg . They get assigned ID, name, char, etc. A snippet of terrain.cfg # Terrain configuration file. Defines how the terrain _work_ in the game. How # the terrains _look_ is defined in terrain_graphics.cfg . # NOTE: terrain id's are used implicitly by the in-game help: # each "[terrain] id=some_id" corresponds to "[section] id=terrain_some_id" # or "[topic] id=terrain_some_id" identifying its description in [help] [terrain] symbol_image=void id=shroud name= _ "Shroud" char=" " [/terrain] [terrain] symbol_image=fog id=fog name= _ "Fog" char="~" [/terrain] [terrain] symbol_image=ocean id=deep_water name= _ "Deep Water" char=s submerge=0.5 unit_height_adjust=-3...

Unix half-duplex pipes

The pipe ‘|’ is a type of inter-process communication. Its facilities provide a method for multiple processes to communicate with one another. Simply putting a pipe in between is a method of connecting the standard output of one process to the standard input of another. joset@kee$ ls -l | grep -i foo In the example above, the output of ls is written to the input of grep. Obviously, the output of grep is written to the standard output of the shell, the screen. Here is how a pipe works. #include<stdio.h> #include<unistd.h> #include<sys/types.h> int main(void) { int fd[2], n_bytes; pid_t child; char string[] = "Hello, world!\n"; char readbuf[80]; pipe(fd); if ((child = fork()) == -1){ perror("fork"); exit(1); } if ((child == 0)){ /* child process closes up input side of pipe */ close(fd[0]); /* send "string" through the output side of pipe */ write(fd[1], string, strlen(string)); exit(0); ...