2010 March 10

Load ssh Key at KDE Startup

aptitude install ksshaskpass

cat >~/.kde/Autostart/ssh-add.sh <<_EOT_
#!/bin/sh
export SSH_ASKPASS=/usr/bin/ksshaskpass
ssh-add </dev/null
_EOT_

chmod +x ~/.kde/Autostart/ssh-add.sh
~/.kde/Autostart/ssh-add.sh

source

By WladyX on 10 March, 2010 | General, Ssh, Ubuntu, X11 | A comment?

Postfix masquerading or changing outgoing SMTP email or mail address

/etc/postfix/main.cf:

smtp_generic_maps = hash:/etc/postfix/generic

/etc/postfix/generic:

tom-01@server01.hosting.com tom@domain.com

# postmap /etc/postfix/generic
# /etc/init.d/postfix restart

source

By WladyX on | General, Mail | A comment?

Zimbra: Transport Table for external servers

Configuring transport tables to relay emails to a different mail server. In this example I am forwarding all emails for otherdomain.com to smtp.otherdomain.com . You can add as many transport maps as you need. All commands should be run as a user ‘zimbra’. After 5.0.9, postfix_transport_maps has been modified a bit, so we’ll show both ways.

$ zmlocalconfig   |grep -i postfix_transport_maps

This will show you the current transport maps file configuration:

postfix_transport_maps = proxy:ldap:/opt/zimbra/conf/ldap-transport.cf

Create your transport file (owner/group-owner should be zimbra):

vi /opt/zimbra/postfix/conf/transportfile
otherdomain.com     :[smtp.otherdomain.com]

You can also add multiple transport maps, for example:

mydomain.com     :[mail.otherdomain.com]
mydomain.org     :[mail.otherdomain.com]
hisdomain.net    :[mail.otherdomain.com]

In this example all emails for 3 different domains will go to mail.otherdomain.com, so destination will be changed, while user name will remain as in original email address.

Convert the transport file into maptype database file:

$ postmap /opt/zimbra/postfix/conf/transportfile

The file transportfile.db will be created in this directory. Define the new transport file (original, not *.db one) BEFORE the default one. Run:

$ zmlocalconfig -e postfix_transport_maps=hash:/opt/zimbra/postfix/conf/transportfile,proxy:ldap:/opt/zimbra/conf/ldap-transport.cf

Finally, make sure that the relay_domains parameter in main.cf contains all domains handled by the server, whether locally or relayed elsewhere:

$ vi /opt/zimbra/postfix/conf/main.cf
relay_domains = otherdomain.com, mydomain.com, mydomain.org, hisdomain.net, locallyhandleddomain.com, localaliaseddomain.com

Restart Zimbra:

zmcontrol stop
zmcontrol start

This will forward all emails for the example domains and subdomains to host smtp.otherdomain.com while allowing local domains to continue to be delivered locally. However you’ll need to be careful at zimbra upgrades. The modification will be overwritten by the upgrade. If you still not able to set the correct transport tables, contact Zimbra Support.

http://wiki.zimbra.com/index.php?title=Transport_Table_for_external_servers

By WladyX on | General, Mail, Zimbra | 1 comment

Dovecot convert plugin from mbox to Maildir

By WladyX on | General, Mail | A comment?

Delete Postfix Mail Queue

postsuper -d ALL

By WladyX on | General, Mail | A comment?

Remove Duplicate Emails with Mutt

Just do a tag-pattern (bound to T here), put in ~= as the pattern, then all duplicates will be tagged. After that, you can delete tagged messages (bound to ;d, or just d if you have $auto_tag=yes).

source

By WladyX on | General, Mail | A comment?

Creating bulk users in linux

/root/bulk-user-add.txt:

sanjay:mypass99:555:555:Sanjay Singh:/home/Sanjay:/bin/bash
frampton:mypass99n:556:556:Frampton Martin:/home/Frampton:/bin/bash
—-


barun:mypass99:560:560:Barun Ghosh:/home/Barun:/bin/bash

# newusers /root/bulk-user-add.txt

source

By WladyX on | General, Scripts | A comment?

Sed & Awk oneliners

By WladyX on | General, Scripts | A comment?

Permanent file erasing

Install "wipe", its in the repos.

To delete dirs use it like this: wipe -rfs

Add a nautilus action (menu system > prefs > nautilus actions) like this to make it available in nautilus (you can then select all the dirs and files you want and shred them with 1 right click):

path : wipe
params: -rfs %M

Edit: you need to install nautilus-actions from the repos for this…

By WladyX on | General, Scripts, Ubuntu | A comment?

HDDtemp monitoring in zabbix

/etc/sudoers:

zabbix ALL=NOPASSWD: /usr/sbin/hddtemp

zabbix_agentd.conf:

UserParameter=disk.temp[*],sudo hddtemp -n $1

item in zabbix:

disk.temp[/dev/hda]

source

By WladyX on | General | A comment?