Ads by Google

Monday, March 31, 2008

Wireshark 1.0 released.

For those in the security business and those learning packet sniffing, here's an official announcement of the 1.0 release. 10 years to come to that though it was waaay usable and stable before that.

Finding out which file belongs to which package in cygwin

Today, while trying to add some directories to the PATH variable in my startxwin.bat, I managed to corrupt the file.

I don't know what was wrong but the script refused to start the X server.

Well, I'll just recover the script by re-installing the package I thought.

The only problem is, I don't know which package the file belonged to! And I didn't want to re-install ALL the X packages of the X-server. That would have been the last resort, anyway.
A google search revealed that someone else had faced the same problem and cygwin had a package search which does the same thing; it can search within the packages.

I found the package and reinstalled it from the local copy on my HDD and all was well. X server started up as usual along with my customisations which I applied again.

Sunday, March 30, 2008

Installing MikTeX with Emacs-22.1 and Cygwin

Since I decided to go with MikTeX, I downloaded and installed the base MikTeX package. The MikTeX install offers a net based install of additional packages that is easy to use. Install the additional packages that you'd generally use. Don't forget to refresh the FNDB to make sure that the package is registered with TeX (I think it's the equivalent of texhash.)

Open a cygwin prompt.

$ echo $PATH

That will not help as the TeTeX binaries will be found before MikTeX. Change that by

$ PATH=/cygdrive/c/MiKTeX2.7/miktex/bin:$PATH
$export PATH
$ cd c:/gnu/elisp/auctex-11.85
$ ./configure --with-emacs=c:/gnu/emacs-22.1/bin/emacs --disable-preview \
--with-texmf-dir=c:/MiKTeX-2.7/miktex/tex/ --prefix=c:/gnu/ \
$ make
$make install

assuming that you have auctex tarball untarred already. You'd need to change the paths to point to your emacs, the MiKTeX tree and where you want the installation files to go. Obviously.

The configure script generates the Makefile and the echoed messages on the screen will tell where it is picking different binaries from. Check the Makefile carefully especially the installation paths of various auctex .el files.

I have these entries in my .emacs

(setq exec-path (cons "C:/gnu/bin/" exec-path))
(setq exec-path (cons "c:/cygwin/usr/bin" (cons "C:/cygwin/bin" exec-path)))
(setq exec-path (cons "C:/MiKTeX2.7/miktex/bin" exec-path))
(setenv "PATH" (concat "C:\\MiKTeX2.7\\miktex\\bin;C:\\cygwin\\bin;C:\\cygwin\\usr\\bin;
C:\\gnu\\bin\\;" (getenv "PATH")))

;; AUC TeX
(load "auctex.el" nil t t)
(require 'tex-mik)
;; ;;; some basic customizations
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
(add-hook 'LaTeX-mode-hook 'turn-on-reftex) ; with AUCTeX LaTeX mode
(add-hook 'latex-mode-hook 'turn-on-reftex) ; with Emacs latex mode
(setq reftex-plug-into-AUCTeX t)
(setq reftex-enable-partial-scans t)
(setq reftex-save-parse-info t)
(setq reftex-use-multiple-selection-buffers t)

Note that, I'm forcing emacs too, to look in the MikTeX distribution first for the respective binaries before looking under cygwin.

Testing these on a random tex file, it generated the output pdf.

Because I had both TeTeX and MikTeX installed, I wasn't sure which binaries would be picked up. The first time I tried, the PATH variable made TeTeX binaries as the values to various configure checks. I had to set the MikTeX path first to force it to choose MikTeX. And you get messages like this

checking for tex... /cygdrive/c/MiKTeX2.7/miktex/bin/tex
checking for pdftex... /cygdrive/c/MiKTeX2.7/miktex/bin/pdftex
checking for dvips... /cygdrive/c/MiKTeX2.7/miktex/bin/dvips
checking for perl... /usr/bin/perl
checking for makeinfo... /cygdrive/c/MiKTeX2.7/miktex/bin/makeinfo
checking for texi2html... /usr/bin/texi2html
checking for texi2dvi... /cygdrive/c/MiKTeX2.7/miktex/bin/texi2dvi
checking for texi2pdf... /usr/bin/texi2pdf
checking for install-info... /usr/bin/install-info
configure: creating ./config.status
config.status: creating Makefile
As you can see, there are binaries chosen from MikTeX as well as cygwin. If you have not chosen the TeTeX binaries during the cygwin install, there is a lot less to worry about. You'll have to force the configure script to find every binary it is looking for, from the MikTeX distribution.

And as far as possible, install the MikTeX in folders without spaces in the names. It would make things simpler.

That is pretty much it.

Saturday, March 29, 2008

Microsoft and OOXML revisted

When the lede to the story has the lines

by reiterating that it won’t sue over future versions of its file format.

and the title is one about Microsoft, you know it's not going to be good.

For both Microsoft and the public at large.

So, UK might revisit it's yes vote on the OOXML file format.
Microsoft's stand is now wobbly considering they and other vendors have been bashing Sun for not making a Java a true open standard. All approvals had to be routed through Sun and everyone cried foul. Now Microsoft is in the same situation. It seems to need the Open Source tag without losing control over the file format specifications.

That is going to be tough. Very.

It's better to be proprietary and arbitrary in your file formats than to take a stand which is viewed as fake and with suspicion. At least, while not getting good karma, you don't get bad press either.

Friday, March 28, 2008

Switching to MikTeX

I use the cygwin based TeTeX TeX system. The problem is, it's no longer maintained and the focus is on TeXLive a newer TeX system. TeXLive has gone through several iterations and is released yearly. This year's release is sometime in July 2008 apparently.

I asked on the cygwin list whether there is going be a port of the TexLive TeX tree to cygwin. I got a short answer whether I'd like to volunteer.

ummm....Don't know anything about TeX sources and cygwin ports building and I'm not sure whether I want to.

So, I'm stuck using TeTeX and no cygwin port of the latest TeX system i.e. no upgrade path. And this is seriously showing it's age. pdfTeX version on the cygwin system is at 1.21x while the latest version is 1.40x.

Now, that leaves only one option, MikTeX.

Bit apprehensive of how this is going to pan out. Plus there's this thing of Emacs, AucTeX, cygwin and MikTeX. Windows, fake Unix, Windows port of TeX...

Combination of the good and the kludgy.

So, the plan is, I'll use the Emacs 22.1 version compiled with Auctex and MikTeX and see how it goes. If all goes, redo the same with Emacs 22.2.

Downloading the MikTeX installer and installing the additional packages now. Let's see how this works out.

Thursday, March 27, 2008

OOXML and Microsoft; getting nowhere?

India has voted to NO to OOXML.

That was expected. What is surprising is how the battle is being fought. Here's one insider's account of how the votes played out and the after effects.

Reading between the lines, there seems to be a lot of quid pro quo and none of the Indian IT players come out in a better light. Of course, one is well within their rights to question the motives of the blogger too who gave his perspective of things.

However coloured the views might have been, IF there were technical demerits to the standard, then it really is a good idea to throw it out.

Microsoft has only itself to blame on this vote; none of the competition is going to help it along. Clearly, the more the NO votes, the bigger the embarrassment and consequent bureaucratic revisions and time that OOXML is going to get bogged into. The competition is also going to spread a good amount of FUD about it, right or wrong. Questions on patents, whether it is truly open, the NO votes from the academic establishments are ripe for talking points attack.

And I still don't understand why there is a need for another document standard when the ODF (Open Document Format) exists and there is ISO approval for the same.

Wednesday, March 26, 2008

Emacs-22.2 Released!

Saw a posting on the cygwin mailing list that Emacs-22.2 has been released.

Indeed, a quick check on the GNU website, revealed that it was done today. Unofficial cygwin builds can be found here.

Go get it.

Getting Beamer Frame Titles into Reftex TOC

I write most of my documents in LaTeX and AucTeX is indispensable in creating and generating the pdf files from LaTeX.

For presentations, one of the best available and actively maintained package is Beamer developed by Till Tantau. With its beamer templates it's possible to rustle up a fairly professional presentation in a few minutes. And if you like reading a few hundred pages of documentation, the payback is even better. :-)

RefTeX is a package for managing Labels, References, Citations and index entries with GNU Emacs.

When using the beamer package, the \frametitle{} has the slide headings and it makes sense to make that come up when C-c = is chorded. That is, when reftex-toc function is called, which builds the TOC for the document, the TOC buffer should show a number list of slide titles.

But RefTeX does not recognise \frametitle when it parses the document in its default settings.

Asking on the auctex mailing list, elicited the following solution

(setq reftex-section-levels '(("part" . 0)
("chapter" . 1)
("section" . 2)
("subsection" . 3)
("subsubsection" . 4)
("paragraph" . 5)
("subparagraph" . 6)
("frametitle" . 7)
("addchap" . -1)
("addsec" . -2)))

The documentation string said that the list should be sorted, so I replicated the values instead of cons'ing and cdr'ing.

Hitting C-c = after setting it and reloading the buffer, brings up the frametitles nicely.

Monday, March 24, 2008

Using Git; more unlearning CVS

So, I trip up again when using git; Thinking that the commit works the same way as in CVS.

Of course it doesn't!

you need to do a git add and then follow it up with a git commit every time. In CVS, you need to do an add only when creating a new file. But in Git, every time the contents of the file changes you need to add before you commit.

A quick google check reveals that git tracks content not the file names. And this blogpost was even more clearer on how assuming things from other SCM versions will confuse you with Git.

To be honest, git does warn you about it and as usual, I took it to be background noise. :)

Saturday, March 22, 2008

The cruft in my .emacs

It just occurred to me that I don't have a complete understanding of how I came up to speed (err,sort of) in being a bit proficient in using Emacs. I've come to realise that the advice given by Emacs developers is sound.

Do not randomly copy .emacs snippets from different users and websites. You have no idea what you copied when you're learning initially and at an intermediate stage, a little knowledge is dangerous!

My .emacs header says that it's 6 years old and I can see what a mess it is when I try to change it. I have repeated path references, lots of commented code, comments which don't make sense and some packages that I don't use at all.

If I clean up my .emacs, I'm pretty sure that I can shave off around 3 seconds of the startup time. I've also noticed that Emacs developers have made more of the customisations that were explicitly set as the defaults which means more stuff can be removed from the init file.

After backing up my .emacs I have deleted a lot of stuff and I don't miss it for over a month now. Going over the .emacs now with a bit more understanding,it's far easier to chop off code than when you're a noob. Of course, the code should not have been there in the first place.

Thursday, March 20, 2008

Using Gnus to send emails through Gmail mail servers

Finally got around to updating the Emacswiki page, GnusMSMTP. which is the only page I created on the wiki so far.

You can use Gnus and msmtp to send mails through the Gmail mail servers. As mentioned in the wiki site, you might need the CVS version of Gnus for it to work. Especially if you're using the stock install of Gnus that comes with Emacs 22.1.

I use the cygwin port of msmtp and it's fairly easy to get it to work.

Follow the instructions mentioned on the wiki.

Tuesday, March 18, 2008

Scoring in Gnus messes up Digest mode

While reading news and mail in Gnus, I started to score authors in the Digest mails I subscribe to.

Looks like that is not working correctly, as I thought it should.

The entire digest in the Summay Buffer is highlighted instead of the articles from the specific person (which is what I score on).

Thinking this through, obviously the digest is a compendium of a number of mails with lots of headers stripped into 1 file, so the ticks seen by Gnus is on the entire digest I guess.

& you do have to hit C-d to see the articles individually anyway.

Oh well, so scoring on mail digests is not a good idea.

Friday, March 14, 2008

USENIX online conference proceedings are now freely available to everyone

Which is good news. There are some interesting papers to read; I'd recommend that you check out the best papers and the ;login: links to see some informative papers.

Thursday, March 13, 2008

Wrapping my head around the distributed version control model

Reading and playing with Git, I keep comparing it with CVS and predictably end up confused. So when Kate offered to answer any questions on Git, I jumped at the chance.

One that bothered me was how the main repository was identified; Kate's explanation was good enough to clear my doubts.

Tuesday, March 11, 2008

Emacs 3rd Pretest available for testing

Just saw on the Emacswiki that the third pretest is available. The windows version can be found here.

Please download and report any bugs to the gnu.emacs.bugs mailing list and newsgroup.

Friday, March 7, 2008

The creator of ELIZA, Weizenbaum is dead

Emacs users who are familiar with the psychotherapist (found under the Help menu) will be saddened to know that Joesph Weizenbaum is dead.

The ELIZA chatter bot designed by him is the most simple in the class of AI (if it can be called that) but one that seemed to transfix lay users. While not rigorous in Computer Science terms of AI, it is an elegant creation at first glance.

Thursday, March 6, 2008

Emacs Pretest available

With the next release of Emacs imminent this year, it might be a good idea to download the pretest and take it for a spin.

For Windows there is a prebuilt version available that one can try instead of trying to build from the source.

Emacs Developers call the betas pretest.

Tuesday, March 4, 2008

RMS hands over Emacs Maintainership

And so it comes to this, an email announcing who the next Emacs maintainers are.

One can't thank this man enough, for writing the Greatest Editor Ever! :-)

Even though he's just said that the maintenance is being done by others now, it's hard to imagine Stallman NOT involved in GNU Emacs.

One without the other? Impossible!

Though, truth be told, RMS has done much much more with the Free Software Foundation and developing everything except the Linux kernel. Doggedly sticking to his guns, he has made the FSF a natural order of things in the software world dominated initially by proprietary works.

Congratulations to the man and I do hope he does continue to actively participate in the development cycle of GNU Emacs.

It's now almost 10 years since I started using GNU Emacs and I have only one regret.

I wish I had started learning it even earlier.

Monday, March 3, 2008

FTPing files from Dired

Being on the Emacs mailing lists often gives you some simple and elegant ways to do things from within Emacs.

One that I found useful and had an immediate use was this.

Mark the files in Dired and run the appropriate command as either ftp or scp

! scp * host:/target/dir/ & RET

depending on how secure you want to be or how rigorous the IT policy is at your place.