Mon Aug 29 17:59:22 CEST 2011

Wordpress

I switched over to wordpress for my weblog. I will post new item there.

Posted by Jan Wagemakers | Permanent link

Sat Aug 21 13:22:08 CEST 2010


Posted by Jan Wagemakers | Permanent link | File under: Dutch/Nederlands

Sun Aug 8 10:07:51 CEST 2010

SMS script updated

I have updated my send free sms script using googlecl, because sometimes, googlecl fails with a Moved Temporarily error.

This new script will try again and again for a while.
 pts/8  jan ~$ cat sms
#!/bin/sh
# ---------------------------------------------------------
# Send free (gratis) SMS using google Calendar.
#             - Jan Wagemakers -
#         Donated to the Public Domain
#
# More info at:
# http://www.janwagemakers.be/nanoblogger/
#      archives/2009/05/index.html#e2009-05-31T09_35_46.txt
#      archives/2010/07/index.html#e2010-07-31T10_35_58.txt
#      archives/2010/08/index.html#e2010-08-08T10_07_51.txt
# ---------------------------------------------------------
export LANG=C
counter=0

TEXT=$@

# Send SMS using date and googlecl
# -------------------------------- 
send() {
DATE=`date -d "5 min" +%H:%M%p`
echo "$DATE $TEXT"
google calendar add "$DATE $TEXT" --reminder=3m
}

# send SMS
# --------
send

# Errors? Yes -> Try again
# ------------------------
while [ $? -ne 0 ] 
do
        # count how many times we try again
        # ---------------------------------
        counter=$(($counter+1))
        # and stop when it keeps failing
        # ------------------------------
        if [ $counter -gt 50 ] ; then 
                break
        fi
        
        echo failed... try again : $counter
        sleep 20s
        send
done
And this is what the new script looks like when googlecl fails.

Posted by Jan Wagemakers | Permanent link | File under: GNU/Linux

Sat Aug 7 06:11:46 CEST 2010

My first AMD64 assembler program

At http://www.janwagemakers.be/eng.html you can read about my experiments with Linux and x86-32-Assembly. On that page you can find a small Hello, World! program.

Today I have converted this Hello, World! program to x86-64 (amd64) assembly.

First, it is important to note that there are some differences in making syscall requests between x86-32 and x86-64 :

x86-32 x86-64
int $0x80 syscall
%eax %rax
%ebx %rdi
%ecx %rsi
%edx %rdx


Also the syscall numbers are not the same on x86-32 and x86-64, take a look at :

x86-32 x86-64
/usr/include/asm/unistd_32.h /usr/include/asm/unistd_64.h


With this information, I have converted this x86-32 program
.text
message:
 .ascii "Hello, World!\12\0"
 .align 4
.globl _hw               
_hw:
 movl $4, %eax           
 movl $1, %ebx           
 movl $message, %ecx     
 movl $15, %edx          
 int $0x80               
 movl $1, %eax           
 movl $0, %ebx           
 int $0x80               

as hello.s -o hello.o
ld hello.o -e _hw -o hello
        (_hw = entry-point)
to a working x86-64 program
 pts/3  jan ~/assembler64$ cat hello.s
.text
message:
 .ascii "Hello, World!\12\0"
 .align 4
.globl _hw               
_hw:
 movq $1, %rax           
 movq $1, %rdi           
 movq $message, %rsi     
 movq $15, %rdx          
 syscall            
 movq $60, %rax           
 movq $0, %rdi     
 syscall             
 pts/3  jan ~/assembler64$ as hello.s -o hello.o
 pts/3  jan ~/assembler64$ ld hello.o -e _hw -o hello
 pts/3  jan ~/assembler64$ ./hello
Hello, World!
 pts/3  jan ~/assembler64$ 
Nice :)

Posted by Jan Wagemakers | Permanent link | File under: amd64-asm, GNU/Linux

Sat Jul 31 10:35:58 CEST 2010

Free SMS notifications with googlecl and google calendar

In MAY 2009 I wrote here about Free SMS notifications with gcalcli and google calendar .

Well, this wasn't working anymore :( I can add events with gcalcli to the calendar, but no reminder (SMS) is send.

But I have found a solution :)

At code.google.com you can download googlecl. New in googlecl 0.9.9 is "Reminders for added calendar events".

So, I have written a new sms script to send free (as in beer, gratis) sms notifications to my mobile phone.
 pts/12  jan ~$ cat sms
export LANG=C
DATE=`date -d "5 min" +%H:%M%p`
echo "$DATE $@"
google calendar add "$DATE $@" --reminder=4m 
 pts/12  jan ~$ sms "Free as in beer"
10:17AM Free as in beer
 pts/12  jan ~$ 



