Showing posts with label leopard. Show all posts
Showing posts with label leopard. Show all posts

Monday, March 23, 2009

OSX hangs on login when bound to Active directory

OSX hangs on login when bound to Active directory

Solution is to remove it from the AD.

ssh username@machineip

$ sudo dsconfigad -r -u username

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:

Network Password:

Computer removed from Active Directory


$ reboot


The computer should login properly now.

Start VNC from command line and connect to Mac from Windows VNC client

Here is how to start VNC from command line on your macintosh (say, via ssh) and then connect to your Macintosh from a Windows VNC client


Server side (SSH to your mac):


Step 1: -- set privs


Badabing:~ rob$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -allUsers -privs -all
Starting...
Setting allow all users to YES.
Setting all users privileges to 1073742079.
Done.

Step 2: -- Allow VNC clients


Badabing:~ rob$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvnclegacy -vnclegacy yes
Starting...
Set the client options.
Done.

Step 3: -- Set VNC password (change it at the end of the line (i.e. don't use supersecret))

Badabing:~ rob$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -clientopts -setvncpw -vncpw supersecret
Starting...
Set the client options.
Done.


Step 4: -- Restart service

Badabing:~ rob$ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -restart -agent -console
Starting...
Stopped ARD Agent.
Stopped VNC Privilege Proxy
Stopped RFB Register MDNS
Done.

Badabing:~ rob$


Step 5: -- Client side config

Windows (Client Side)

I installed the tightVNC viewer.

Enter IP address in the VNC Server field. Click "Options" Change Encoding to Hextile. Click ok.

Click Connect.

Enjoy.

Create ISO CD/DVD image using OSX

Create ISO CD/DVD image (.iso) with Mac OS X


1. Insert CD/DVD source

2. Fire up a Terminal, you can then determine the device that is you CD/DVD drive using the following command:

$ drutil status

Vendor Product Rev
MATSHITA DVD-R UJ-835E GAND

Type: DVD-ROM Name: /dev/disk1
Cur Write: 8x DVD Sessions: 1
Max Write: 8x DVD Tracks: 1
Overwritable: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Free: 00:00:00 blocks: 0 / 0.00MB / 0.00MiB
Space Used: 364:08:27 blocks: 1638627 / 3.36GB / 3.13GiB
Writability:
Book Type: DVD-ROM

3. Umount the disk with the following command:

$ diskutil unmountDisk /dev/disk1

Disk /dev/disk1 unmounted

4. Create the ISO file with the dd utility (may take some time):

$ dd if=/dev/disk1 of=file.iso bs=2048

5. Test the ISO image by mounting the new file (or open with Finder):

$ hdid file.iso

6. The ISO image can then be burnt to a blank CD/DVD.

Cisco VPN Error 51 workaround

Cisco VPN Error 51 workaround

Macintosh OSX


Have you have ever encountered the following error when launching the Cisco VPN Client on your mac:

Error 51: Unable to communicate with the VPN subsystem.
Please make sure that you have at least one network interface that is currently active and has an IP address and start this application again.


The problem stems from another network interface (like firewire or a third party network interface such as VMware or Hamachi) stepping on the cisco VPN interface.


Over the years, I have worked around this problem in several ways... all of which are not as graceful as:


sudo SystemStarter restart CiscoVPN


Anyway, just wanted to save you reboots and or frustration should it ever come up for you...

You could even make an alias out of it by add the following line to your .bash_profile

alias resetcisco='sudo SystemStarter restart CiscoVPN'

then (on next login) you could just type "resetcisco".

Wednesday, April 2, 2008

OSX Leopard hamachi auto start

For those of you waiting to have a Leopard compatible gui for hamachi... This should help for now. This will get you up and running with the command line.


The following should start tuncfg on boot (as root) and then hamachi will start up on login.


First install the leopard tun/tap drivers.

You need to make sure that Xcode tools are installed (you can install them from your leopard disc -- find them under optional installs) or them from Apple's Developer connection. If this is not installed you will get an error when attempting to use "make".

You will them be able to install hamachi.

After you get hamachi working properly from the command line.... use the follow (very rough) steps to get it to auto-start for you.




Here's what I did:



created directory:

sudo mkdir /Library/BootScripts

created file:

sudo vi /Library/BootScripts/loadtuncfg.sh

filecontents of loadtuncf.sh

----- snip -----

#!/bin/bash

sleep 30
/usr/sbin/tuncfg

------- end of snip ------

sudo chmod 755 /Library/BootScripts/loadtuncfg.sh
(file is owned by root:admin on my machine)


created file:

sudo vi /Library/LaunchDaemons/com.loadtuncfg.launchd.loadtuncfg.plist



file contents of com.loadtuncfg.launchd.loadtuncfg.plist:


-------snip---------


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.loadtuncfg.launchd.loadtuncfg</string>

<key>KeepAlive</key>
<false/>

<key>ProgramArguments</key>
<array>
<string>/Library/BootScripts/loadtuncfg.sh</string>
<string>run</string>
</array>

<key>RunAtLoad</key>
<true/>
</dict>
</plist>


----------end of snip -----


All of the above should start tuncfg on boot (after 30 sec delay).




Now to start hamachi after local user login...

Make sure to change "yourusername" to the user that you use. Even in the .plist file below.




created directory: (notice not using sudo)

mkdir /Users/yourusername/Library/LoginScripts/

created file: (notice not using sudo)

vi /Users/yourusername/Library/LoginScripts/loadhamachi.sh

file contents of loadhamachi.sh:

-------- snip --------

#!/bin/bash
sleep 40
hamachi start
hamachi login
hamachi go-online yournetworkname

---- end of snip -----

chmod 755 /Users/yourusername/Library/LoginScripts/loadhamachi.sh
(file is owned by yourusername:yourusername)

created directory: (notice not using sudo and directory may already exist)

mkdir /Users/yourusername/Library/LaunchAgents


created file: (notice not using sudo)

vi /Users/yourusername/Library/LaunchAgents/com.loadhamachi.launchd.loadhamachi.plist

file contents of com.loadhamachi.launchd.loadhamachi.plist:

--- snip ----

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.loadhamachi.launchd.loadhamachi</string>

<key>KeepAlive</key>
<false/>

<key>ProgramArguments</key>
<array>
<string>/Users/yourusername/Library/LoginScripts/loadhamachi.sh</string>
<string>run</string>
</array>

<key>RunAtLoad</key>
<true/>
</dict>
</plist>

------ end of snip ------

file is 644 (as created and owned by youusername)


Now reboot...

tuncfg will load in 30 seconds after boot up..

hamachi will load 40 seconds after login.. (delayed longer to ensure that tuncfg loaded)..

(Credit: Most of this was from GirthP post at http://forums.macrumors.com/showthread.php?t=458736)



I hope this helps.