Add a bat or cmd file to the windows 7 taskbar

This thread nearly answers my problem, another thread worth reading that solves these issues in a different way is here: http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/a44e74a1-20cd-4924-8f2b-3e6b688f1ad7/

the best other way is this: I was able to add a batchfile to the taskbar by the following steps:

1. Renaming your .cmd/.bat to to .exe
2. right click on the *.exe and choose pin to taskbar
3. rename it back to .cmd/.bat
4. shift+right click the taskbar icon (for the exe) and choose properties
5. Change the reference from *.exe to .cmd/.bat and change icon as needed
6. It starts working right away but the icon refresh needs a reboot..

Or:

1. Create shortcut to your batch file
2. Get into shortcut property and change target to something like that: cmd.exe /C “path-to-your-batch”
3. Simply drag your new shortcut into a taskbar, it should be now pinnable

Cygwin crontab backups

A list of useful pages relating to cron and backup scripts:

http://iamcam.wordpress.com/2006/02/22/incremental-backups-with-rsync/
http://linuxbites.wordpress.com/2010/06/28/starting-crontab-in-cygwin/
http://www.cyberciti.biz/faq/linux-unix-crontab-change-mailto-settings/
http://stackoverflow.com/questions/707184/how-do-you-run-a-crontab-in-cygwin-on-windows

Virtualmin Postfix Queue Error

If you receive this error in Webmin / Postfix:

/usr/bin/postqueue -p failed : sh: /usr/bin/postqueue: No such file or directory

The easiest solution is to find the postqueue file and make a synlink. postqueue is usually stored in /usr/sbin

Command to fix:

cd /usr/bin
ln -s /usr/sbin/postqueue postqueue

SMTPS Client for Linux and Synology NAS

A nice application called NAIL can be used to provide authenticated email transmission to your ISPs SMTP mail server.

Install using:
ipkg install nail

Edit the file:
vi /opt/etc/nail.rc

and add the following lines:

set smtp=smtp://mail.example.com
set from=”someone@example.com
set smtp-auth-user=an@example.com
set smtp-auth-password=password
set smtp-use-starttls
set ssl-verify=ignore

Save the file an run a test:

echo “my message” | /opt/bin/nail -v -s “test” someone@else.com

Dynamic DNS Updates with DHCP on Windows 2008 Server

To get the dhcp server to dynamically update the DNS records whenever an ip is issued to the following things:

  • Open DHCP Manager, right click the IPv4 Properties, goto the DNS Tab and set:
    • Enable DNS dynamic updates….
    • Always dynamically update DNS A and PTR records
    • Check Dynamically update DNS A and PTR records for DHCP clients that do not request updates….
  • Then goto the Advanced tab, hit the Credentials button and provide a valid username and password

This particularly applies to clients that are using the DHCP server and are not registered members of the domain

See Which Groups Your Linux User Belongs To

When you are using a linux system, itโ€™s useful to find out what groups you belong to, so you can understand whether you have access to files and directories. This is one of the simplest commands possible. This command should work on most varieties of linux.

groups [username]

Telling find to ignore a directory

Quite simple:

find / -follow -path ‘/path/to/ignore’ -prune -o -name file-to-find.sh -print

Enable SFTP on Synology NAS

To enable SFTP you have to SSH into your Synology as root and edit the following file using vi.

This sshd_config file should be located here ‘/etc/ssh/sshd_config’.

If it isn’t type ‘find / -type f -name ‘sshd_config’ -print’

Make the file look like this

# override default of no subsystems
#Subsystem sftp /usr/libexec/sftp-server
Subsystem sftp internal-sftp -f DAEMON -l VERBOSE
#Subsystem sftp /usr/syno/sbin/sftp-server -l DEBUG3

Reboot and done!

Virtualmin Mailman for multiple virtual domains

There is a known issue with mailman that you cannot have two lists with the same name i.e.

test@domain1.com test@domain2.com

(see http://www.virtualmin.com/node/16982)

CPanel has a solution to this issue and i’d like to implement it in virtualmin.

CPanel will create the mailman lists with the listnames:

test_domain1.com test_domain2.com

however CPanel will set the mail aliases correctly. as test@domain1.com, test@domain2.com.

Looking at the following virtualmin-mailman config page: http://domain.com:10000/virtualmin-mailman/index.cgi?show=domain.com The add mailing list section requests a listname i.e. “test” and a domain name i.e.”domain1.com”

In the file, /usr/libexec/webmin/virtualmin-mailman/add.cgi I see no reason why the two parameters above can’t be combined to form a new hybrid list name “test_domain1.com”

…some work later and viola an attachment below that provides all of the modifications required to make the problem disappear.

virtualmin-mailman-lib.pl

If you run a diff against the original file, you will notice the actual changes are minimal.
There are more comments and commented out debug lines than anything else!

This topic was posted as a discussion on the Virtualmin forum by me: http://www.virtualmin.com/node/19942

Cygwin / vim / rxvt arrow key problems

On my new machine I installed cygwin, the great set of unix tools for win32, (BTW this is what makes using a win32 machine acceptable IMHO, it just works like a unix box…) and as usual in vi (or vim) my arrow keys pop me out of insert mode and then insert a newline and ‘A’ ‘B’ ‘C’ or ‘D’ – very annoying.

So the search started…. and I remembered the simple solution from the last time. People say in this situation that it is your terminal, and not vim that is misconfigured. I’m not sure I believe that, because the fix includes vim.

All you need to do is modify your .vimrc file. Copy the example .vimrc file from /usr/share/vim/vim62/vimrc_example.vim to ~/.vimrc then open vi and its fixed ๐Ÿ™‚

Reference: http://simonmcc.blogspot.com/2005/06/cygwin-vim-rxvt-arrow-key-problems.html