Pages

Monday, January 31, 2011

Using rsync to synchronise different machines over ssh

#!/bin/bash
# January 2011 : rsync to various machines.
# author : rileyrg@gmail.com
# The LOCALHOST machine should have itself in the
# /etc/hosts files as something lile 1.1.1 so that
# the ping fails : basically a check to see if the
# destination host is available.
for myhost in asus dev x30 t60
do
ping -c 1 "$myhost" > /dev/null
if [ "$?" -eq 0 ] ; then
echo "$myhost up"
rsync -avz --delete ~/common-files $myhost:
else
echo "$myhost down"
fi
done




--
My Emacs Files At GitHub

Tuesday, January 25, 2011

Installed the Liquorix kernel on my Asus 1015 PEM


What a kerfuffle…



Opted for the power saving, more responsive Liquorix Debian kernel. The install
went pretty painlessly courtesy of the smxi installers. But it wont work with
the network-manager on wireless since killing X kills the networking connection
too. Daft. So be prepared with an ethernet cable. So, great. I reboot and:-





> uname -a
Linux development.richardriley.net 2.6.32-5-686 #1 SMP Wed Aug 25 14:28:12 UTC 2010 i686 GNU/Linux





WOOt! But wait! Whats this? No wireless. Oh yes, thats right : the weird and
wacky world of Debian politics means I need to run the module assistant to
install the sources and build the driver for the bcm43q13 wireless device. God
forbid they should forget all that and just have something that works out of the
box and actually attract new users. Oh no. So m-a is used once more. Except it
crashes out. What do do? A quick google revealed the wonderul linux wireless
website which maintains up to date repos of all wireless SW. Well, most. Should
be simple!



Have a read and decide that the brcm80211 driver should suffice. great! So
install the debian firmware-brcm80211 using aptitude.





sudo aptitude install firmware-brcm802011





Now follow the linux wireless instructions. Cant be too hard… and it wasn't!



Download the latest code. Unarchive to my usual build tree. Now its time for the
money shot.





./scripts/driver-select brcm80211
make && sudo make install





Crikey! It compiled. Now remove any existing driver and install the new one:-





sudo modprobe -r brcm80211
sudo modprobe -r wl
sudo modprobe brcm80211





All this was done over an ssh link from my main development machine to my Asus
netbook via ethernet cable btw. So lets try this driver .. oh no. Lets not. The
famous Linux BSOD….. Black Screen Of Death…





!(sdu->cloned) failed : file wlc_mac80211.c line 5140





Quickly subscribing to the mail list for linux-wireless
(linux-wireless@vger.kernel.org) I had the solution .. remove the offending
line and remake!



Bingo! It works.



And that ladies and gentleman was my day….


--
My Emacs Files At GitHub

Friday, December 10, 2010

Added javascript toggle for the edit/create even dialog.


Javascript can be used to access document elements by ID on the client. In this
case we can toggle the visibility of the #editeventform using the css display
property.



http://rileyrg.imgur.com/pub_web_software/NQnSu



--
My Emacs Files At GitHub

Monday, December 6, 2010

Settings can be visible.


Particularly useful for things like web settings for comms path eg phone, email, fx etc. Token is the access id, title is human readable heading (can be internationalised) and description holds the value (again can be different for each language).

Visible Settings

Tuesday, November 30, 2010

Meta data and general settings unified into internationalised event UI

keywords META tag as a setting in the event list



Which means you can edit as any other event and internationalise accordingly.





function getPageMetaHTML($category)
{
$sql='select id from events where token="meta" and fenabled=1 and category="'.$category.'"';
if(($result=getDB()->query($sql))==false)
return "";

if($result->num_rows==0){
if($category!="index"){
return getPageMetaHTML("index");
}else
return "";
}
$res="";
while($r=$result->fetch_assoc()){
getEventLocaleFields(&$r);
$res.='<meta name="'.$r{"title"}.'" content="'.$r{"event"}.'">';
}
return $res;
}




--
My Emacs Files At GitHub

Sunday, November 14, 2010

Using xmonad to control Yoono as a scratchpad


Yoono is head and shoulders above the rest when it comes to "Social Networking"
monitoring and configuration with instance messaging on the desktop. Especially
since it works well on Linux too.



That said, like a lot of these kind of tools it can be too in your face. Well,
if you use a decent tiling Windows Manager like xmonad all is instantly
solved. Providing you know some Haskell. chuckle …





