Showing posts with label mac. Show all posts
Showing posts with label mac. Show all posts

Friday, May 27, 2016

Installing ssh-copy-id on Mac OS X using MacPorts

Ssh-copy-id is a script used to add your public key to remote server, so next time you connect to that remote server, it would be passwordless (unless, of course, if you put a paraphrase when generate your public key).

Most simple way is by using MacPorts:
$ sudo port install openssh +ssh-copy-id
That's it! And you ready to use it :)

Wednesday, April 13, 2016

Modifying Vim to be able editing crontab in Mac OS X Yosemite

Get the solution from Vim Wikia post here, already tried this by myself and worked like a charm :)

If you ever get this error while trying to add cron entries:
crontab: temp file must be edited in place
Then the solution is very simple. You just need to create ~/.vim/ftplugin/crontab.vim and add this one line:
set backupcopy=yes
Save the file and you can try to add cron entry again.

Mutt+Offlineimap Error while using it to access Gmail IMAP

The solution came from this forum

Upon Offlineimap version 6.6.0, you'll get an error when accessing Gmail IMAP, something like this:
XOAUTH2 authentication failed: AUTHENTICATE command error: BAD ['Client aborted AUTHENTICATE command. q205mb46565077wmb']. Data: MFNB2 AUTHENTICATE XOAUTH2

The solution is very simple, you just have to add one line to your .offlineimaprc file, in the [Repository YOUR_ACCOUNT-remote] section:
auth_mechanisms = LOGIN

referring to config line: #auth_mechanisms = GSSAPI, CRAM-MD5, XOAUTH2, PLAIN, LOGIN

Save the file and run your offlineimap to check that the error is already gone. Voila! :)

Setup Wi-Fi on your Raspberry Pi via the Command Line

The complete guide for this can be checked here

1. Boot up your Pi
2. Connect ethernet cable to your Pi
3. SSH into it (You can check the IP from your wireless router DHCP client list)
4. Open up /etc/network/interfaces:
$ sudo vim.tiny /etc/network/interfaces
You'll see few lines of basic configuration:
auto lo
iface lo inet loopbackiface eth0 inet dhcp
allow-hotplug wlan0iface wlan0 inet dhcpwpa-conf /etc/wpa_supplicant/wpa_supplicant.confiface default inet dhcp
5. Then open up /etc/wpa_supplicant/wpa_supplicant.conf:
$ sudo vim.tiny /etc/wpa_supplicant/wpa_supplicant.conf
Just copy and paste below script inside that file:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdevupdate_config=1network={ssid="YOURSSID"psk="YOURPASSWORD" 
# Protocol type can be: RSN (for WP2) and WPA (for WPA1)proto=WPA 
# Key management type can be: WPA-PSK or WPA-EAP (Pre-Shared or Enterprise)key_mgmt=WPA-PSK 
# Pairwise can be CCMP or TKIP (for WPA2 or WPA1)pairwise=TKIP 
#Authorization option should be OPEN for both WPA1/WPA2 (in less commonly used are SHARED and LEAP)auth_alg=OPEN 
}
Change ssid, psk, proto, key_mgmt, pairwise and auth_alg according to your wireless router setup.

6. And after you finished, reboot the pi:
$ sudo reboot
7. Upon booting, unplug ethernet cable and try to access your Pi via wireless connection (check the IP from your wireless router DHCP client list)

Just repeat the steps if you still haven't seen your Pi in the DHCP client list.
 

Tuesday, April 12, 2016

Mutt Integration With Abook in Mac OS X

This post assume that you already have Mutt running on your Mac OS X.

I choose Abook to manage my address book because it's very simple and suitable for my need.

If you don't have Abook yet, you can install it. I'm using MacPorts, so just execute this command:
$ sudo port install abook

And then, add these lines to your .muttrc config file:
set query_command = "abook --mutt-query '%s'"macro generic,index,pager \ca "<shell-escape>abook<return>" "launch abook"macro index,pager A "<pipe-message>abook --add-email<return>" "add the sender address to abook" 
A little explanation for above script:
1. set query_command (pressing ctrl-t) on Mutt - Compose view, will execute abook to look for match address based on the few letter(s) you already type in.
2. pressing ctrl-a on Mutt, will execute abook to input manually
3. pressing shift-a (or A capital) on Mutt - Index view, will add the sender from any highlight email

