Hviidnet.com
27Dec/090

Check Ubuntu swap is allocated

swapon -s

Checks what paths are currently accepted for swap

Tagged as: No Comments
27Dec/092

Ubuntu wrong disk size with DF

Is your linux reporting the wrong disk size after expanding the disk?

get this: http://www.sysresccd.org/

1. Boot you system with a CDROM/USB using any of the rescue linux or knoppix etc. I used sysresccd.
2. After boot up

umount /dev/sda3 (just in case if it is mounted)

3. do a file system check
Code:

fsck -n /dev/sda3

Output shuld be

/dev/sda3: clean, >

4.Removed the journal from /dev/sda3, this will make it an ext2 partition

tune2fs -O ^has_journal /dev/sda3

5. run

e2fsck -f /dev/sda3

6. resize the partition (with resize2fs without options takes your max size of the disk)

resize2fs /dev/sda3

7. Next run

fsck -n /dev/sda3

8. Create journal on /dev/sda3, this will turn sda3 to ext3 partition again
Code:

tune2fs -j /dev/sda3

9. Reboot the system using your original OS

Tagged as: 2 Comments
9Sep/090

Extract private key (.pem file) from .pfx

First download openssl from here (note this is the windows version)

PFX : PFX defines a file format commonly used to store private with accompanying public key certificates, protected with a password-based symmetric key (standard-PKCS12).
PEM : Openssl usages PEM (Privacy Enhanced Mail Certificate) to store the private key.

Use the following commands to extract the private key, and certificate.

If you want to extract private key from a pfx file and write it to PEM file

openssl.exe pkcs12 -in publicAndprivate.pfx -nocerts -out privateKey.pem

If you want to extract the certificate file (the signed public key) from the pfx file

openssl.exe pkcs12 -in publicAndprivate.pfx -clcerts -nokeys -out publicCert.pem

To remove the password from the private key file.

openssl.exe rsa -in privateKey.pem -out private.pem

This is required as, at the time of exporting privateKey, you have added a password to the private key to secure it. If you left the password with it, it will keep asking the password as any application tries to access it.

Filed under: SSL No Comments
29Jul/090

Getting timemachine to backup to NAS

Some of us may own Network Attached Storage (NAS) devices, and/or may feel that an Apple Time Capsule is too expensive, and hence would rather buy a seperate router, NAS and Hard Disk Drives. This guide will help you to enable Time Machine on any NAS, allowing you to have the functionality of a Time Capsule, with hardware of your own choosing.

  1. Prepare your NAS. Make sure it is fully functioning. This mini-guide assumes you already have one that is functioning well, and you know how to manage it.
  2. It would be preferable to assign your NAS a Static IP address. Check your router and NAS documentation for guidelines on how to do this.
  3. In OS X, open up Terminal and enter the following command to enable Time Machine to work with your NAS: defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
  4. Log out of OS X and Log in again. You do not need to reboot your machine.
  5. Time Machine saves backups in a very specific format, and we will use a sparsebundle to get this done. The sparsebundle name consists of your Computername_MACaddress.sparsebundle.
  6. Find the MAC address of the machine’s internal Ethernet port with ifconfig en0 | grep ether | sed s/://g | sed s/ether// in Terminal. This will return one line of output, which is the MAC address for the Ethernet port, which will be a string of 14 hexadecimal characters (letters and numbers, for example, 001ec4b8f9b3). 

Even if the network backups will be done using a different port (e.g. AirPort: usually en1), the system will use the MAC address of en0 as part of the system identifier.
  7. Make a new “sparsebundle” on a local disk (NOT the Time Machine disk!). This sparsebundle is a virtual filesystem image which we’ll copy to the NAS, and Time Machine will then access it remotely (that way Time Machine’s not limited by the filesystem features of whatever NAS it’s using: all the funky stuff happens within the sparsebundle). By default sparsebundles can keep growing until they fill up the NAS, but in this scenario we keep other things on the NAS as well as backups, and we’re going to limit the sparsebundle size to 70 GB.Enter the following command in Terminal:
    sudo hdiutil create -size 70g -type SPARSEBUNDLE -nospotlight -volname "Backup of My Mac" -fs "Case-sensitive Journaled HFS+" -verbose ./Computername_MACaddress. This will create a 70GB sparse-bundle as a case-sensitive, journaled HFS+ without spotlight indexing. Substitute variables in red for values you need. Computername_MACaddress may be in the form of “DansComputer_001ec4b8f9b3
  8. Log into your NAS and create a user Account (Eg, “TimeMachine”). You may want to assign disk space quotas for this user if you need to.
  9. On your NAS, create a shared folder (Eg, “TimeMachine”). Add the user account you created in step 8 above, and grant that user Read+Write privileges.
  10. In Finder, select Go>Connect to Server. For the server address, type smb://TimeMachine@ip-address-of-nas/TimeMachine. Click Connect and when prompted, enter the password and save in your keychain.
  11. Now copy your locally created sparsebundle into the TimeMachine share. If you did not change the folder when you entered command prompt, you may find this sparsebundle in your Home folder (/Users/yourusername).
  12. On your NAS, check to see that the file is copied under the correct user account.
  13. Open up Time Machine, select your “TimeMachine”-folder as the desired destination, and the backup will start.
  14. Tip: For the first backup it is recommended to connect via LAN, as you will be able to get a throughput of 10-30MB/sec.
  15. If your NAS allows for it, you may now hide your TimeMachine folder so they do not show up over the network share list.

Hope this helps.

24Jul/090

Exchange 2003 and pop3 timeouts

If you have a system where most users get timeouts on their pop3 accounts this might be the fix!

Install and open wireshark (google wireshark) and set it to filter to only pop3 with this:  "tcp.port == 110"

try to login to the pop3 server with telnet like this:

telnet exchangeserver.com 110

user userwithproblem@exchangeserver.com

pass testpassword

list

retr 1

see if you dont get signoff  message in wireshark you might have this problem. Its detailed in KB816896

Make this reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\POP3Svc\Parameters]
"CheckPop3Tail"=dword:00000001

(REMEMBER a return in the end or regedit wont eat the file is its supposed to)

Install the regfile, and restart the pop3 service.

Try and get your mail again.

Hope this helps someone out there :)