Like us on Facebook!

Monday, 8 April 2013

quick GIT setup

Redhat Linux 6.x x86_64

There must be a git server with your repo created.

    [create public sshkey and add to git server http://gitorious.world.com/\] ssh-keygen -t dsa
    [serv@server01 ~]$ cat ~/.ssh/id_dsa.pub
    [create /workingdir/ or your chosen working directory]

    [install git] yum install git.x86_64
    [initlialise it git first outside your working directory] git init
    [setup your username] git config --global user.name "Hello World"
    [set up your email] git config --global user.email "server@world.com"
    [command to add your git project locally] git remote add origin git@gitorious.world.com:project.git
    [for error: src refspec master does not match any.]
        cd workingdirectory
        touch README
        add README
        git add .
        git commit -m 'initital commit' or git commit -m 'reinititalized files'
        git push origin master --force or git push origin master

On the git server add the SSH key and you should be good to go.


mysql Table is marked as crashed and should be repaired



Here is fix to little MySQL problem ...

The problem was because of a corrupt mysql table and it started on the 13th. 

[root@server01ee report]# grep "is marked as crashed and should be repaired" /var/log/mysqld.log

130202  3:20:35 [ERROR] /usr/libexec/mysqld: Table './report/lastReports' is marked as crashed and should be repaired

130202  3:20:35 [ERROR] Slave SQL: Error 'Table './report/lastReports' is marked as crashed and should be repaired' on query. Default database: 'report'. Query: 'DELETE FROM `lastReports` WHERE `timest` AND `region` = 'EQ' ORDER BY `timest` ASC LIMIT 1', Error_code: 145

130202  3:20:35 [Warning] Slave: Table './report/lastReports' is marked as crashed and should be repaired Error_code: 145

FYI,

shell > cd /var/lib/mysql/report/

shell > myisamchk lastReports.MYI

Checking MyISAM file: lastReports.MYI

Data records:      47   Deleted blocks:     372

myisamchk: warning: Table is marked as crashed

myisamchk: warning: 1 client is using or hasn't closed the table properly

- check file-size

- check record delete-chain

myisamchk: error: Record at pos: 309416 is not remove-marked

myisamchk: error: record delete-link-chain corrupted

- check key delete-chain

- check index reference

- check data record references index: 1

myisamchk: error: Found 46 keys of 47

- check record links

myisamchk: error: Keypointers and record positions doesn't match

myisamchk: warning: Found 356432 deleted space.   Should be 362636

myisamchk: warning: Found        369 deleted blocks       Should be: 372

myisamchk: warning: Found        613 key parts. Should be: 612

MyISAM-table 'lastReports.MYI' is corrupted

Fix it using switch "-r" or "-o"

  -r, --recover       Can fix almost anything except unique keys that aren't

                      unique.

  -o, --safe-recover  Uses old recovery method; Slower than '-r' but can

                      handle a couple of cases where '-r' reports that it

                      can't fix the data file.

shell > myisamchk -r lastReports.MYI

- recovering (with sort) MyISAM-table 'lastReports.MYI'

Data records: 47

- Fixing index 1

Saturday, 6 April 2013

Raspberry Pi + M2M + zeropMQ + Breadboard



So at work a colleague has pointed me to zeroMQ and my company is looking into M2M (mobile-to-mobile) technology and I have had a  play with raspberry Pi and basic circuit board. 

So how can I make these come together???

So the plan is to create a simple M2M between 2 raspberry Pi using zeroMQ, M2M protocols and let's just throw some circuits to sense something ... 

First task is to understand zeroMQ. For this application I can use a simple Pub-sub, which connects a set of publishers to a set of subscribers. This is a data distribution pattern. Pi 1 will be the publisher and Pi 2 will be the subscriber.

Pi 2 will have an application to turn the data into meaningful information and perhaps push it to a mobile device.

The biggest challenge is connecting my Raspberry Pi to my circuit board. In the following video they used an Arduino to read temperature/moisture. 



So let it begin ...