Just save your .muttrc and reload the config on Mutt, and you're good to go :)

*full reference see here

Backup and Restore Your Raspberry Pi SD Card Using Mac OS X

For the credit and full-complete writing about this post, you can check it here and here, I only made some modification to make it even simple.

This was done by me when I tried to expand SD capacity from 8 to 16 GB. It's very simple and practical. After this backup-restore process done, you need to expand the file system so you can acquire full 16 GB on new SD card. So, let's begin..

Backup
1. Turn off RPi
2. Put SD card into card reader slot
3. Open up 'Terminal' app (from Application -> Utilities -> Terminal)
4. Type:
$ sudo bash
5. Type in your password
6. Type these in sequence:
# mkdir -p ~/rpi/backups
# cd ~/rpi/backups
 7. Check where your SD card is listed (e.g.: mine is listed as /dev/disk2s1)
# df -h
8. Eject your SD card:
# diskutil unmountDisk /dev/disk2s1
9. Backup your SD card to image file: (please note that you have to add 'r' before 'disk')
# dd if=/dev/rdisk2 of=~/rpi/backups/backup-today-rpi.img bs=1M
10. When complete: (again, add 'r' before 'disk')
# diskutil eject /dev/rdisk2 

Restore
1.  Put new SD card into card reader slot
2.  Check where your SD card is listed (e.g.: mine is listed as /dev/disk2s1)
# df -h
 3. Eject your SD card:
# diskutil unmountDisk /dev/disk2s1
4. Restore your image to new SD card:
# dd bs=1M if=~/rpi/backups/backup-today-rpi.img of=/dev/rdisk2
5. When complete:
# diskutil eject /dev/rdisk2

Expand Filesystem
1. Powering up your Raspberry Pi
2. Execute this command:
$ sudo raspi-config
3. Choose 'Expand Filesystem"
4. Reboot

And you're done! :)

Wednesday, May 7, 2014

Setup a PPPoE Server Using Mikrotik RouterBoard 750

The scheme I'd like to achieve is like this:


This post will focus on how the PPPoE server is configured. The connection service will be asymmetric like this:
1 Mbps: 1 Mbps Download / 256 Kbps Upload
2 Mbps: 2 Mbps Download / 512 Kbps Upload

The only way to access a routerboard is using their winbox tool which you can download here. Let's start :)

Run the winbox, and you'll get this pop-up box:


Click on the button with three dots to scan connected device, choose the one mac-address that shows up and leave any other things at it is, then click the Connect button to open up another window like this:


Choose IP -> Addresses, add new and fill in the field:
Address: 10.200.10.2/24
Network: [automatically filled in when you click on 'Apply' button]
Interface: ether1

* Next, Create an IP pool for each service you'll create (allocate):
IP -> Pool, add new IP pool:
Name: 2MB
Addresses: 192.168.99.2-192.168.99.254
Next Pool: none

* Create a PPP profile for one of your service:
PPP -> go to Profile tab, add new profile and fill in the following fields:
Name: PPPOE_2MB
Local Address: 192.168.99.2
Remote Address: 2MB
DNS Server: 8.8.8.8, 4.4.4.4

* then go to PPPoE Servers, add new PPPoE service, and fill in the following fields:
Service Name: PPPOE
Interface: ether3
check 'One Session Per Host'
uncheck 'machap1' 'machap2' 'chap'

* Create a NAT rule for masquerade
IP -> Firewall -> go to NAT tab, add new NAT rule:
Chain: srcnat
Out. Interface: ether1
>> go to Action tab, choose 'masquerade' as Action

* Create Queue rule for bandwidth limit
Queue -> got to Queue Types tab, add new type for download limit:
Type Name: 2MB_DOWNLOAD
Kind: pcq
Rate: 2M

add another one for upload limit:
Type Name: 512KB_UPLOAD
Kind: pcq
Rate: 512K
uncheck 'Dst. Address'
check 'Src. Address'

* Apply the queue type just created:
go to Simple Queue tab, add new simple queue to apply queue type you just created:
in General tab:
Name: TOTAL
Target Address: 192.168.99.0/24

>> add another new simple queue rule:
in General tab:
Name: 2MB
Target Address: 192.168.99.0/24
Max Limit: choose 512KB_UPLOAD for Target Upload
choose 2MB_DOWNLOAD for Target Download
>> go to Advanced tab:
Queue Type: choose 512KB_UPLOAD for Target Upload
choose 2MB_DOWNLOAD for Target Download

