Pages

Sunday, October 4, 2009

udev rules for firing up a phone manager on Debian

I just got udev rules working for adding and removal of my Sony Eriksson W760i on Debian Linux. It was a real swine to get working : primarily because of the lack of info about X issues when calling scripts from the udev process. Anyway here is how its done:

1) Create a local udev script file:

/etc/udev/rules.d/z21_local.rules

ACTION=="add",KERNEL=="ttyACM0",SUBSYSTEM=="tty",ATTRS{product}=="Sony Ericsson W760",ATTRS{serial}=="3570670210310730",RUN+="/home/shamrock/bin/phonelaunch",SYMLINK+="w760i"
ACTION=="remove",KERNEL=="ttyACM0",SUBSYSTEM=="tty",RUN+="/home/shamrock/bin/phonekill"


2) Script to lauch Wammu


#!/bin/bash
export HOME = /home/shamrock
set -x
xhost local:shamrock
export DISPLAY=:0.0
cd /home/shamrock
su shamrock -c "/usr/bin/wammu &"


3) Script to clean up on removal


#!/bin/bash
su shamrock -c "pkill wammu"



The details for the udev rules came from running:

sudo udevadm info --name=/dev/ttyACM0 --query=all --attribute-walk


Enjoy!

Sunday, September 13, 2009

Tuesday, September 1, 2009

now for the reverse dns




$TTL 1d ;
$ORIGIN 0.168.192.IN-ADDR.ARPA.
@ IN SOA dns.richardriley.net. richardriley.net. (
2007011501
7200
120
2419200
604800
)
IN NS dns.richardriley.net.
101 IN PTR hermes.richardriley.net.
102 IN PTR x30.richardriley.net.
104 IN PTR development.richardriley.net.


dumping bind parameters



richardriley.db

@ IN SOA dns.richardriley.net. richardriley.net.(
2008081428 ; serial
21600 ; refresh after 6 hours
3600 ; retry after 1 hour
604800 ; expire after 1 week
86400 ) ; minimum TTL of 1 day

IN NS dns.richardriley.net.
IN MX 10 mail.richardriley.net.

imap IN A 192.168.0.101
mail IN A 192.168.0.101
smtp IN A 192.168.0.101
www IN A 192.168.0.101
ftp IN A 192.168.0.101

development IN A 192.168.0.104
hermes IN A 192.168.0.101
X30 IN A 192.168.0.102
g4 IN A 192.168.0.103


correct way to use g-client



finally got it working and not halting my emacs startup



(setq rgr/gblogger-post-url "http://www.blogger.com/feeds/4166588008280027121/posts/default")
(load "g-loaddefs")


Monday, August 31, 2009

Aspell causing emacs to hang



The following helped ...



(setq-default ispell-extra-args '("--sug-mode=ultra"))


Monday, August 24, 2009

emacs, gnus and mailto url from firefox on linux

I finally got mailto working properly with Gnus posting styles by tweaking some other solutions. Documented here.

company mode : emacs auto completion

I have recently cleaned up my programming elisp files and have got company-mode working again. It is truly excellent. check out the settings here.

Tuesday, August 18, 2009

emacs-fu: navigating through source code using tags

emacs-fu: navigating through source code using tags

I'm not sure that GLOBAL is a good thing. etags seems a lot better AND works with elisp. Combine it with etags tables. Having said that, the tags code navigation/completion situation in emacs is such a mess and so full of "almost ready" solutions one has to wonder what does what these days.

blogging with fixed url





(define-key mode-specific-map [?B] 'rgr/blog)

(defun rgr/blog ()
(interactive)
(if current-prefix-arg
(progn
(let ((url(read-from-minibuffer "Post URL:")))
(gblogger-new-entry url)))
(gblogger-new-entry rgr/gblogger-post-url)
))


Compositing and transparent emacs with xmonad


Read here for the emacs code
: Emacs-fu and making emacs transparent,
and here for the xmonad part : XMonad Compositing


Monday, August 17, 2009

gpg-agent for caching key passwords with gpg-agent



What a palava. A hundred readmes and howtos explaining how to run
gpg-agent in Linux for caching with the Emacs epa libraries and low
and behold it's already done in /etc/X11/Xsession.d/90gpg-agent. Aargh. Also in my .gnupg/gpg-agent.conf the gtk2 pin reader does not work. Has to be X11. Dont ask me why.



Addendum : I'm an idiot. It should be "pinentry-gtk-2". Works now!

Remember where you are in Emacs files.

Thursday, August 13, 2009

How to use g-client from emacs for blogger.com blogs


Download Source


g-client package

Unarchive, add to your path in emacs, open a terminal, cd to that
directory and run make config


Understanding how to use it


The key is to set your g-user-mail to your googlemail
ID..e.g



(setq g-user-email "rileyrgdev@gmail.com")

and then you run gblogger-blog to log in and view your
blogs. Then comes the not so tricky bit. Put your cursor over the
"post" link for the blog you are interested (you should be using W3M by the way!) in and then hit "u" in W3m to copy the POST URL to the clipboard. Having done that, simply run gblogger-new-entry and paste in that POST URL. The rest is all down to you and your favorite nxml emacs editor .... And google of course :-;

Another test with embedded html tags





http://purl.org/net/emacs-gblogger/
shamrock
Another test using nxml editor


Title test from g-client









Another test using nxml editor



Title test from g-client



(autoload 'ipa-insert "ipa")
(define-key mode-specific-map [?A] 'ipa-insert)
(define-key mode-specific-map [?b] 'gblogger-blog)
(define-key mode-specific-map [?B] 'gblogger-new-entry)
(define-key mode-specific-map [?W] 'w3m-bookmark-view)


another test from g-client



Hello from g-client!


Blog client broken

My gblogger client from emacs has broken. I am trying something called g-client but can't get it to work! Damn. Just as I was reinvigorated and was going to post a long article about the dangers of pinning and sucking in unstable code into a Debian Lenny set up (Yeah, I know what "unstable" means...).

Saturday, June 13, 2009

Emacs Python IDE

I finally got emacs working properly with the excellent company-mode. But I have to think this guy:

http://www.enigmacurry.com/2009/01/21/autocompleteel-python-code-completion-in-emacs/

For some reason the rope/ropemacs/ropemode documentation is pretty inconsistent and hard to find. Installing it from mercurial as described in the article above did it.

company-mode supports rope and pysmell now out of the box.

See my emacs python integration here:

http://richardriley.net/projects/emacs/dotprogramming

rope etc is loaded by company-mode.