About jontas

I like to make things that people find useful.

sudo: no tty present and no askpass program specified

This error message will occur if sudo is not able to ask for the password (no tty is present) (like for instance when trying to sudo rsync).

One solution to this is to add the line “Defaults visiblepw” to the /etc/sudoers file.

[Todd C. Miller Todd.Miller at courtesan.com said on sudo-users: Recent versions of sudo will refuse to prompt for a password if no tty is present, since it is not possible to turn off echo in this case. You can restore the old behavior with a line like above]

Adding piwik to GetBoo

In order to add Piwik analytics tracking code to a GetBoo installation two files needs to be updated.

“footer.php” and “publicfooter.php”.

Just copy&paste the code from piwik to the end of these two files (just above the </body> tag)

How to search recursively the files of a given directory [Grepdir]

A guy called Chris Karakas has made a very nice script to search through all files in a directory (and all subdirectories).

The original can be downloaded from http://www.karakas-online.de/downloads/grepdir and saved as /usr/local/bin/grepdir. If chmoded a+x then it can be used by all.

A note on ubuntu: I had to change the “/bin/sh” to “/bin/bash” in order to get it working (it was complaining about “/usr/local/bin/grepdir: 16: Syntax error: “(” unexpected”).

Update: A updated version that should read the shell automatically from the export list can be downloaded from http://www.f15ijp.com/wp-content/uploads/2010/08/grepdir

IIS/ASP.NET turning (browser) debug messages off

To make this change for one project at a time:

In  “Web.config”find the line saying “compilation debug=true” and switch this to false.

To make this change for the entire server:

In “%SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\Machine.config” find the line saying “compilation debug=true” and switch this to false.

More info on this from Microsoft:http://support.microsoft.com/kb/815157

Synergy – Problem with international chars (keys)

When using synergy and a non us keyboard layout there is sometimes problems with the chars not being sent correctly (chars that are not on the us layout or in a different location).

I know that others have this problem as well, but the solution that I have found to work for me – so far – is very simple.

Just using force reconnect from the server makes this problem go away 😉

Turning off the commandline beep (bell)

A simple way to turn off the pc-speaker bell is to edit the file /etc/inputrc

And just add the lines (just verify that there is no other line about bell-style)

# do not bell on tab-completion
set bell-style none
set bell-style visible

The first line says no beep, the second line makes the console flash instead … if that is left out the console doesn’t flash 😉

Reload the file (I just rebooted) and all should be well.