* Create user credential for login:
PPP -> go to Secrets tab, add new PPP secrets:
Name: xs2
Password: xs2
Service: pppoe
Profile: PPPOE_2MB
Local Address: 192.168.99.2
Remote Address: 192.168.99.1

Then you can test it by creating a dialer, as I'm using Mac OS X, so I go to System Preferences -> Network, create a connection with a PPPoE interface:


And fill in the credential to connect:


That's it! :)



Tuesday, October 8, 2013

Run X Applications Over Network Using SSH

Topology:
Linux-based PC: 192.168.1.1
Linux-based Laptop: 192.168.1.7

In PC, you edit /etc/ssh/sshd_config using any editor you like:
$ sudo vi /etc/ssh/sshd
Looking for this line, or you can add if it's not already there:
X11Forwarding     yes
Save that file and restart SSH service:
$ sudo /etc/init.d/ssh restart
Allow Laptop to run X applications:
$ xhost 192.168.1.7
Define default display:
$ export DISPLAY=192.168.1.1:0

Then from Laptop terminal, run the command to execute any X applications you like:
$ ssh -X [username]@192.168.1.1 firefox
$ ssh -X [username]@192.168.1.1 oowriter

That's it! :)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Tuesday, April 17, 2012

Want to access Simplenote from Vim? Use Vimplenote!

If you're the person who always logging anything like I do, probably you should try Simplenote , "easy way to keep notes, lists, ideas, and more" -- that's what they say in their website :)

For me, the ubiquity to using their service in many platform is their advantage. As a vim user, fortunately there are already many plugins to support my need in using Simplenote service, and one of them is Vimplenote

One reason for choosing Vimplenote than another plugins is because it's the easiest one to configure. I also using Vundle, Vim package manager to install and manage my vim plugins.

Enough said, just follow my steps to do it:
1. I prefer clean install, so move your ~/.vim and archive it
$ mv ~/.vim ~/.vim-bk
2. Create new ~/.vim and ~/.vim/bundle (to contain your plugins)
$ mkdir -p ~/.vim/bundle
3. Setup Vundle
$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
4. Configuring .vimrc
 set nocompatible               " be iMproved
 filetype off                   " required!

 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()

 " let Vundle manage Vundle
 " required! 
 Bundle 'gmarik/vundle'

 " My Bundles here:
 "
 " original repos on github
Bundle 'mattn/vimplenote'
Bundle 'mattn/webapi'
 " ...

 filetype plugin indent on     " required! 
 "
 " Brief help
 " :BundleList          - list configured bundles
 " :BundleInstall(!)    - install(update) bundles
 " :BundleSearch(!) foo - search(or refresh cache first) for foo
 " :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
 "
 " see :h vundle for more details or wiki for FAQ
 " NOTE: comments after Bundle command are not allowed.. 
5.  Get webapi-vim and vimplenote-vim
$ git clone git://github.com/mattn/webapi-vim.git ~/.vim/bundle/webapi
$ git clone git://github.com/mattn/vimplenote-vim.git ~/.vim/bundle/vimplenote
6. Running and installing bundle
$ vim
:BundleInstall
7. Using Vimplenote (do it inside vim)
:Vimplenote -l     " list of your Simplenote notes (you'll be prompted to fill in login credentials)
:Vimplenote -d    " delete your current note
:Vimplenote -n    " create new note
:Vimplenote -u    " update current note
:Vimplenote -t     " add a tag to a note
:Vimplenote -s    " search a note
And you're good to go :)

You can also see the README file in every plugin page to see additional info.

Thursday, October 13, 2011

BingMaps go forth and back to Google Maps

If you haven't know yet, there's an update for Google Maps on your webOS smartphone (Pre, Pixi, Veer), not to another version, but to BingMaps, which is the Maps apps pre-installed in TouchPad.

Like the HP Palm Blog says, you just open App Catalog and download Maps apps from there in order to update your Google Maps.

I did that myself, and not too long after that I decided to get my old Google Maps back. So I open up webOS doctor file and look for Maps application. With the help from #webos-internals on freenode, I found it under /usr/palm/applications in com.palm.app.maps folder. So I re-package it using IPK Packager from Jason Robbitaile.

