Sunday, August 31, 2008

Simple Timer in python to track my customer usage.

I have customized a timer written in python that will suffice my need for my Internet shop, I know allot of good ready apps out like CafeconLeche and Outkafe I'm still fixing my dev box so I have some thing to test on before I deploy it to my ltspsrver. Below is the source code:

#!/usr/bin/python2.5

#####################################
## Author: Christian Wyglendowski ##
## Customize by: AC ##
## Date: 08.31.08 ##
#####################################

import time
import threading
class Timer(threading.Thread):
def __init__(self, seconds):
self.runTime = seconds
threading.Thread.__init__(self)
def run(self):
time.sleep(self.runTime)
print "Buzzzz!! Time's up! workstation ",ws
t = time.strftime("%H:%M:%S")
print t

##Q:How many second in one hour?
##A:1 hour = 3600 seconds
##Q:How many second in thirty minutes?
##A:1 minute = 60 seconds
## 30 minutes = 60 x 30 = 1800 seconds

ws = raw_input("workstaion no.: ")
num = input("In seconds: ")
stTime = time.strftime("%H:%M:%S")
print stTime
t = Timer(num)
t.start()



How to use it just make the code executable (eg. chmod +x timer.py) then run it ./timer.py it will ask which workstation that needs to track the usage then how many second will the client use the computer so remember 30 min equals to 1800 second and 1 hour is equal to 3600 second then let the script do the counting for you. Below is a sample output:

$./timer.py
workstaion no.: 1
In seconds: 1800
15:30:31 ----> start Time
Buzzzz!! Time's up! workstation 1
16:00:31 -----> end time

next time i'll try to put a alam sound or it will blink a red light on the screen if time is up, for now this is ok for me.
note: this is only good for 4 - 10 workstation coz you'll be opening lots of terminal.

Friday, August 29, 2008

Fujitsu ESPRIMO MOBILE U9200

late blog again, but anyway here goes... I bought a Fujitsu ESPRIMO MOBILE U9200 notebook and I would like to share with you my experience using ubuntu 8.04 on it. I'll start with the specs I got the spec details from fujitsu.com/sg because its same specs as mine.

Specifications
Platform Intel® Centrino® Duo processor technology
- Intel® Core™2 Duo Processor T5250
- Intel® PRO/Wireless 4965AGN
- Intel® 965GM
Operating System Ubuntu 8.04.2
(or ships with with Knoppix Linux DVD)
Display 12.1-inch WXGA TFT, 1280 x 800 pixels
Modular Bay Device Dual Layer DVD Super Multi Writer
Memory 1GB DDR2 667MHz
Hard Disk 160GB
Battery Up to 4 hrs1 (6-cell Li-ion 5200mAh)
Weight 1.9kg
Detailed Specifications
Hard Disk Drive SATA-160 (5400rpm)
Graphics Integrated Intel® Graphics Media Accelerator X3100 with Intel® Clear Video Technology5 and DVMT4 4.0 delivers low-power, high-performance 2D/3D graphics with Shader Model 3.0, video and display capabilities at a max. shared memory of 384MB
Audio RealTek ALC262 Sound Chip with stereo speakers
Audio-in: (line-in / microphone)
Audio-out: (line-out / headphone)
3.5G Ready6 Upgrade now to embeded 3.5G(HSDPA) WWAN connectivity of up to 7.2 Mbps7 downlink. - Also Supports EDGE7 and GPRS7
Communication 1.3 Mega Pixel camera, Optional 56K V.92 modem6, built-in 10/100/10002 Mbps Marvell 88E8055, Intel® PRO/Wireless 4965AGN network connection and optional Bluetooth® v2.0
User Interface Keyboard 86-keys, 19mm pitch, 2.5mm key stroke
Touch Pad with two mouse buttons
Card Slots 1 x ExpressCard™ 34mm slot, Memory card slot (SD, MS, xD and MSPRO)
Connector Interface USB 2.0 x 3, VGA (external display), S-Video out (TV-out), Memory Card, RJ45 (LAN), Optional RJ11 (modem)6, Audio-in, Audio-out, Power Adapter DC-in
Security3 User and supervisor BIOS password, Anti-theft Lock Slot
Dimensions 300mm (W) x 223mm (D) x 37mm (H)
Bundled Accessories6
AC Adapter Input AC 100~240V, Output DC 20V/90W Adapter

Now I will discuss the once that did not work out of the box and the hack that I did to work.

*wifi
description: Wireless interface
product: PRO/Wireless 4965 AG or AGN Network Connection
vendor: Intel Corporation

not really a hack but I just update my kernel to 2.6.24-19 and install wifi-radar. try to playing around with the wifi and bluetooth in the bios settings by disabling then enabling it helps detect the driver in boot time.

*headset jack
when you plug the headset jack the sound is still coming out from the speakers, hack for this is edit /etc/modprobe.d/alsa-base add the following line options snd-hda-intel model=hippo

*
gyache-improved + webcam
Im usnig gyache-improved to chat with yahoo acct because this sofar I have tested to view webcam in yahoo. thanks to loell for helping me out here. You need to compile and use http://www.swift-tools.net/Flashcam/

$ tar xvf flashcam-X.Y.tgz
$ cd flashcam-X.Y
$ make
$make install

$ sudo flashcam -L
Scanning devices
------
Found V4L2 Capture device: /dev/video0 (uvcvideo/FO13FF-65-1 PC-CAM)
------
Executing: 'modprobe vloopback pipes=1'

$chmod o+rw /dev/video*

$ flashcam -qD
Forwarding frames from /dev/video0 to /dev/video2

$make uninstall clean

Open now gyache and start your webcam.

*3G phone
I have a nokia E61 that can be a modem for my ubunto. here is my wvdial config.
edit /etc/wvdial.conf

[Dialer Defaults]
Init1 = ATZ
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
#Init3 = AT+CGDCONT=1,"IP","internet"
Init3 = AT+CGDCONT=1,"IP","http.globe.com.ph" #you could find this in your phone setting
Modem Type = USB Modem
ISDN = 0
Phone = *99#
New PPPD = yes
Modem = /dev/ttyACM0
Username = yourusername
Password = yourpassword
Baud = 460800
Idle Seconds = 3000
Auto DNS = 1
Stupid Mode = 1
Compuserve = 0
Baud = 460800
Dial Command = ATD
Ask Password = 0
FlowControl = NOFLOW

run wvdial and open your favorite browser and your ready to surf the net.

The rest are working out of the box.

note: Try this at you own risk, so far this works for me.


Wednesday, August 27, 2008

myturf Internetshop

Its been so long after I have posted here again. I've been busy setting up an internet shop here in my dads hometown. I just open an internet shop powered by FOSS from WIFI router to workstation. I'm using Ubuntu 8.04.1 ltsp mode in installation to save up hardware expense but there are some drawbacks one example is the webcam. Ltsp5 does not support yet a webcam to its workstation. My work-around for a webcam user is to use my extra laptop that has hardy installed on its harddisk. But so far the rest are working out of the box. For browsing they are using Firefox, Gyach-improved for chatting, Skype if they want to talk to their love ones. For typing and other home work they use OpenOffice. I have also installed GCompris for education. You may visit www.myturfnet.multiply.com (yah I know! Im using multiply because I have no budget yet for my own domain and web hosting and beside this is the fast and cheap solution I could think of) for more info on my shop.