General

Huawei on Linux

Ubuntu 9.10:

/etc/udev/rules.d/62-option-modem-modeswitch.rules:
ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="141b,RUN+="modem-modeswitch-v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"

sudo /etc/init.d/udev restart

source

Arch:

Install usb_modeswitch from AUR and create:

/etc/usb_modeswitch.conf.e1550
/etc/udev/rules.d/55-e1550.rules
/usr/share/hal/fdi/preprobe/20thirdparty/10-huawei-e1550.fdi

source1
source2

By WladyX on 15 March, 2010 | Arch, General, Mobile, Scripts, Ubuntu | A comment?

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

Zimbra: Transport Table for external servers

Dovecot convert plugin from mbox to Maildir

Delete Postfix Mail Queue

postsuper -d ALL

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

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

Sed & Awk oneliners

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…