After deleting Maps apps, I installing this file using webOS Quick Install (wOSQI), again from Jason, and I've got my Google Maps back :)

SSL Certificate Errors on MacOS X

Credit goes to loopkid, for I only put several parts that I used into my blogpost.

Last time I tried to wget a libnotifyperl.pl file from the web, I got this error:


The workaround is by installing curl-ca-bundle using MacPorts:
$ sudo port install curl-ca-bundle
Then, create .wgetrc file in your home directory:
$ vim ~/.wgetrc
And put this line:
CA_CERTIFICATE=/opt/local/share/curl/curl-ca-bundle.crt
That way, you don't need to include the path everytime you want to do a wget.


Friday, August 19, 2011

#webOS: How to remove EXT3FS partition

I assume you already tried to run UbuntuChroot on your #webOS device, and now you'd like to get back any space taken by EXT3FS. Here's simple thing you can do:
1. Connect your webOS device to your PC
2. Open up Terminal (Mac/ Linux) or Command Prompt (Windows), then type "novaterm"
3. And after you presented by your webOS device's root shell, run this command:
a. Unmount EXT3FS partition:
# umount /dev/mapper/store-ext3fs
b. Remove EXT3FS partition:
# lvremove /dev/mapper/store-ext3fs


4. Then run meta-doctor to re-assign all space to user's diskspace


Or, if you already do Meta-Doctor first, like I did :p , you can follow these steps:
1. Connect your webOS device to your PC
2. Open up Terminal (Mac/ Linux) or Command Prompt (Windows), then type "novaterm"
3. And after you presented by your webOS device's root shell, run this command:
a. Display LV size of EXT3FS partition, don't forget to write that down:
# lvdisplay /dev/mapper/store-ext3fs
b. Remove EXT3FS partition:
# lvremove /dev/mapper/store-ext3fs
c. Display existing user diskspace partition:
# df -kh

d. Unmount existing user diskspace partition:
# umount /dev/mapper/store-media
e. Resize existing user diskspace by adding size of previous EXT3FS partition:
I'm using /etc/fstab to see the filesystem of user's diskspace and /proc/partitions to see total allocation for user's diskspace:



# resizefat /dev/mapper/store-media 6995968K

And here's what you've got on user's diskspace after everything is done:


Enjoy! :)

Friday, July 8, 2011

How to Make MacPorts vim default in Mac OS X Terminal

If you, like I did, ever wanted to use vim with more option, e.g. support for python, or ruby.. then you have to re-compile vim in order to use it in your Mac OS X. You can compile from source, or using Macports like me. You can also view several daily used command for macports in my blogpost here.

First, you can check what version of vim you have by typing "vim" in your Terminal apps. Then, using macports, you just execute this command:
$ sudo port -v install vim +python
After finished, you can find that newest version of vim (compare to built-in version of vim), is located in: /opt/local/share/vim/ directory

Or you can find it using find command:
$ sudo find / -name "vim"
After that, you need to put the path into $PATH, because if you're not doing that, Terminal apps in Mac OS X will execute the default built-in vim. Also, you need to put it in the beginning of your path:
PATH=/opt/local/share:/opt/local/bin:/opt/local/sbin:$PATH
That's it. Close your Terminal window/ tab, and start a new one. Type "vim" on your shell, and you'll see that you already have the new version of vim. Enjoy! :)

Show hidden files in Mac OS X Finder

While accessing my #webOS device, there comes a time when I need to show hidden files. But you can't find anywhere in the menu, just like you did with Folder Properties in Windows operating system. All you have to do is simple, using Terminal apps. Here's what you have to do:

1. Open Terminal apps
2. Type this command:
$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder
And suddenly you'll find changes in your Finder. If you ever want to get the already-revealed hidden files to default, just type the same command as above and change TRUE to FALSE:
$ defaults write com.apple.finder AppleShowAllFiles FALSE
$ killall Finder


Tuesday, June 21, 2011

Using tcpdump in Mac OS X

This is just notes taken for personal use on which options used in tcpdump command:
# sudo tcpdump -i en0 -vvv -K -n -s 0 -w ~/Desktop/DumpFile.dmp

or without -K option:
# sudo tcpdump -i en0 -vvv -n -s 0 -w ~/Desktop/DumpFile.dmp
If you want to stop it from capturing, just press control-c. And to view the file:
# sudo tcpdump -s 0 -n -e -x -vvv -r ~/Desktop/DumpFile.dmp

