Syncing automatically Google Calendar with your phone

This is the procedure to have your Google Calendar synchronized with your mobile phone.

This is a list of what you need:

  1. A Bluetooth Sync enabled phone.
  2. iSync
  3. iCal
  4. Google Calendar

Go to your Google Calendar, choose “Settings” and then go to the “Calendars” tab.

gcalendar.gif

Click to the chosen calendar, usually “Name Surname”.

exportcalendar2.gif

There’s a icon name “ICAL”. This is the export link of the calender for the Apple iCal.
Copy the Link Location.

Now launch iCal, and from the menu Calendar choose “Subscribe…”.
Enter the private URL taken from the Google Calendar from the previous step.
Set the Auto Refresh parameter to the minimum value: 15 minutes.

ical_settings.gif

Now, launch iSync, and add your mobile phone to the device list:

isync.gif

Be sure to synchronize you Google Calendar, in this case “Syncro”.

Now, launch AppleScript Editor and create a little AppleScript file by typing the following content:

Tell application “iSync”
activate
synchronize
repeat until syncing is false
if syncing is false then
quit
end if
end repeat
quit
end tell

Save the file Document folder with “syncMobile” name.

Now we tell the OS X to synchronize with the mobile:

Launch a Terminal and type the following commands:

crontab -e

enter the following line (my username is “mauro“, change it to your username) :

30 7,20,21,22 * * 1-5 osascript /Users/mauro/Documents/syncMobile.scpt

Starting from now, every day from Monday to Friday, at 7:30 then 20:30, 21:30 and 22:30 your Mac
will try to synchronize your handset with the contents of Google calender, but ONLY if is in the Mac range!!

Have nice syncing.

Advertisements

Mounting OSX .DMG images from shell

This is an easy way to mount OS X installer packages (.dmg files) from the command line tool.

First of all, you must have your .DMG file, or you can download it still using the shell.

To download with command line use the curl command:

MacMini>curl http://web.address.pointing.to/the/file/to/download.dmg > myFile.dmg

Then to mount the image use the following command:

MacMini> hdid myFile.dmg

That’s all!

Connecting to your Mac from Workplace

If you have the need to connect to my home mac, but your company firewall will not allow youto use vnc, this is the post for you!!

So, this is a way to connect using a vpn using only open source software.
Don’t’ forget to make a donation if you like the software!!!!

What you need:

1. Server Installation

1.1 OS X VNC Server

Download VNC Server and install on your OS X.

Set a password for the incoming connection and configure for Startup at System startup (you may be required to confirm with admnistrator password).

1.2 Open VPN Server

Uninstall the package. Then configure e compile it with the following commands:

./configure
make
make install

Now you have to generate encrypting keys:

cd easy-rsa
. ./vars
./clean-all
./build-ca

enter the informations requested.

./build-key-server server
./build-key client1
./build-key client2
./build-key client3

The keys generated will be stored in the keys directory.

Now, we have to create the configuration:
sudo mkdir /etc/openvpn
cp keys/* /etc/openvpn
cd /etc/openvpn

now we create a file called home.config

and paste the following lines:

port 443
proto tcp-server
dev tun
ifconfig 10.8.0.1 10.8.0.2
secret /etc/openvpn/server.key
keepalive 10 60
ping-timer-rem
persist-tun
persist-key

At this point the server configuration is done.
you can launch the openvpn server with the following command:

sudo /usr/local/sbin/openvpn –config /etc/openvpn/home.conf &

The last step: copy the /etc/openvpn/server.key to the computer that needs to connect to your mac.

2. Client Installation

2.1 OpenVPN Client

Install the openVPN windows client.
copy the server.key taken from your mac to the C:/WINDOWS directory

Now from the openvpn client select “Edit Config” and paste the following line:

remote <Your_IP_Address>
dev tun
ifconfig 10.8.0.2 10.8.0.1
secret C:/WINDOWS/server.key
;comp-lzo
keepalive 10 60
ping-timer-rem
persist-tun
persist-key
proto tcp-client
port 443

save it.

2.2 VNC Viewer

Install the VNC Viewer on you system.

3 Connect to your Mac

Now this is the simple procedure.

1) lauch openvpn selecting “connect”

2) lauch vnc and enter the following address
10.8.0.1

3) at this you’ll be asked for a password, you have to enter the one you choose

for the VNC Server in step 1.1

Have fun!!

MacMini: enabling deep sleep

If you want to enable the windows-like “hibernation” feature on your mac mini, this is your post.

  1. Go to http://deepsleep.free.fr/ and download the .dmg
  2. Double click on the .dmg file.
  3. Double click on the “Deep Sleep” icon and install it.
  4. Launch Terminal application, located in the Utilities folder in the Application folder
  5. Now you have to execute some commands:
    1. With an administrator user type:
      sudo pmset -a hibernatemode 3
    2. Check if the file located in /private/var/vm/sleepimage exists, if not repeat command 1 again.
    3. Now, you have to fix a little issue.
      Go to your home folder, the to Library folder and then Widgets one.
    4. Select “Deep Sleep” and right-click on it. Choose “Package Contents”.
    5. In the terminal window type: cd /Library/Widgets/Deep\ Sleep.wdg/
    6. Now fix the issue: chown root:wheel deepsleep
    7. And again: chmod 4755 deepsleep
    8. At this point, everything should works.

Click on the widgets icon on the toolbar, then click on Deep sleep.
To wake up your mini, click on the power button on the back side.