jump to navigation

Using sshfs to Access Remote Directories in Windows March 5, 2007

Posted by Carthik in guides, Readers' Tips, servers, ubuntu.

I had a tough time deciding on a title for this post/article (“in” Windows or “on” Windows? I give up!).

J Wynia writes in to share a method to how to access remote directories, such as those on your web server through sshfs on Windows. Actually that’s not the full story.

The full story is:
1) Install Ubuntu in a virtual machine in Windows
2) Setup sshfs and use that mount your remote directory
3) Setup the sshfs-mount as a Samba share
4) Access said Samba share from Windows

Tin foil hat people keep away! 🙂 Also, the author mentions troubles with his Ensim server administration software (which he worked around). Folks who use cPanel or some other server control panel might have some trouble too.

So head over to the article already!

My old article on mounting remote directories using sshfs is what prompted J Wynia to write it.

“True” Word Count In LaTeX February 7, 2007

Posted by Carthik in commands, packages, Readers' Tips.

By way of Wei comes this little nugget of useful information of the kind I love.

If you were to count the number of words in a LaTeX document using the “wc” command, you will find that you have counted, in addition to the words you wrote, all the LaTex formatting text, like the “\paragraph”s and the “\textit”s.

Of course if you use Kile like I do, all you have to do is go to “File -> Statistics” to see the word count. But if you don’t use Kile, then you can follow Wei’s advice and install and use the “untex” package by doing a:
$sudo apt-get install untex and then a:
$untex source.tex > target && wc -w target
to count the number of words in the file named “source.tex”.
Alternatively, you can use this online tool to count the words.

A word of caution here — untex does not ignore equations, and so the output of the word count might be off by a bit. If you are a perfectionist, I would recommend using detex instead. There is no seperate package for detex, it ships in the Ubuntu package texlive-extra-utils.

If your document has citations, references, and include other files etc, the only reasonably efficient way to count the words in the final result is to convert the pdf file to text and then to count the words. Here is a command that will help you do that:
$pdftotext file.pdf - | egrep -E '\w\w\w+' | iconv -f ISO-8859-15 -t UTF-8 | wc

pdftotext is a command line utility provided by Xpdf. You may have to tweak the charsets in the previous command.

Galternatives – GUI for Alternatives Configuration February 12, 2006

Posted by Carthik in applications, Readers' Tips, ubuntu.

Galternatives About

Galternatives is a tool to enable users to use the GUI to update the /etc/alternatives files, which decide the default commands/apps for various tasks. John Pywtorak sent in this tip via email (thanks John).

The /etc/alternatives defines default applications for the traditional Unix/Linux system – such as, the default application to handle irc, to browse the web etc.

You can install galternatives using:
$sudo apt-get install galternatives

After it is installed, you can run it using:
$gksudo galternatives

The next screenshot shows you me updating the x-www-browser to Epiphany (did I tell you it is “simply” wonderful?).
Galternatives - example