Tuesday, June 4, 2013

Forwarding already received (spooled) mail to an external address on Linux

After migrating my users to a Google apps domain, I still maintained the Linux server for a while. Several months later, one of my users then changed computers and all of a sudden she would sometimes experience "lost" email, where someone would insist they send her an email but she couldn't find in in her outlook. A few days later we then noticed that I had forgotten to set up her outlook to get mail from the Linux server. All the other users get their mail forwarded automatically to the new domain via the aliases file and only this user was  still "popping" to the new server.

After setting up my user's forwarding, I was left with the problem of her accessing those mails that had already been received on the Linux server and that week she was working away from the office and popping them into outlook wasn't possible. That's when I discovered a nifty little utility called formail. It formats your mail file properly and submits it to sendmail for forwarding to the new address using the command below:


cat spoolfile | formail -s /usr/sbin/sendmail her_new_address

Believe me, I have done this before but after a long while without doing anything similar on the Linux server, it took me quite a while of googling to come up with the correct command! Hope this saves you a bit of time if you need to do anything similar.

Thursday, December 16, 2010

How to delete saved windows login details


  • In command, do NET USE
  • This lists the saved connections. Delete the connection that you intent to clear passwords for  by issuing NET USE \\servername /DELETE
  • Do control userpasswords2 to open the users accounts panel within the main control panel.
  • Go to the advanced tab and see the list of saved user passwords.
  • Select the particular server for which you want to remove credential and click remove.

Monday, July 12, 2010

Slow Drupal 6 Admin Pages

If Drupal 6 is experiencing slow admin pages,

Go to system table and change the value of 'status', 'bootstrap' and 'throttle' to 0

update system s
set s.status=0, s.throttle=0, s.bootstrap=0
where filename = 'modules/update/update.module'

Now you should be able to access the ./admin area :)

A more detailed fix is at http://www.tmsnetwork.org/blog/content/2008/08/22/drupal-6-slow-administ...

Wednesday, May 12, 2010

Use Append Query for Identity Insert or to Set Initial Value of AutoNumber Field

After a lot of struggle with a database that I am developing, I finally stumbled upon a better solution to my woes. I knew there is something called Indentity insert in MySQL but just could figure out how to do the same in Microsoft Access.

Now I just need to test this out and see if it will help me to resolve lots of issues that I am having in one of my projects where database are failing to synchronize using Jet replication.

Fix:
By design, Microsoft Access always numbers AutoNumber fields beginning with the number 1. You cannot edit an AutoNumber field or change its starting value. 

However, you can force Microsoft Access to number an AutoNumber field with a number you choose by following these general steps: 

  • Copy the design of the original table in which you want to set the starting AutoNumber value to a new table.
  • Change the AutoNumber field in the new table to a Number field with a FieldSize property of Long Integer.
  • Add a record to the new table, and set the Number field to a value that is one less than the starting number you want for your original table. For example, if you want the AutoNumber field to start at 100, type 99 in the Number field of the new table.
  • Use an append query to add this new record to your original table. This action forces Microsoft Access to number any new AutoNumber fields with your number plus 1.
NOTE: Do not compact the database before you add a new record to the original table. If you do, Microsoft Access will reset the AutoNumber field value to the number 1.


Check out http://support.microsoft.com/kb/94821/ for the full reference.

Friday, February 19, 2010

How to install .Net 1.1 on windows 7


To install .net 1.1 on windows 7 follow these steps:
1. Create a new folder named DotNet in C:\ drive. (The path i used was C:\DotNet )
2. Download Microsoft .NET Framework 1.1 Redistributable Package (dotnetfx.exe). Make
sure the setup file is saved as dotnetfx.exe.
3. Download Microsoft .NET Framework 1.1 Service Pack 1 (NDP1.1sp1-KB867460-
X86.exe). Rename the file to dotnetfxsp1.exe.
4. Copy both installation files into the same directory (i.e. C:\DotNet),.
5. Open Command Prompt as Administrator.
6. Change to the directory where the two installation files are stored, ie 
C:\DotNet.
7. Run the following commands one by one.

--> dotnetfx.exe /c:"msiexec.exe /a netfx.msi TARGETDIR=C:\DotNet"

Click on Yes and wait for this dialog which says installation complete.

--> dotnetfxsp1.exe /Xp:C:\DotNet\netfxsp.msp

--> msiexec.exe /a c:\DotNet\netfx.msi /p c:\DotNet\netfxsp.msp

Wait for the installer to disappear automatically.

8. Install Microsoft .Net Framework 1.1 with slipstreamed Service Pack 1 by running netfx.msi from the working folder.

Dotnet Framework 1.1 is successfully installed. :-)

Credit to http://saranspot.blogspot.com/2009/02/installing-dotnet-framework-11-on.html

Tuesday, October 27, 2009

Disabling Windows Autoplay

Have you ever been infected by a virus from someone’s flash disk even before you have open any file from the flash disk? Ever been inconvenience by your antivirus auto detecting viruses from someone’s flashdisk when all you want to do is to give them a file? I have and the reason is windows’ autoplay feature which starts executing a default program as instructed by the flashdisk the moment you insert it into your computer. This means before you even have a chance to scan the flashdisk, if infected, the flashdisk is already tryin to infect you!

 

To disable autoplay, edit your computer’s group policy by click start -> run then type gpedit.msc and click ok. This should open the group policy console from which you should click computer configuration -> administrative templates->system. After clicking system, scroll down to where it says Turn off Autoplay and doubnle click. A window such as the one below appears.

 

Click Enabled and choose All Drives as show below. Click OK then close the group policy console and that’s it!

Monday, October 26, 2009

Recovering from other Windows XP boot errors

Like they say, windows XP can crash for no apparent reason. Besides the registry, the other likely cause of a crash is a corrupt boot initialization file (boot.ini). To recover from such an error, you may boot into the recovery console and execute the folling commands in sequence to rebuild Windows’boot configuration.

CD \

C:\> ATTRIB -H C:\\boot.ini

·         C:\> ATTRIB -S C:\\boot.ini

·         C:\> ATRIB -R C:\\boot.ini

·         C:\> del boot.ini

·         C:\> BOOTCFG /Rebuild

·         C:\> CHKDSK /R /F

·         C: FIXBOOT

 

That should rebuild the Windows boot configuration and allow you to log into windows, hopefully saving you from doing a repair install or a full fresh installation of Windows.