Posted by Jan Wagemakers | Permanent link | File under: GNU/Linux

Sun Jun 6 08:40:19 CEST 2010

Linux and TerraTec Cinergy T USB XXS Remote Control

I have recently bought a TerraTec Cinergy T USB XXS to receive TV by DVB-T.

TerraTec Cinergy T USB XXS

This works without a problem on my Debian GNU/Linux PC.

More info about setting up this DVB-T USB device and linux is available at linuxtv.org

Like you can see, a remote control was also included in the TerraTec Cinergy T USB XXS package. I have followed the instructions at linuxtv.org (Remote control support), but no luck :(

Remote Control

When pressing some keys at the remote control, the only thing I noticed was
Jun  5 10:58:02 amd64 kernel: dib0700: Unknown remote controller key: 0014 10 ef
Jun  5 10:58:05 amd64 kernel: dib0700: Unknown remote controller key: 0014 02 fd
Jun  5 10:58:05 amd64 kernel: dib0700: Unknown remote controller key: 0014 02 fd
Jun  5 10:58:06 amd64 kernel: dib0700: Unknown remote controller key: 0014 05 fa
Jun  5 10:58:06 amd64 kernel: dib0700: Unknown remote controller key: 0014 43 bc
Jun  5 10:58:06 amd64 kernel: dib0700: Unknown remote controller key: 0014 43 bc
Jun  5 10:58:07 amd64 kernel: dib0700: Unknown remote controller key: 0014 44 bb
Jun  5 10:58:07 amd64 kernel: dib0700: Unknown remote controller key: 0014 44 bb
Jun  5 10:58:07 amd64 kernel: dib0700: Unknown remote controller key: 0014 44 bb
Jun  5 10:58:08 amd64 kernel: dib0700: Unknown remote controller key: 0014 44 bb
in /var/log/syslog.

Taking a look at the linux source in /usr/src/linux-2.6.34/drivers/media/dvb/dvb-usb/dib0700_devices.c, I found the following at line 515
        err("Unknown remote controller key: %2X %2X %2X %2X", (int) key[3-2],
                                 (int) key[3-3], (int) key[3-1], (int) key[3]);
and this at line 592
        /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
        { 0xeb01, KEY_POWER },
        { 0xeb02, KEY_1 },
        { 0xeb03, KEY_2 },
        { 0xeb04, KEY_3 },
        { 0xeb05, KEY_4 },
        { 0xeb06, KEY_5 },
        { 0xeb07, KEY_6 },
        { 0xeb08, KEY_7 },
        { 0xeb09, KEY_8 },
        { 0xeb0a, KEY_9 },
        { 0xeb0b, KEY_VIDEO },
        { 0xeb0c, KEY_0 },
        { 0xeb0d, KEY_REFRESH },
        { 0xeb0f, KEY_EPG },
        { 0xeb10, KEY_UP },
        { 0xeb11, KEY_LEFT },
        { 0xeb12, KEY_OK },
        { 0xeb13, KEY_RIGHT },
        { 0xeb14, KEY_DOWN },
        { 0xeb16, KEY_INFO },
        { 0xeb17, KEY_RED },
        { 0xeb18, KEY_GREEN },
        { 0xeb19, KEY_YELLOW },
        { 0xeb1a, KEY_BLUE },
        { 0xeb1b, KEY_CHANNELUP },
        { 0xeb1c, KEY_VOLUMEUP },
        { 0xeb1d, KEY_MUTE },
        { 0xeb1e, KEY_VOLUMEDOWN },
        { 0xeb1f, KEY_CHANNELDOWN },
        { 0xeb40, KEY_PAUSE },
        { 0xeb41, KEY_HOME },
        { 0xeb42, KEY_MENU }, /* DVD Menu */
        { 0xeb43, KEY_SUBTITLE },
        { 0xeb44, KEY_TEXT }, /* Teletext */
        { 0xeb45, KEY_DELETE },
        { 0xeb46, KEY_TV },
        { 0xeb47, KEY_DVD },
        { 0xeb48, KEY_STOP },
        { 0xeb49, KEY_VIDEO },
        { 0xeb4a, KEY_AUDIO }, /* Music */
        { 0xeb4b, KEY_SCREEN }, /* Pic */
        { 0xeb4c, KEY_PLAY },
        { 0xeb4d, KEY_BACK },
        { 0xeb4e, KEY_REWIND },
        { 0xeb4f, KEY_FASTFORWARD },
        { 0xeb54, KEY_PREVIOUS },
        { 0xeb58, KEY_RECORD },
        { 0xeb5c, KEY_NEXT },
According to this information, it seems that the eb in the keycodes are not correct (anymore?). So, I have changed them to 14 because of the err line found in syslog.
        /* Key codes for the Terratec Cinergy DT XS Diversity, similar to cinergyT2.c */
        { 0x1401, KEY_POWER },
        { 0x1402, KEY_1 },
        { 0x1403, KEY_2 },
        { 0x1404, KEY_3 },
        { 0x1405, KEY_4 },
        { 0x1406, KEY_5 },
        { 0x1407, KEY_6 },
        { 0x1408, KEY_7 },
        { 0x1409, KEY_8 },
        { 0x140a, KEY_9 },
        { 0x140b, KEY_VIDEO },
        { 0x140c, KEY_0 },
        { 0x140d, KEY_REFRESH },
        { 0x140f, KEY_EPG },
        { 0x1410, KEY_UP },
        { 0x1411, KEY_LEFT },
        { 0x1412, KEY_OK },
        { 0x1413, KEY_RIGHT },
        { 0x1414, KEY_DOWN },
        { 0x1416, KEY_INFO },
        { 0x1417, KEY_RED },
        { 0x1418, KEY_GREEN },
        { 0x1419, KEY_YELLOW },
        { 0x141a, KEY_BLUE },
        { 0x141b, KEY_CHANNELUP },
        { 0x141c, KEY_VOLUMEUP },
        { 0x141d, KEY_MUTE },
        { 0x141e, KEY_VOLUMEDOWN },
        { 0x141f, KEY_CHANNELDOWN },
        { 0x1440, KEY_PAUSE },
        { 0x1441, KEY_HOME },
        { 0x1442, KEY_MENU }, /* DVD Menu */
        { 0x1443, KEY_SUBTITLE },
        { 0x1444, KEY_TEXT }, /* Teletext */
        { 0x1445, KEY_DELETE },
        { 0x1446, KEY_TV },
        { 0x1447, KEY_DVD },
        { 0x1448, KEY_STOP },
        { 0x1449, KEY_VIDEO },
        { 0x144a, KEY_AUDIO }, /* Music */
        { 0x144b, KEY_SCREEN }, /* Pic */
        { 0x144c, KEY_PLAY },
        { 0x144d, KEY_BACK },
        { 0x144e, KEY_REWIND },
        { 0x144f, KEY_FASTFORWARD },
        { 0x1454, KEY_PREVIOUS },
        { 0x1458, KEY_RECORD },
        { 0x145c, KEY_NEXT },
After recompiling and rebooting the kernel, the remote control works without a problem :)
 pts/7  jan ~$ irw