Here's options explanation using in command above:
-i     interface
-vvv     even more verbose output
-K     don't attempt to verify TCP, UDP and IP checksums
-n     don't convert addressed to names
-s     snaplen settings. setting snaplen to 0 means use the required length to catch whole packets
-w     write the raw packets to file rather than parsing and printing them out
-x     when parsing and printing, in addition to printing header of each packet, print the data of each packet (minus its link level header) in hex
-r     read packets from file

Friday, June 17, 2011

Google Calendar Sync With iCal in Mac OS X Tiger

You can see the complete version of this tutorial here, I've tried and using this on my Tiger (when I'm still using PowerBook G4, back then) and it works well. If you are using Snow Leopard, the option already available in both iCal and Address Book to sync automatically to Google Account. Since this tutorial is a lot and in detail, so I just copy-paste and put it here. Credits goes to all the guys at GCALDaemon team. Cheers! :)


Installation on Mac OS X
  Install GCALDaemon into the '/usr/local/sbin' directory
1) GCALDaemon supporting a Java Virtual Machine (VM) such as found in Sun's JDK or JRE, version 1.5 or higher. Check your java version:

java -version

java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing) 


2) Download the latest Linux-compatible ZIP file from SourceForge.net into your '/downloads' directory (or into your accustomed download directory).

3) Unzip this archive under the '/usr/local/sbin' directory. If the '/usr/local/sbin' directory does not exists (for example you get a 'No such file or directory' message), there are two alternative ways; you can create this via 'sudo mkdir -p /usr/local/sbin' command, or unzip GCALDaemon into the '/Applications' folder. The '/usr/local/sbin' directory is recommended but not obligatory, so you can deploy GCALDaemon into any optional folder. If you would like to allow every users to use GCALDaemon, you may type 'sudo chmod 777 /usr/local/sbin/GCALDaemon'. First change the group ownership and set the rights.

cd /usr/local/sbin
sudo unzip /downloads/gcaldaemon-linux-1.x.zip

