Search For A String In All Files Of A Directory  

Lets say you need to quickly find every instance of "h1" in the current directory. At the command line simply type:

find . -exec grep h1 {} \; -print

But what if the string contains characters? Create a temporary file:

vim temp.file

Place the string in it, and type:

find . -exec grep -f temp.file {} \; -print

Then delete the file:

rm temp.file
Secure SSH With DenyHosts  

Is your auth.log filled with failed authentication attempts?

Have you locked down your server to the point that if anything goes wrong you can't do anything?

There is a simple package that will, hopefully, alleviate your ssh woes... denyhosts

And installation and configuration couldn't be easier...

aptitude install denyhosts

Done and Done...

Have a look at the configuration file all of the options are well documented there.
If you have more than one server I would suggest changing the email options...

Start a Kiosk Style Machine Running a Single X11 Application  

Thanks to, Jim Peterson, Linux Journal HOWTOs, for this tutorial.

By changing your Xsession file you can start a kiosk-style machine that starts a single X11 application.

On Debian you would change the file /etc/X11/Xsession.d/99x11-common_start. In stock form there is a line that reads:


Change that to read:

exec firefox javascript:%20resizeTo\(1024,768\)

and your machine will boot directly into Firefox at a screen size of 1024x768. Of course you can change the size to any resolution you like. You can probably also add more javascript as well and force opening a web page and other stuff. Combine this with Bastille and an autologin of a non-privileged user and you'll have a very convenient (and cheap) kiosk.

On some Linux distros the Xsession file may actually be a single file rather than a directory of files. A search such as:

find /etc/X11 -iname 'Xsession*'

should find it for you. The actual line to change may differ also but should be near the end and be an exec statement or a function call that invokes exec.

Ubuntu - Move the window controls  

Arrangement of buttons on the titlebar. The value should be a string, such as "menu:minimize,maximize,spacer,close"; the colon separates the left corner of the window from the right corner, and the button names are comma-separated. Duplicate buttons are not allowed. Unknown button names are silently ignored so that buttons can be added in future metacity versions without breaking older versions. A special spacer tag can be used to insert some space between two adjacent buttons.

Therefore to have the menu, minimize, maximize and close buttons all on the right, simply type:

gconftool-2 --set "/apps/metacity/general/button_layout" --type string ":menu,minimize,maximize,close"

Into your consol

Or, to have the menu button on the left and minimize, maximize and close buttons all on the right, type:

gconftool-2 --set "/apps/metacity/general/button_layout"  --type string "menu:minimize,maximize,close"

Into your consol


Page 10 of 12