Archive for the 'How to' Category

How To make ZIP Files in OS X

To create a compressed file, either Control-click on the file and choose Create Archive (which is Apple-speak for “make a compressed ZIP file”).

Or you can click on a file, then go to the Action menu (the button that looks like a gear up in the Finder window’s toolbar), and choose Create Archive from there.

Either way, it quickly creates a new file, with the file extension “.zip.” This is the compressed file. You can also compress several different files (like three, for example) into one single archive file

just Command-click (or Shift-click contiguous files) on all the files you want included, then choose Create Archive of X Items from the Action menu. A file will be created named “Archive.zip” (that’s it!).

By the way, if someone sends you a ZIP file, don’t sweat it, just double-click it and Tiger will automatically decompress it

How to map a drives under VBS with different logon credentials

As not to go off topic with this post I have removed most of everything else in this script apart from anything relating to drive mappings.

Please note I am no expert in scripting and the information below should be properly tested if you intend to use it.

The script below maps drives for uses in two ways. First off, it will give all users the default shares and there home drive (P, S, X).

Then it checks what groups a user is a member of and attaches the appropriate drives. (W, U, Z, M, L)

Drives M, L attach to another server and also use different logon credentials. If you required another drive with different credentials, you could try…

On the line

Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path, objNetwork, objNetwork1

Add another value “objNetwork2”

Then find in the script below and copy and paste it to a new section. Then replace all the 1’s with 2’s.

Amend the username, password and the share to reflect the desired connection. And fingers crossed it should work.

Set objNetwork1 = WScript.CreateObject(”WScript.Network”)
strLocalDrive1 = “L:”
strRemoteShare1 = “\\server\share”
strPer1 = “FALSE”
strUsr1 = “username”
strPas1 = “password”
objNetwork1.MapNetworkDrive strLocalDrive1, strRemoteShare1, strPer1, strUsr1, strPas1

‘ —— Script START ——

ON ERROR RESUME NEXT

Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path, objNetwork, objNetwork1

Set WSHShell = CreateObject(”WScript.Shell”)
Set WSHNetwork = CreateObject(”WScript.Network”)