scratchpads = [

-- run htop in xterm, find it by title, use default floating window placement

-- NS "google-chrome" "google-chrome" (className =? "Google-chrome") nonFloating ,
-- NS "browser" "conkeror" (className =? "Conkeror") nonFloating ,
NS "browser" "iceweasel -new-tab" (className =? "Iceweasel") nonFloating ,
NS "evince" "evince" (className =? "evince") nonFloating ,
NS "yoono" "yoono" (name =? "Yoono") defaultFloating ,
NS "surf" "surf" (className =? "surf") nonFloating ,
NS "emacs" "edit -c" (className =? "Emacs") nonFloating,
NS "unison" "unison-gtk" (className =? "unison-gtk") nonFloating ,
NS "htop" "xterm -name htop -e htop" (title =? "htop")
(customFloating $ W.RationalRect (1/3) (1/8) (2/3) (1/2)) ,
NS "newsbeuter" "xterm -e myrss" (title =? "myrss")
(customFloating $ W.RationalRect (1/2) 0 (1/2) (1/4))

] where name = stringProperty "WM_NAME"





and then in my keyboard hook





,((modMask myConfig .|. shiftMask, xK_y),  namedScratchpadAction scratchpads "yoono")





et Voila. Toggle it via a hotkey.


--
My Emacs Files At GitHub

Friday, November 12, 2010

Enabling/Disabling events for Social Network sharing.


Enabling sharing example.



The create new/edit dialog now includes the ability to toggle event
sharing. This would typically be used to disable sharing for an item which can
not stand on its own such as a list item - some support text to an item that
includes an embedded object like a gcalendar or twitter feed for example. Or
perhaps simply something you dont want shared! Typically used in conjuntion with
the orderby field which is, currently, the only crude way to order things
(outside of caelendar ordering) in an event list in order to ensure certains
items remain at the top or bottom or follow a previous item. Relative ordering
and grouping is in the pipeline - this will facilitate online menu construction
and perhaps photo album management although I am doubtful that anything I
shoehorn in there can in any shape or form approach the functionality provided
by the plethora of existing solutions for photo management. Its what links are
for …



Event In German



As an added bonus it will now also allow you to share in another language. Just
set the language on the web page before sharing and the link back will ensure
that the article/event is in that language when people click back.



--
My Emacs Files At GitHub

Tuesday, November 2, 2010

Webs now using mssqli and simplified css layout


The Shamrock Irish Bar, Hamburg



Inspiration Yachts



Steve Fairway Music


--
My Emacs Files At GitHub

Moved from mysql functions mysqli class.


@mysql function calls pretty much deprecated in php. Moved all the code to
mysqli based. Pretty straightforward. e.g



$f=@fopen("authinfo","r",true);
$auth=explode(" ",@fgets($f));
@fclose($f);
setDB($mysqli = new mysqli($auth{3},$auth{0},$auth{1},$auth{2}));
if ($mysqli->connecterror) {
die('Connect Error (' . $mysqli->connecterrno . ') '
. $mysqli->connecterror);
}


--
My Emacs Files At GitHub

Friday, October 22, 2010

db update scripts

-- move all text into msgcodes
-- insert into msgcodes (id,lang_id,msgtext) select concat(id,"-event"),1,event from events;
-- insert into msgcodes (id,lang_id,msgtext) select concat(id,"-title"),1,title from events;
-- alter table events drop title;
-- alter table events drop event;

-- added code field to languages to hold two letter language code
alter table languages drop column code;
alter table languages add column code char(2) after id;
update languages set code=lcase(substring(language FROM 1 FOR 2));
alter table msgcodes change id id varchar(32);
alter table languages drop column field;
alter table msgcodes add column field varchar(32) after lang_id;
alter table msgcodes drop column fkey;
alter table msgcodes add column fkey int(10) unsigned after lang_id;
alter table msgcodes ENGINE = InnoDB;
alter table events ENGINE = InnoDB;
update msgcodes set fkey=SUBSTRING_INDEX(id,"-",1) where id REGEXP '^[0-9]+-';
update msgcodes set field=SUBSTRING_INDEX(id,"-",-1) where id REGEXP '^[0-9]+-';
alter table msgcodes add constraint deletecodes foreign key (fkey) references events (id) on delete cascade;






~/webs/db-update.sql::– move all text into msgcodes



--
My Emacs Files At GitHub

Wednesday, October 20, 2010

Finally completed internationalising simple web support structure


The web SW now links all event titles and descriptions to relevant msgcode
entries. This means you can enter an event in English, switch to german and then
locale that in German.


--
My Emacs Files At GitHub