sudo chgrp -R admin /usr/local/sbin/GCALDaemon
sudo chmod -R g+w /usr/local/sbin/GCALDaemon
sudo chmod 755 /usr/local/sbin/GCALDaemon/bin/*.sh

Note: if you saved this ZIP to your Desktop, you should use 'sudo unzip /Users//Desktop/gcaldaemon-linux-1.x.zip' instead of 'sudo unzip /downloads/...' command.

4) Test your configuration with the 'password-encoder.sh' script.

cd /usr/local/sbin/GCALDaemon/bin
./password-encoder.sh

5) If you see something similar to the line above, your installation has succeeded.

Your Google password: _
6) Press ENTER to quit from the encoder. Then you should read the setup guides about the synchronization. If you use Apple iCal or an iCal-compatible PDA/Mobile synchronizer read the guide about the file-based synchronization. If you use Kontact, Mozilla Calendar, Sunbird or Lightning read the guide about the HTTP-based synchronization. Some calendar applications ignore time-zone properties. When your local time-zone settings are incorrect your events may be off by one or more hours. To resolve this effect, please verify that thetime-zones in your Google Calendar settings and in the OS / local calendar application are the same. If you have trouble with running, please read the next ('Install GCALDaemon into an arbitrary directory') chapter hereinafter, and verify the file paths in the config files.


  Install GCALDaemon into an arbitrary directory
1) Download the latest Linux-compatible ZIP file from SourceForge.net into your '/downloads' directory (or into your accustomed download directory).

2) Unzip the archive to your directory (for example '/Applications'). Change the group ownership and set the rights.

cd /Applications
sudo unzip /downloads/gcaldaemon-linux-1.x.zip

sudo chgrp -R admin /Applications/GCALDaemon
sudo chmod -R g+w /Applications/GCALDaemon
sudo chmod 755 /Applications/GCALDaemon/bin/*.sh

Note: if you saved this ZIP to your Desktop, you should use 'sudo unzip /Users//Desktop/gcaldaemon-linux-1.x.zip' instead of 'sudo unzip /downloads/...' command.

3) Setup finished - test your configuration.

cd /Applications/GCALDaemon/bin
./password-encoder.sh

4) If you see something similar to the line above, your installation has succeeded (go to point 9). If you have trouble with running, you must edit and replace some absolute file paths in the starter scripts (go to point 5).

Your Google password: _
5) Edit 'GCALDaemon/bin/password-encoder.sh' script. Replace '`dirname "$0"`/..' to '/Applications/GCALDaemon'.

#!/bin/sh
#
# Run the password encoder
#

GCALDIR=/Applications/GCALDaemon

java -cp $GCALDIR/lib/gcal-daemon.jar org.gcaldaemon.core.PasswordEncoder 


6) Set the GCALDIR variable in the 'GCALDaemon/bin/standalone-start.sh' service starter script.

#!/bin/sh
#
# Run GCALDaemon
#

GCALDIR=/Applications/GCALDaemon

java -cp
$GCALDIR/lib/commons-codec.jar:
$GCALDIR/lib/commons-lang.jar:
...
$GCALDIR/lib/jdom.jar org.gcaldaemon.standalone.Main
$GCALDIR/conf/gcal-daemon.cfg 


7) Set the GCALDIR variable in the 'GCALDaemon/bin/sync-now.sh' synchronizer script.

#!/bin/sh
#
# Run GCALDaemon once then quit
#

GCALDIR=/Applications/GCALDaemon

java -cp
$GCALDIR/lib/commons-codec.jar:
$GCALDIR/lib/commons-lang.jar:
...
$GCALDIR/lib/jdom.jar org.gcaldaemon.standalone.Main
$GCALDIR/conf/gcal-daemon.cfg
runonce 


8) Test the application with 'password-encoder.sh' script. If you see something similar to the messages above, your installation has succeeded.

Your Google password: _
9) Then you should read the setup guides about the synchronization. If you use Apple iCal or an iCal-compatible PDA/Mobile synchronizer read the guide about the file-basedsynchronization. If you use Kontact, Mozilla Calendar, Sunbird or Lightning read the guide about the HTTP-based synchronization. Some calendar applications ignore time-zone properties. When your local time-zone settings are incorrect your events may be off by one or more hours. To resolve this effect, please verify that the time-zones in your Google Calendar settings and in the OS / local calendar application are the same. GCALDaemon is designed to run as an 'invisible' Java service. Ideally it started with your OS each system boot (or user login), so you should configure your environment to launch GCALDaemon automatically using Lingon (see also in iCal guide). If you have trouble with the working, try to switch the application's log level to DEBUG, in 'GCALDaemon/conf/logger-config.cfg':

# Valid log levels: DEBUG, INFO, WARN, ERROR or FATAL
log4j.category.org.gcaldaemon=DEBUG

Then open 'log/gcal-daemon.log' file with your text editor. This log file helps you to identify bugs and configuration problems (e.g. 'Invalid credentials' error message means that the username/password you entered were invalid). If you still have trouble with installation, move on to http://sourceforge.net/forum/?group_id=184382 and please share your experiences with the rest of us. If you have feedback about current releases, this forum is the place to share them. Thank you!

Tuesday, June 14, 2011

Running Winbox in Snow Leopard

My everyday work are sometime using winbox to configure and manage routerboard device which running MikroTik OS, while using MacBook Pro, I need to prepare the environment since winbox are meant to be run on Windows environment. I can use either Darwine or wine package from macports, and I chose to use macports, since I'm more used to CLI environment.

All you need to do is:
1. choose the package according to Mac OS X version, download and install from here
2. for snow leopard (64-bit), you should install wine-devel instead of wine package, and add +universal
#  sudo port -v install wine-devel +universal

3. then you should be able to run winbox.exe from terminal
# /opt/local/bin/wine winbox.exe

4. you can also download this package, put it in your Applications and just double-click to run it

For complete references on other Mac OS X version, see here

Wednesday, June 8, 2011

Hardcoded .srt Subtitle Into A Video Files in Mac OS X

The situation is like this, I have a bunch of download movie (in .avi format) and .srt (subtitles) files along with all of those movie files. Since I don't have much time to watch the movies in my Mac/ PC or player, I want to keep it in my Palm Pre, so I can play it any moment I have some times (while waiting, perhaps). But since video player in Palm Pre doesn't support displaying .srt file while playing the video files, I have to convert it and hardcoded the .srt file so it could "attach" to the converted video files (.mp4 or .m4v, the same format that can be played in iPhone's or Palm Pre's video player).

Here's what you need:
1. Perian (go here to download and install if you haven't already installed it)
2. Quick Time (already installed in any Mac OS X)
3. .avi and .srt files (of course! :D )

And here's what you've got to do:
1. Install Perian
2. Go to System Preferences, open up the Perian and make sure you check "Load External Subtitles" on Subtitle Options section
3. Launch Quick Time and open up .avi file
4. If it plays well and your subtitle can show up then Perian works well
5. File - Save as.. and you can choose the directory where to save the file and file format



6. I choose iPhone format, so it saved as .m4v file
7. Done :)

Friday, May 27, 2011

Accesing #webOS Device via WiFi using SFTP Client

I'm using this because I'm tired of connecting USB cable everytime I want to copy files between my Palm Pre and my MacBookPro. Actually there's only 5 simple steps to follow:

  1. Install Preware
  2. Use Preware to install SFTP and terminal application
  3. Use terminal application to generate keys for OpenSSH
  4. Transfer SSH keys to desktop via USB
  5. Configure SFTP client (I'm using Cyberduck on Mac OS X) on desktop and connect
1. Install Preware
You can see here for complete reference

2. Using Preware to install SFTP and Terminal application
Still, you can refer to previous link for usage guide. FYI, I'm using SDL Terminal, other options is Terminal and Terminus

3. Use terminal application to generate keys for openSSH
I just did these steps:
# cd /
# /opt/bin/ssh-keygen (press Enter key once to accept default filename, then Enter key twice for blank password)
# mv /home/root/.ssh/id_rsa.pub /home/root/.ssh/authorized_keys

Or you can read from wiki here

4. Transfer SSH keys to desktop via USB
First, run this command:
# mv /home/root/.ssh/id_rsa /media/internal/

Then connect your Pre to your desktop station via USB cable, and put it in Drive mode. Copy and save id_rsa file you've just copied to any safe place in your desktop station

5. Configure SFTP client on desktop and connect
First,you need to know your IP address on your Pre. Open Wifi and tap on current Wifi connection (SSID) to view the IP address.
Then, open your SFTP client. Since I'm using Cyberduck, for now I'm just explaining about how to use it on Cyberduck only. But, actually the steps are very similar on any SFTP client. 
1. Click on Open Connection
2. Choose SFTP (SSH File Transfer Protocol).
3. Fill in username: root
4. Leave the password blank
5. More options -> check "Use Public Key Autentication"
6. Click Connect

Just wait and see :D

Sunday, May 22, 2011

Installing JRE1.5 on Snow Leopard

This JRE workaround was I did to make SPSS 17 runs well on Snow Leopard, in order to make things clearer, I divide those 2 things and put each of them on separate blog post. So let's get started! :)


Just follow this simple steps, and in the end you'll get JRE1.5 installed. Please keep in mind that this steps will not remove JRE1.6, but add the option to choose with JRE you'd like to use. First you can go to Finder -> Utilities -> Java Preferences, and check to make sure you only have Java SE 6 there (32-bit and 64-bit version). If you already have J2SE 5.0 (32-bit and 64-bit), just move 32-bit version to top of the list and you're done. No need to follow these steps below :D


1. Check your current version of JRE installed:
# java -version
2. change directory to home directory
# cd ~/
3. retrieve JRE version for Leopard (OS X 10.5.x)
# curl -o java.1.5.0-leopard.tar.gz http://www.cs.washington.edu/homes/isdal/snow_leopard_workaround/java.1.5.0-leopard.tar.gz
4. extract the file you just downloaded

# tar -xvzf java.1.5.0-leopard.tar.gz
5. remove existing 1.5 version file on Snow Leopard

# sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/1.5
6. remove existing 1.5.0 version file on Snow Leopard

# sudo rm /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
7. move current extracted JRE1.5 for Leopard to existing System directory

# sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard
8. make link from currently moved folder to previously removed file

# sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard /System/Library/Frameworks/JavaVM.framework/Versions/1.5
9. same usage as no. 8
# sudo ln -s /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0
And after you done with all 9 steps above, just go to Finder -> Utilities -> Java Preferences.



There you'll see additional J2SE 5.0 (32-bit and 64-bit), move J2SE 5.0 32-bit version to top of the list, close the preferences, then go back to Terminal apps to execute this command:
# java -version
Notice the differences? You'll now get the "java version 1.5.0_19" (in my MacBook Pro). And you're done :)