0000000000010002 00 1 Cinergy_Hybrid_t_USB_XS
000000000001000a 00 9 Cinergy_Hybrid_t_USB_XS
0000000000010160 00 ok Cinergy_Hybrid_t_USB_XS
00000000000100cf 00 play Cinergy_Hybrid_t_USB_XS
0000000000010193 00 ch- Cinergy_Hybrid_t_USB_XS
0000000000010192 00 ch+ Cinergy_Hybrid_t_USB_XS
0000000000010072 00 vol- Cinergy_Hybrid_t_USB_XS
0000000000010073 00 vol+ Cinergy_Hybrid_t_USB_XS
0000000000010066 00 home Cinergy_Hybrid_t_USB_XS
0000000000010074 00 onoff Cinergy_Hybrid_t_USB_XS
^C
 pts/7  jan ~$ 

Posted by Jan Wagemakers | Permanent link | File under: GNU/Linux

Sun May 9 11:39:44 CEST 2010

picprog 1.9.1

Jaakko has released a new version 1.9.1 of picprog. Thanks Jaakko!

I have created a Debian (amd64) Package for it, which is available at http://www.janwagemakers.be/picprog/amd64/.

Hopefully this picprog Debian package will be uploaded to Debian/Unstable soon.


Posted by Jan Wagemakers | Permanent link | File under: pic

Sat Mar 13 22:18:33 CET 2010

Nixie clock at double speed

I have updated the software of my nixie clock. The previous version displays the time at a rate of 2 seconds per digit (inclusive pause). This version displays the time at a rate of 1 second per digit.

You can see the source here.


Click on the photo above to see the Nixie clock in action Play Ogg
or
click here to see it on youtube
(warning: low quality movie)



Posted by Jan Wagemakers | Permanent link | File under: nixie, pic

Sat Feb 27 14:52:28 CET 2010

Nixie clock webpage

I have written a webpage about my Nixie Clock in the English and Dutch language.

Nixie (c)(k)lok



Posted by Jan Wagemakers | Permanent link | File under: nixie, pic

Thu Feb 18 11:19:47 CET 2010

Update schematic and software of Nixie clock

I have updated the schematic (made with gEDA gschem) and software of my Nixie clock .


Posted by Jan Wagemakers | Permanent link | File under: nixie, pic