Going back to what I used to be (inspirational dissactifaction)

So i’m happy with myself but not satisfied with myself. I think it’s about time, I show the stuff am really made of.
I finally decided to visit what I really loved to do, electronics; In fact I have decided to teach it. This is what comes naturally but someway somehow I abandoned it to seek other things; I won’t go into that yet but I have realised after so many years of building radios, transmitters, rectifiers and such, it’s time to visit my old time hobby but in a grand style. Yeah I want to venture fully into digital electronics the roots of all digital computing; logic gates and Integrated circuits. So I have designed a module and I already have students who are going to be tutored based on my modules with hands on practise. One thing i’m looking to achieve, is to teach programming of microcontrollers and building of intelligent devices. If some dude won’t teach programming of microcontrollers and robots in their school, i’ll in my school (VolsBIT School of Engineering). In fact I am not going to complain about the current educational system in Ghana; In fact it is a complete joke. Complaining alters nothing in the current trends of doing things in this country. So my brethren I have taken it upon myself to rectify the system.

Changing your MAC (Media Access Control) address in Linux

Changing the MAC (Media Access Contol) Address of your ethernet card in Linux.
Below are the steps for achieving this task

1. we bring the interface down. In my case I am going to bring my wireless interface down

sudo ifconfig wlan0 down

2. set the new MAC Address this way

sudo ifconfig wlan0 hw ether 00:22:fb:cf:bf:b4 # the MAC address is a series of numbers delimited by a colon

3. Now confirm if the MAC address has changed

ifconfig wlan0

A lot of people might want to go into changing their MAC Addresses for various reasons
but I am not going to talk about that here.

an ethernet card

network scanner

For a very long time I have been wondering how ettercap does a pretty quick scan to return the IP to MAC address mappings of all the nodes on a network.
Anyways, the traditional way of doing this from the terminal on a Linux box is to first ping broadcast and then view the contents of the ARP cache.

Assuming I am connected to a wireless network with a broadcast address of 192.168.11.255, I’ll do like so:
ping -b 192.168.11.255 then hit ctrl^c after sometime.

The next thing is to read the content of the ARP cache by issuing the below command.
arp -a

Conversely, type this at the terminal for a rather verbose output
ip neigh show

But I reckon this is a very slow method and it doesn’t work too well for me. So what? I decided to write a threaded program in Python to do the trick
Let’s assume we are on a subnet mask of 255.255.255.0 for simplicity sake i.e that particular network can support a maximum of 254 nodes or computers with 192.168.11.255 and 192.168.11.0
addresses reserved for broadcast and network address respectively.

This is the code for achieving the same thing in a very quick way

#!/usr/bin/env python
# source file: threaded_scan.py

from threading import Thread
from os import system

class somethread(Thread):
        def __init__(self, ip):
                Thread.__init__(self)
                self.ip = ip

        def run(self):
                system(“ping -c 1 192.168.11.”+self.ip) # this sends a ping echo request once to the given ip address

threads = []

for i in range(1, 254):
        thread = somethread(i)
        thread.start()
        threads.append(thread)

for th in threads:
        th.join()

save this in a file and make it executable using this command
sudo chmod +x threaded_scan.py

then type
./threaded_scan.py

afterwards issue the command below to see the contents of ARP cache
ip neigh show | grep -i reach
viewing content ARP cache

Concurrent Programming in Python

Concurrent programming in Python using Python threads has never been so sweet and easy as this. Today I’ll go over playing a set of movies simultaneously using the threading module provided by python. I have written a program to stream four different movies at the same time using vlc. Below is the code for going about it.

from threading import Thread
import os

movies = os.listdir(‘/home/volsbit/movies’) # returns a list of movies

class mythread(Thread):
        def __init__(self, movie):
                Thread.__init__(self)
                self.movie = movie

        def run(self):
                system(“vlc %s” % self.movie)

# now we create our threads

threads = []

for movie in movies:
        thread = mythread(movie)
        thread.start()
        threads.append(thread)

for th in threads:
        th.join() # a call to join ensures all threads wait for the other threads to finish executing

movies streaming concurrently

Virtual mobile Phone

VMobile


So I finally gave up learning pyQt to start learning pyGTK. I recall saying sometime ago I was going to develop some apps in Linux. Yes it has began. The first on the list is a virtual mobile desktop application ‘christened’ VMobile. Vmobile is all written in Python with the GUI front-end built in pyGTK. The desktop app basically allows you to make and receive phone calls, send and receive SMS messages all via a GSM/GPRS modem. It features a cool set of built-in DTMF dial tones just like any traditional phone does. It even has the ability to cut incoming and outgoing calls alike. All you need is a head-set connected to your PC and a credit-loaded modem and you are set. No internet connection needed. In fact it is a sweet project and I am glad it kick-started as planned. There is more to come and I’ll keep you posted. I have not been that of an active blogger though but I’ll make up for those.

Installing a Light-weight Linux Distro

I have this, somewhat antique Dell desktop lying in my ‘office’ at home. Talking about the specs, it has a processor speed along the lines of 500Mhz (not too sure) , 128MB of R.A.M and 10GB of hard disk space.
Today, I’m thinking of transforming this box into something pretty useful. Hmmn!!! Now exactly what comes to mind… I have been using Ubuntu for some time now. In spite of the fact that I’m comfortable working in this environment, I want to try something rather challenging but intuitive as well (never mind, that is relative). Come to think of it, installing a light-weight linux distro won’t be a bad idea, to say the least. Without wasting much time I reached for google, and the candidates that first came up where Puppy and DSL (Damn Small Linux), lovely names, innit? But anyways, I’ll go for the latter. 50Mb of Hard Disk space will make for a fresh install, very impressive indeed. So I’ll just grab the ISO and shoot straight away. Obviously, this ain’t going to transform my machine into a super dubba one but for a guy like me I reckon it’s going to be fun, at best. :) Other things I may be looking at is building my own front end GUI’s to the many command line utilities linux provides (this hopefully I’ll do in Python). Without further ado …..

Linux

Welcome to my blog

This is a blog dedicated to computing and technology and everything about myself.

Follow

Get every new post delivered to your Inbox.