‘Automatically find the domain name
Set objDomain = getObject(”LDAP://rootDse”)
DomainString = objDomain.Get(”dnsHostName”)
WinDir = WshShell.ExpandEnvironmentStrings(”%WinDir%”)

‘Grab the user name
UserString = WSHNetwork.UserName

‘Bind to the user object to get user name and check for group memberships later
Set UserObj = GetObject(”WinNT://” & DomainString & “/” & UserString)

‘Grab the computer name for use in add-on code later
strComputer = WSHNetwork.ComputerName

‘Disconnect ALL mapped drives
Set clDrives = WshNetwork.EnumNetworkDrives
For i = 0 to clDrives.Count -1 Step 2
WSHNetwork.RemoveNetworkDrive clDrives.Item(i), True, True
Next

‘Give the PC time to do the disconnect, wait 300 milliseconds
wscript.sleep 300

‘Map drives
‘Note the first command uses the user name as a variable to map to a user share.

WSHNetwork.MapNetworkDrive “p:”, “\\server\users\” & UserString,True
WSHNetwork.MapNetworkDrive “s:”, “\\server\standards”,True
WSHNetwork.MapNetworkDrive “X:”, “\\server\company”,True

‘Now check for group memberships and map appropriate drives

For Each GroupObj In UserObj.Groups
Select Case GroupObj.Name
‘Check for group memberships and take needed action
Case “grp-Admin_tools”
WSHNetwork.MapNetworkDrive “w:”, “\\server\share”,True
WSHNetwork.MapNetworkDrive “u:”, “\\server\share”,True

Case “grp-temp-user”
WSHNetwork.MapNetworkDrive “w:”, “\\Server\Share”,True
Case “grp-FTP-root-rw”
Set objNetwork = WScript.CreateObject(”WScript.Network”)
strLocalDrive = “M:”
strRemoteShare = “\\server\share”
strPer = “FALSE”
strUsr = “username”
strPas = “password”
objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, strPer, strUsr, strPas

Case “grp-ftp-root-r”
Set objNetwork1 = WScript.CreateObject(”WScript.Network”)
strLocalDrive1 = “L:”
strRemoteShare1 = “\\server\share”
strPer1 = “FALSE”
strUsr1 = “username”
strPas1 = “password”
objNetwork1.MapNetworkDrive strLocalDrive1, strRemoteShare1, strPer1, strUsr1, strPas1

End Select

Next

‘=====================================
‘Add On Code goes above this line

‘Clean Up Memory We Used
set UserObj = Nothing
set GroupObj = Nothing
set WSHNetwork = Nothing
set DomainString = Nothing
set WSHSHell = Nothing
Set WSHPrinters = Nothing
Set objNetwork = Nothing
Set objNetwork1 = Nothing

‘Quit the Script
wscript.quit

‘ —— Script END ——

assign a drive letter to a folder

One function that is under used in windows is the SUBST command.  It allows you to map a drive letter to a local folder.  This is useful when you are dealing with large directory paths or you want a quick and easy way to access a frequently used folder.

I will use a relativity short folder structure here but you will still be able to see the benefit of this command.

If we have a bunch of files located in the folder C:\- data\code\project\USB (graphic1) each time we want to use them we need to navigate through the folder structure to access them.  Surprisingly time consuming…

Would it not be easier just to go to a driver letter like T:\?

Sure it would, so let get it done!

  1. Fire up the command prompt
    1. CLICK start > run
    2. Type CMD and click OK
    3. You should now be presented with the command prompt screen
  2. Assign a drive letter to a folder (graphic2)
    1. Type subst t: “C:\- data\code\project\USB” (you can substitute t: for any free drive on your system)
    2. Type t: press enter or check it through windows explorer (graphic4)
  3. Show subst options(graphic3)
    1. Type subst /?
  4. To display a list of current virtual drives.
    1. Type subs

If you suffer from acute command line phobia you can check out the great utility visual-subst this will do everything you need from the comfort and security of your well loved GUI.

graphic1

graphic1

graphic2

graphic2

graphic3

graphic3

graphic4

graphic4

Secure you’re Gmail

gmail https in the address bar

Gmail has been around for a while now and is still the #1 choice for most webmail users.

Gmail acheives this by inovation and giving the users what they want, like accessing it over a secure connection.

Without going in to too much detail, the reason you want to use https is that all communication that takes place between your PC and the gmail server will be kept private.  This means nobody at work will be able to take a peak at what your doing or that geeky kid at the back of starbuck will not steal your passwords.

gmail https options

How to enable HTTPS in Gmail

  1. logon to your gmail account
  2. locate and click on settings at the top right of your screen
  3. under the general tab scroll to the bottom
  4. you should now see the options for browser connection
  5. click always use https
  6. click the button save changes
  7. sit back and access gmail with all the secure socket layer protection goodness

Keep the focus on format painter

What did you do before you knew about format painter?  Well my guess is a shed full of repetitive formatting.

Format Painter is one of those time saving shortcuts that once you have found it, life using Word and Excel is a much more pleasant experience.

MS Word 2003 MS Word 2003
word2003 fromat painter word2007 fromat painter

Basic usage

  • Simply place your cursor within your document text that has your desired format
  • Click the Format Painter icon (I have included screen shots of MS word 2003 & 2007)
  • You will notice your cursor will change to fromatpainter icon, you can now highlight the text you want to change and hey presto it takes on a new format!

Power usage

As of MS Office 2007 format painter gets a natty advertisement of this power tweak (see the screenshot on the right, above) but it also applies to previous version and for all of you that do not know about it all you need to do is shut your eyes and…..

Double click (the tool bar icon)

Now the Format Painter icon will not revert to the standard cursor and you can format till your heart content.  To revert to your normal cursor simply press the ESCAPE key or click the tool bar icon again.

What are you waiting for, get formatting!

get aliases working with FileZilla Server

Do you want to work with aliases within the FileZilla server software. Well stop looking for instructions and read this how to !

It’s not as hard as you think and once you get your head round it, it is really straight forward! Grab the how to from the link below and get started.

  get aliases working with FileZilla Server (303 KiB, 10 hits)
You need to be a registered user to download this file.

install ubuntu on a powerbook

Virtualbox is a great virtualization product for OS X that also works on Windows and Linux!

In this How to it will show you how to get Ubuntu up and running within OS X.

  install ubuntu on a powerbook (985.2 KiB, 9 hits)
You need to be a registered user to download this file.

Getting IPCOP and OpenVPN to use DNS

IPCOP is one of my favourite pieces of software.  It is a great internet gateway solution for home users and small to medium businesses.  I use the Zerina addon to install OpenVPN and this in my option turns IPCOP into the best open source VPN/Firewall/Proxy solutions out there.

Following on from here.  Another issue I find is when you install it; it does not push through DNS from the local network (green interface).  To solve this problem it is a simple configuration change made to one file.

The easiest way to do this is use WINSCP to connect to your IPCOP machine. Locate the file server.conf from the location below

/var/ipcop/ovpn/server.conf

Edit the file adding the following line, just add it at the bottom.

push “dhcp-option DNS 192.168.0.5″

Replace ‘192.168.0.5‘ with your internal DNS server for the Green network.

Save the file and reboot IPCOP.

Now when your clients connect they can use IP or the DNS name of the computers in the green network!

Check connectivity to a mail server

When email does not get delivered it can be a real pain.

Here I will try to explain a few basic trouble shooting tips that you can perform to try and narrow down the problem by connecting to the remote mail server.

I will be using Windows XP commands for this. But most operating systems have these tools inbuilt or very similar ones available.

Tools used

  • NSLOOKUP
  • PING
  • Telnet

NSLOOKUP

First off we will use NSLOOKUP to find the mail server we are having problems sending to.

  1. Open a command prompt.
  2. Type “NSLOOKUP” and press enter.
  3. Type “SET TYPE=MX” and press enter.
  4. Type in the domain name your having problems with eg. “microsoft.com” Look for the server name with the lowest MX preference number and note it down. If they are all the same preference, just use anyoneone.
  5. Quit NSLOOKUP by typing “exit

PING

Now we will use the PING command to see if the server we found in part one is reachable.

  1. Open a command prompt.
  2. Type “PING server address” (ping mail.microsoft.com )

Please note that if the server has ping disabled you may get Request timed out message. This does not necessarily mean it is down.

TELNET

Lastly using the TELNET command we will connect the the remote email server and send a test email.

  1. Open a command prompt.
  2. Type “TELNET server address 25
  3. You should see a server welcome message
  4. Type “HELO” and press enter (you might not see what you type. This is normal)
  5. Type “mail from: myemail@mydomain.com” substituting your address and press enter.
  6. Type “rcpt to: user@server.com” substituting the recipients address and press enter.
  7. Type “data” and press enter.
  8. Type “Subject: Test message” and press enter TWICE
  9. Type “This is a test message.” and press enter. You must have the . (full spot/period)
  10. Type “quit” and press enter to exit.

If everything has work the message will now be sent, confirming the server is working fine. If not more troubleshooting is required!