2006 November

Securing the /tmp partion

Mount /tmp with noexec, nodev and nosuid flags. In most cases, a simpletmpfs ramdisk with a maximum size of 100 MB should be enough. Justinsert this line into /etc/fstab, and do a “mount /tmp” afterwards:

tmpfs /tmp tmpfs nodev,noexec,nosuid,size=100M,mode=1777 0 0

If a scriptkiddie still manages to drop a file in /tmp, there is no wayto execute it.

Gentoo Forums

By WladyX on 30 November, 2006 | General, Security | A comment?

Disable Tab scrolling in Firefox 2

Firefox 2.0 displays tab navigation buttons on each side of the tab strip when a lot of tabs are opened.

This scrolling feature can be disabled by just following a few simple steps.

1. Type about:config in the Firefox address bar and press Enter.

2. Now double-click on browser.tabs.tabMinWidth and change the value to 0.

Disabling the tab scrolling feature will cause Firefox to shrink the size of the tabs if too many of then are opened.

By WladyX on 25 November, 2006 | Firefox | A comment?

SSH remote/restore backup

tar cf – local-dir-eliotwalker | ssh -l mctt remote-pc.com “gzip -c > corr.tar.gz”

alternative:

tar cjvf – /home | ssh root@backup.pixelchaos.net “cat > /backup/home.tar.bz2″

You can also use dd (or any other data/pipe handling commands):

tar cjvf – /home | ssh root@backup.pixelchaos.net “dd of=/backup/home.tar.bz2″

To restore that same file over ssh:

ssh root@backup.pixelchaos.net “cat /backup/home.tar.bz2″ | tar xjvf -

http://www.pixelchaos.net/index.php/archives/22

By WladyX on 14 November, 2006 | General, Scripts | A comment?

Apache redirect

This directive is equivalent to Redirect, but makes use of standard
regular expressions, instead of simple prefix matching. The
supplied regular expression is matched against the URL-path,
and if it matches, the server will substitute any parenthesized
matches into the given string and use it as a filename. For
example, to redirect all GIF files to like-named JPEG files on
another server, one might use:

    RedirectMatch (.*).gif$ http://www.anotherserver.com$1.jpg
By WladyX on 12 November, 2006 | Apache | A comment?

IP Tables network magic SysRq

Why to use the remote sysrq?

Sometimes a remote server hangs and only responds to icmp echo
request (ping). Every administrator of such machine is very unhappy
because (s)he must go there and press the reset button. It takes a long
time and it’s inconvenient. So here is a solution. Use the Network
Magic SysRq and you will be able to do more than just pressing a reset
button. You can remotely sync disks, remount them read-only, then do a
reboot. And everything comfortably and only in a few seconds. ;-)

Marek Zelem : IP Tables network magic SysRq function 0.4

PS: Nu l-am testat inca.

Squid

To translate the timestamps in Squid’s access.log pipe the data through: perl -pe 's/^\d+\.\d+/localtime($&)/e;'
E.g. tail -f /var/log/squid/access.log | perl -pe 's/^\d+\.\d+/localtime($&)/e;'

By WladyX on | Proxy | 1 comment

Passwordless SU

1. Edit /etc/pam.d/su, after
Code:
auth sufficient /lib/security/pam_rootok.so
add
Code:
auth sufficient /lib/security/pam_listfile.so item=ruser \
onerr=fail sense=allow file=/etc/security/su-nopass

2. Create a /etc/security/su-nopass file, and it put one username per line. Only put users that you want to have access to root without a password.
3. Double check the permissions on the file, we don’t want it world writable, and world readable is a matter of personal preference.

MC

If you paste something in mceditor, sometimes you get many spaces for every line, to avoid that start mcedit, press F9, select Options->General->Return does autoindent(uncheck it).

Outlook

Creating a Permanent New Mail Desktop Alert in Outlook 2003:

  1. Tools-> Wizards and Alerts… (press OK if you get an HTTP warning)
  2. Button New Rule…
  3. Select “Start from a blank rule” and verify that “Check messages when they arrive” is selected
  4. Press Next to go to the Conditions screen
  5. Verify that no condition is selected and press Next
  6. A warning will pop-up stating that this rule will apply to all messages. Press “Yes” to indicate that that is correct
  7. Select the action “display a Desktop Alert”
  8. Press Finish to complete the rule
  9. If needed move the “display a Desktop Alert” rule all the way to the top

http://www.sparnaaij.net/howto/mailalert2003.htm

Gnome

To remove the Computer, Home and Trash icons from your desktop:

start gconf-editor and modify:

/apps/nautilus/desktop/computer_icon_visible

/apps/nautilus/desktop/home_icon_visible

/apps/nautilus/desktop/trash_icon_visible

If you don’t like the new “spatial” Nautilus and you just want the old “browse” as a default, fire up gconf-editor and modify:

/apps/nautilus/preferences/always_use_browser