Skip to main content

Posts

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); ...

A legal alien?

Yesterday, I was triggered by my ego to attend a session of WMSU’s review for the incoming ICT proficiency exam. Each student spent a total of Php 460.00 for the review and test fee. It started last week. Passers of the said exam are guaranteed to be certified ICT professionals as noted by NCC. I was curious about how the review was being held. I was able to set myself in the classroom without catching much of the professor’s attention. It was my first attempt. I was somehow excited at first, but as the review went on, the professor did not talk that much and started filling up the chalkboard. The topic was about data structures. I was surprised with what I have found out. I bet you have the idea.

A sticky lesson

With a dial-up connection reaching 14kbps at max, an ‘emerge-delta-webrsync’ consuming only 5 minutes of your uptime, a free access from 0000H - 0800H, and a script that does nasty things like disconnect after ‘emerge -f foo’ and switch to ‘init 0′, You will not be able to resist the clamor for an up-to-date box. The lesson began here: root@kee# emerge =sys-devel/gcc-3.4.4 This does not mean dirty! joset@kee$ eix -e gcc * sys-devel/gcc ... Installed: 3.3.6 3.4.4-r1 Homepage: http://www.gnu.org/software/gcc/gcc.html ... Found 1 matches joset@kee$ Not realizing that having multiple GCCs installed is normal, and without following the upgrading-gcc-guide, a stupid action followed. root@kee# emerge -C =sys-devel/gcc-3.3.6 Bang! libstdc++.so.5.0.6, where the hell are you? All programs linked dynamically to this library were paralized! My intention was to clean up gcc-3.3.6 since I have emerged gcc-3.4.4 recently. A...

The true emptiness

It is very important for me to express to you how much you really mean to me. I wish I could do this in person exquisitely. But since we are physically separated by miles of emptiness, this expression must come in the form of letters such as this. Life seems to be full of trials of this type which test my inner strength, and more importantly, my devotion and love for you. After all, it is said that “True Love” is boundless and immeasurable and overcomes all forms of adversity. In truth, if it is genuine, it will grow stronger with each assault upon its existence. I am happy this way. Life is so kind for giving someone like you as my sole inspiration. My love has been assaulted many times, and I am convinced that it is true because the longer I am away from you, the greater is my yearning to see you again. Across the miles, I send to you my tender love and my warm embrace. Thank you for being one of my life’s sweetest blessings.