Wednesday, November 30, 2022

Plot your locations from photos on a map

 First, get location data and save to CSV file as follows:

% exiftool -filename -DateTimeOriginal -gpslatitude -gpslongitude -gpsaltitude -csv -T -r -n <photosdirectory>    > output-all.csv

Where <photosdirectory> is the full path to the photos directory. This will produce a CSV file with location data of each photo, when available. Please note that for some photos exiftool fails to extract the GPS data (see https://exiftool.org/forum/index.php?topic=14228.0)

Then use GPS Visualizer site to plot the data into a map: https://www.gpsvisualizer.com/map_input?form=data
File upload limit is 10MB, so if your file is too heavy, delete path info etc. and leave only GPS long/lat data with file name for example. Remove also lines without long/lat data because the photo does not have it. Using GPS Visualizer you can output as image, Google Maps etc.


Another way is to import the CSV file to Google Maps' My Maps, but there is a limit of 2000 lines per import (per layer), and there is also a limit of layers. With over 50 thousands data for example from my photos, My Maps cannot be used. When using Google Maps' My Maps, you can split the CSV file into 2000 lines using split command on Mac:

% split -l 2000 --numeric-suffixes  output-all.csv file output-all-



Wednesday, July 6, 2022

Control Android from Mac

 Use scrcpy (https://github.com/Genymobile/scrcpy) to control Android from a Mac:

Installation on Mac:

    brew install scrcpy

Then,

    scrcpy

If there is error related to android.permission.MANAGE_APP_OPS_MODES, enable "disable permission monitoring" in developer options.

Saturday, November 21, 2020

Create subtitle for your YouTube video on MacOS

If your language is supported by automatic captioning by YouTube, you are OK. But if not, then you can create your own. 1) Basically, follow this "Creating translated subtitles with AI" article Follow the steps in this article: https://cloud.google.com/community/tutorials/speech2srt However, some parts of the code needs to be updated to be compatible with current Speech API: 1-1) enums is deprecated #encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16 encoding = speech_v1.RecognitionConfig.AudioEncoding.LINEAR16 #https://github.com/googleapis/python-speech/blob/master/UPGRADING.md#enums-and-types 1-2) long_running_recognize #operation = client.long_running_recognize(config, audio) operation = client.long_running_recognize(request={"config":config, "audio":audio}) #https://stackoverflow.com/questions/64287266/google-speech-to-text-jupyterlab-notebook-script-run-locally-using-google-cloud 1-3) nanos is deprecated #start_ms = int(w.start_time.nanos / 1000000) start_ms = int(w.start_time.microseconds / 1000000) #https://github.com/googleapis/python-speech/issues/71 #end_ms = int(w.end_time.nanos / 1000000) end_ms = int(w.end_time.microseconds / 1000000) #https://github.com/googleapis/python-speech/issues/71 2) Install ffmpeg for converting movie to audio file 3) Then you can execute the creation of SRT file to be uploaded to YouTube: 3-1) Download your video from YouTube Studio 3-2) Convert video to audio Uncompressed WAV is best for speech to text ffmpeg -i video.mp4 -ac 1 -ar 44100 audio.wav 3-3) Upload to Google bucket ../../../google-cloud-sdk/bin/gsutil cp audio.wav gs://$BUCKET_IN/ 3-4) Do speech to text python3 speech2srt.py --storage_uri gs://$BUCKET_IN/audio.wav --language_code id-ID --sample_rate_hertz 44100 --out_file audio 3-5) Upload audio.srt file to your YouTube video

Saturday, June 2, 2018

Turn PDF to text on Mac

To turn PDF to text on Mac, first install imagemagick using homebrew. Then install tesseract using homebrew. Download and put "eng.traineddata" into tessdata directory for English text.

Then run the following command:

convert -density 300 [input.pdf] -depth 8 -strip -background white -alpha off [output.tiff]
tesseract [input.tiff] [output] -c load_system_dawg=false -c language_model_penalty_non_freq_dict_word=0.1 -c language_model_penalty_non_dict_word=0.15 -c matcher_bad_match_pad=0.20


Tuesday, September 6, 2016


Gitinspector helps you analyze git activities from your repository.
Here is one of suggested options to use (using Terminal on Mac):

python gitinspector.py -Tlrw --format=htmlembedded --file-types="cs,js,asax,ascx,asmx,aspx,cshtml,fs" -x "/lib" >netisware2.html

Saturday, January 9, 2016

Rsync revisited (for Mac OS 10.10.5 Yosemite)

Get latest rsync from https://rsync.samba.org. Download also its patches, which now are in separate file. Patch.
patch -p1
patch -p1
patch -p1
Do configure and sudo make; make install
By default it will be installed to /usr/local/bin

Then execute rsync as follows:
sudo /usr/local/bin/rsync -aHxvuPESWANXN /src /dst --progress --dry-run

a equals -rlptgoD
N preserve createtimes
H preserve hardlinks
A preserve ACLs
X preserve xattr
x don't cross file system
v verbose
u skip files that are newer on the receiver

E preserve the file's executability
S handle sparse files efficiently
W copy files whole (without delta-xfer algorithm)

P equals --partial --progress, i.e., shows progress, and don't delete partially synced files when command is interrupted (to be resumed later)

Reference
http://www.lbackup.org/developer/rsync_hfs
https://discussions.apple.com/thread/6436787?start=0&tstart=0

Friday, July 10, 2015

As follow up to the entry about initial setting of Yamaha RTX on Mac, here is how to run tftp on Mac and do a firmware update:

First, start tftp server:
sudo launchctl load -w /System/Library/LaunchDaemons/tftp.plist

Then run these commands
tftp xxx.xxx.xxx.xxx (the IP address the router)
tftp> mode binary

tftp> put rtx1100.bin exec

Then stop tftp
sudo launchctl unload -w /System/Library/LaunchDaemons/tftp.plist

Thursday, June 11, 2015

How to build OpenVCS (Telepresence) on CentOS64

Use this OpenVCS:
http://code.google.com/p/openvcs/ (redirected to https://code.google.com/p/telepresence/?redir=1, version "last updated December 2014”). This version is said to be tested on CentOS64)

Build/install on VirtualBox

Get CentOS image
http://virtualboxes.org/images/centos/
(use CentOS 6.6 minimal x86_64, which is current version in December 2014)

Build and install according to https://code.google.com/p/telepresence/wiki/Support_BuildingSourceCode

OpenSSL is not built, because current version is valid

libogg, libvorbis and libtheora are not built, since they are optional.

libfaac make failed, and ffmpeg cannot be installed without this, so:
Remove line 126 from mpeg4ip.h then build (http://stackoverflow.com/questions/4320226/installing-faac-on-linux-getting-errors)

OpenAL Soft is not built, because it is optional (for 3D audio)

openOffice is optional and not built yet

When using WebRTC from Chrome connection cannot be made due to "WS handshaking not done yet” error, so modify tsip_transport_layer.c in doubango as follows (see https://code.google.com/p/telepresence/issues/detail?id=22)

Line 367:
                case event_accepted:
                case event_connected:
                        {
                                tsip_transport_stream_peer_t* peer;
                                // find peer
                                if((peer = tsip_transport_find_stream_peer_by_local_fd(transport, e->local_fd))){
                                        // If peer already exists.. do nothing :0
                                        return  0;
                                }
                                else {
                                        TSK_DEBUG_INFO("WebSocket Peer accepted/connected with fd = %d", e->local_fd);
                                        return tsip_transport_add_stream_peer(transport, e->local_fd, transport->type, tsk_true);
                                }
                        }

Doubango needs SSL to be enabled during built, otherwise, WebRTC will be connected but ended in "not acceptable”, and telepresence log will show "Remote party requesting DTLS but it is not enabled” error (see https://code.google.com/p/doubango/wiki/Building_Source_v2_0)
OpenSSL is pre-installed on CentOS but Doubango needs header files, so install openssl-devel first:
sudo yum install openssl-devel 

Then configure doubango with SSL:
./autogen.sh && ./configure --with-ssl --with-srtp --with-speexdsp --with-ffmpeg
and then build doubango.

SSL certificate (self-signed is OK) needs to be created:
https://code.google.com/p/telepresence/wiki/Configuration_Security
So, set SSL certificate:
ssh-keygen -b 1024 -f root -t dsa
Then point setting at /usr/local/sbin/telepresence.cfg to locations of pem files created above.

Telepresence make will fail with undefined reference at libtinySAK, so edit Makefile, change this LDFLAGS line:
LDFLAGS= -L/opt/openoffice4/sdk/lib
to:
LDFLAGS= -L/opt/openoffice4/sdk/lib -WI,-rpath,/usr/lib -ldl
(see http://sourceforge.net/p/cppunit/bugs/201/)

Remove openssl-devel to prevent problems with dual installation of openssl:
sudo yum remove openssl-devel

Make sure iptables is disabled to allow connections:
sudo /etc/init.d/iptables stop
(To turn off firewall on boot, do this:
chkconfig iptables off)

Edit transport configuration entry at /usr/local/sbin/telepresence.cfg, better add ip address instead of leaving the asterisks because it seems to get 0.0.0.0 as IP address, and uncomment all transport configuration entries (see https://code.google.com/p/telepresence/wiki/Support_Testing_the_system)

Start telepresence (if —config is not specified, it does not seem to use the cfg file provided by “make samples”):
telepresence —config=/usr/local/sbin/telepresence.cfg
Then log data will be shown.

Test using WebRTC. https://code.google.com/p/telepresence/wiki/Support_Testing_the_system). Access http://conf-call.org, go to settings, set the IP address of telepresence, then call.

Tuesday, December 30, 2014

Set different language/locale to certain app on Mac

Just because my Mac default language is Japanese does not mean I like all apps to be Japanese language, especially when it is incomplete or roughly translated one. An example is Gramps.

This is how to set the language/locale to English:

$ defaults write -app Gramps AppleLanguages "(en, jp)"
$ defaults write -app Gramps AppleLocale "en_US"
$ defaults write -app Gramps AppleCollationOrder "en"

Voila, now the ugly Japanese interface is gone for the app.

Monday, December 29, 2014

Time Machine using NAS on Mavericks

Just typing this on Terminal.app does not seem to work anymore.

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

So here is how I made it to work on Mavericks.

1. Execute the usual command above:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

2. Create image file on local disk first because creating directly on NAS will fail
The image file naming seems important: name it [hostname]_[MACaddress] (the MAC address is without colons). So if the Mac's hostname is "mbp" and its MAC address is 12:34:56:78:9a:bc, then the file name will be mbp_123456789abc
You can check the hostname from Sharing settings.
Create the image as hard disk and of type sparse bundle. The size can be set anything, e.g., 100MB. Set volume name to arbitrary name, for example TimeMachine.

3. Copy the image file to NAS and expand it to the size you need for Time Machine, for example 300GB. Turn off Time Machine first because resizing seems to be always reset by Time Machine when it is on.
Use Disk Utilities to resize, or use hdutil from Terminal:
hdiutil resize -size 300g /Volumes/Backup/mbp_123456789abc.sparsebundle

4. Mount the image and initialize
Mount the image and initialize. The mount point, for example /Volumes/TimeMahine.

5. Set the volume as Time Machine destination
Now at this point even if you open Time Machine settings the volume won't show up. You have to set it from Terminal:
sudo tmutil setdestination /Volumes/TimeMachine

6. You are ready to start backing up using Time Machine!

Reference

Thursday, September 18, 2014

d3 uses createWindow but latest jsdom removed it?

I was trying to use d3 with node.js. It seems that d3.js uses createWindow but latest jsdom removed it, so it gave error like:
 "Object [ null ] has no method 'createWindow' d3"
In jsdom's changelog it was mentioned that jsdom.createWindow was among removed jsdom APIs in version 1.0.0-pre.1. BTW, latest version of jsdom as of this writing is 1.0.0-pre.6, so a default installation of jsdom via "npm install jsdom" will not contain support for createWindow.
Hence, it seems that to run d3.js, older jsdom must be used, i.e., version 0.11.1 which is the latest version before 1.0.0-pre.1:
sudo npm remove jsdom 
sudo npm install jsdom@0.11.1

Monday, September 15, 2014

Analyzing contribution level to a git repository

I wondered if there is a handy tool for analyzing contribution level to a git repository, and found this: gitinspector and gitstats.

gitinspector
Once you got python installed, you can fire it with command like this:
./gitinspector.py -wTHl --format=htmlembedded --file-types=cs,cshtml,js,css  /path/to/git/repo/ >/path/to/resultdir/result.html

This will produce an HTML report
More options can be found here.

gitstats
If python is ready, on Mac another install is necessary, i.e., gnuplot. The easiest way is to use MacPorts to install it, by simply doing "sudo port install gnuplot".
Then run gitstats with command like this:

./gitstats /path/to/git/repo/ /path/to/resultdir/result

Thursday, February 13, 2014

Force installing apps to SD Card on Android

It was about time for me to actually use the lowly Android smartphone I bought about a year ago, i.e., the LG. Then I started to install Skype, Whatsapp, Line, and some other must-have apps, only to find out that many failed to install because I got no space :O

Yeah, the handset has only like 100MB or so space, but I got 1GB on SD Card, why can't I install the apps directly to it? The answer is, I simply can't. Stuck. Now I understand why Android is just about numbers, not usability. Its marketshare can be no.1 in the world of smartphones, but a very large percentage of it is probably junk.

So what, am I going to give this up as junk?

Luckily, though not for the faint of heart, with the debugger in Android SDK, it can be set to install app to SD Card by default.

On Mac, install Android SDK, open terminal, connect the Android device which is already set to USB debugging mode, go to the directory where Platform Tools are, then type:

adb devices

It should show the device ID-like data.

Then type the following to start the shell:

adb shell

Then finally set default installation destination to SD Card:

pm set-install-location 2 

Voila, now I can install the apps from Google Play, and it will install to SD Card. After installation, set it back to up to system:

pm set-install-location 0

Reference:
http://techgage.com/article/moving_your_non-movable_android_apps_to_an_sd_card/

Thursday, January 9, 2014

git commands for svn users


git commands for svn users:
http://blog.cyclogy.com/2011/05/05/git_subversion/

Well, actually I just wanted to know how to make my local repo up to date and at the same time disposing any changes on local repo, and here is the git command for it:

git clean -d -x -f
This will remove untracked files, including directories (-d) and files ignored by git (-x). Replace the -f argument with -n to perform a dry-run or -i for interactive mode and it will tell you what will be removed.

Sunday, December 29, 2013

Write and display Batak script on Mac


Batak font used to be just another ASCII font with Batak script rendering. But it got place in Unicode and it is a "real" font now. Download it from Uli Kozok's site.

After you installed the font, you will be able to see this in Batak script: á¯‚ᯬᯒᯀ᯲
You will also see Batak script on sites like this: http://www.alanwood.net/unicode/batak.html

Now that it is a real font, typing on ASCII keyboard won't work anymore. A special keyboard mapping is necessary. For Mac, get the keyboard mapping from this Michael Everson's site.

Installing a Batak keyboard layout on the Mac OS:

1) Download the Mac OS Batak keyboard layout package. (The files are inside the folder “Batak-Mac-Keylayout”, which is compressed in .zip format.)
2) Install the keyboard layout by dragging it (the .keylayout and the .icns files, not their enclosing folder) to ~/Library/Keyboard Layouts.
3) To use a keyboard layout, activate it at System Preferences > International > Input Menu.


Saturday, April 13, 2013

Using exiftool to rename pictures from digital camera

Lots of pictures taken with digital camera (including the ones in smartphones)... so I need a way to at least easily identify when a particular picture is taken, and exiftool comes in handy.

First, create a file named .ExifTool_config at user's root directory containing something like the following:


%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Composite' => {
        MyModel => {
            Require => 'Model',
            # translate spaces to underscores
            ValueConv => '$val =~ s/Canon DIGITAL IXUS v2/IXUSV2/; $val =~ s/KODAK DX4330 DIGITAL CAMERA/DX4330/; $val =~ s/C860L,D360L/C860L/; $val =~ s/Canon IXY DIGITAL 320/IXY320/; $val =~ s/ |-//; $val =~ s/(.*)/uc($1)/e; $val',
        },
        MyMake => {
            Require => 'Make',
            # translate spaces to underscores
            ValueConv => '$val =~ s/EASTMAN KODAK COMPANY/KODAK/; $val =~ s/OLYMPUS OPTICAL CO.,LTD/OLYMPUS/; $val =~ s/CASIO COMPUTER CO.,LTD/CASIO/; $val =~ s/ |-//; $val =~ s/(.*)/uc($1)/e; $val',
},

    },
);
1;  #end

Then run the following command:


exiftool -d %Y%m%d-%H%M%S '-FileName<${CreateDate}-${mymake}${mymodel}.%e'

File names of images files on will become like the following:

20040228-133116-CASIOEXS20.jpg

Use "c" to add counter, like below:

exiftool '-FileName<${DateTimeOriginal}_$Model.%e' -d %Y-%m-%d_%H-%M-%S%%-.c 

Rerences:
http://www.sno.phy.queensu.ca/~phil/exiftool/
http://www.sno.phy.queensu.ca/~phil/exiftool/faq.html#Q11


Monday, February 18, 2013

Metadata for image file

How many standards are there for embedding metadata into image files?

We usually hear Exif, IPTC and XMP, but when we mean standards related to metadata, it turns out to be more complex. There are Exif, DCF, IPTC-IIM, XMP (a.k.a IPTC Core), and FlashPix. Some standards are not just about metadata, but also among others how to save image files on digital camera.

Here are some standards that I found out so far:
Exif 1 (standardized by JEIDA)
Exif 2 (standardized by JEITA in 1997) *JEIDA changed name to JEITA
Exif 2.1 (standardized by JEITA in 1998)

DCF JEITA in 1999) *This is Exif 2.1+CIFF

Exif 2.2 (standardized by JEITA in 2002)
Exif 2.3 (standardized by JEITA+CIPA in 2010)
FlashPix
IPTC-IIM (standardized by IPTC in 1994) *descriptive metadata only, for JPEG only, largely superseded by XMP

XMP  any file 2001 (standardized by Adobe in 2001) *a.k.a. IPTC Core

Links to standards:
IPTC (Information Interchange Model (IIM))
http://en.wikipedia.org/wiki/IPTC_Information_Interchange_Model
XMP
http://en.wikipedia.org/wiki/Extensible_Metadata_Platform
Exif
http://en.wikipedia.org/wiki/Exchangeable_image_file_format
Design rule for Camera File system
http://en.wikipedia.org/wiki/Design_rule_for_Camera_File_system

References:
http://en.wikipedia.org/wiki/Exchangeable_image_file_format#FlashPix_extensions
http://gcoupe.wordpress.com/2011/12/10/picasa-versus-windows-live-photo-gallery/
http://www.controlledvocabulary.com/blog/top-metadata-myths.html

Friday, August 3, 2012

JSON to Google Docs for Trello

I want to have all Trello data into a Google Docs sheet.
So I wrote this (and with copying snippets from here and there):


// Arnold P. Siboro
// August 2012

   
function myFunction() {
  //blabla
  throw 'Congratulations, you have successfully installed XXX ';
}
function onOpen() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var lastRow = sheet.getLastRow();
  //sheet.setActiveCell()
 
  //var object = getJSONdata();
  var object = getTrelloJSONdata();
 
  sheet.clear();

 
  for (var i=0; i    sheet.getRange(i+1,1).setValue(object.cards[i].name);
    sheet.getRange(i+1,2).setValue(object.cards[i].desc);
    //throw object.checklists.length;

  checklists="";
  checkItems="";
    for (var j=0; j     
      //throw object.cards[i].idChecklists.length;
      for (var k=0; k     
        if(object.checklists[j].id==object.cards[i].idChecklists[k]) {
          //throw object.checklists[j].name+" "+object.checklists[j].id+" "+object.cards[i].idChecklists[k];
          checklists=checklists + "["+object.checklists[j].name +"]\n";
          //throw checklists;
          //throw object.checklists[j].checkItems.length;
          for (var l=0; l            checklists=checklists+(l+1)+") "+object.checklists[j].checkItems[l].name+"\n";
          }
          checklists=checklists+"\n";
        }
      }
      //throw checklists;
    }
    sheet.getRange(i+1,3).setValue(checklists);
    //throw object.lists.length;
   
    lists="";
    for (var j=0; j      if(object.lists[j].id==object.cards[i].idList) {
        lists=lists + object.lists[j].name + "\n";
        //throw lists;
      }
      //throw lists;
    }
    sheet.getRange(i+1,4).setValue(lists);

    actions="";
    for (var j=0; j      if(object.actions[j].data.card)
        if(object.actions[j].data.card.idShort==object.cards[i].idShort) {
          if(object.actions[j].type="commentCard" && object.actions[j].data.text) actions=actions + object.actions[j].data.text + "\n";
        //throw actions;
        }
      //throw actions;
    }
    sheet.getRange(i+1,5).setValue(actions);
   
  }
 //throw object.cards.toSource();
 //throw object.cards.length;

}

//not used now, as this does not handle login into Trello
function getJSONdata() {
  var url = SERVER_BASE_URL
  var payload = "";
  var response = UrlFetchApp.fetch(url, {method:'get', payload:payload, contentType:"application/x-www-form-urlencoded"});
  if (response.getResponseCode() == 200) {
    return JSON.parse(response.getContentText());
   
  }
}
function getTrelloJSONdata() {
  //Use OAuth and Trello's API to automatically login

     
    var oauthConfig = UrlFetchApp.addOAuthService("trello");
  oauthConfig.setAccessTokenUrl("https://trello.com/1/OAuthGetAccessToken");
  oauthConfig.setRequestTokenUrl("https://trello.com/1/OAuthGetRequestToken");
  oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken");
  // Replace these with the values you get from
  // https://trello.com/1/appKey/generate
  oauthConfig.setConsumerKey("");
  oauthConfig.setConsumerSecret("");
  var requestData = {
    "method": "GET",
    "oAuthServiceName": "trello",
    "oAuthUseToken": "always"
  };
  /*
  var result = UrlFetchApp.fetch(
      "https://api.trello.com/1/members/me/boards",
      requestData);
  */
 
  //And then get the whole JSON data
   var result = UrlFetchApp.fetch(
  "https://api.trello.com/1/boards/?actions=all&actions_limit=1000&cards=all&lists=all&members=all&member_fields=all&checklists=all&fields=all",
      requestData);
 
  //throw result.getContentText();
  return JSON.parse(result.getContentText());
}

function authorizeToTrello() {
  var oauthConfig = UrlFetchApp.addOAuthService("trello");
  oauthConfig.setAccessTokenUrl("https://trello.com/1/OAuthGetAccessToken");
  oauthConfig.setRequestTokenUrl("https://trello.com/1/OAuthGetRequestToken");
  oauthConfig.setAuthorizationUrl("https://trello.com/1/OAuthAuthorizeToken");
  // Replace these with the values you get from
  // https://trello.com/1/appKey/generate
  oauthConfig.setConsumerKey("");
  oauthConfig.setConsumerSecret("");
  var requestData = {
    "method": "GET",
    "oAuthServiceName": "trello",
    "oAuthUseToken": "always"
  };
  var result = UrlFetchApp.fetch(
      "https://api.trello.com/1/members/me/boards",
      requestData);
  Logger.log(result.getContentText());
}

Tuesday, June 12, 2012

Cloud backup solution

Google Drive is released. So which is best, Google Drive, Dropbox, SkyDrive, etc? As I previously wrote, my interest is in having a backup solution that exactly backups files from Mac, including its data forks, extra attributes, finder flags etc.
So, it's time to take bbouncer out of the shelf again. Google Drive is said to be not preserving all of the above nooks and crannies of Mac file system, so I tried with Dropbox first, which was mentiond on Google searchland as faithful to Mac file system. I mounted the Dropbox drive (actually it is not a drive, just a directory), and then ran the following command to copy bbouncer's test files:

sudo rsync -aNHAXxvuPE --fileflags --protect-args --force-change  /Volumes/Src/   /Users/asiboro/Downloads/Dst

I then ran bbouncer to do the test:

./bbouncer verify -d /Volumes/Src/ ~asiboro/Downloads/Dst/

The result is as follows:

Verifying:    basic-permissions ... ok (Critical)
Verifying:           timestamps ... ok (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... ok
Verifying:            hardlinks ... ok (Important)
Verifying:       resource-forks ...
grep: ./some-file/rsrc: Not a directory
   Sub-test:             on files ... FAIL (Critical)
cmp: ./hl-rfork1/rsrc: Not a directory
   Sub-test:  on hardlinked files ... FAIL (Important)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... ok
Verifying:        creation-date ... ok
Verifying:            bsd-flags ... ok
Verifying:       extended-attrs ...
   Sub-test:             on files ... ok (Important)
   Sub-test:       on directories ... ok (Important)
   Sub-test:          on symlinks ... ok
Verifying: access-control-lists ...
   Sub-test:             on files ... ok (Important)
   Sub-test:              on dirs ... ok (Important)
Verifying:                 fifo ... ok
Verifying:              devices ... ok
Verifying:          combo-tests ...
   Sub-test:  xattrs + rsrc forks ... ok
   Sub-test:     lots of metadata ... ok 
Ouch.. resource fork related test failed.
I tried copying not to Dropbox but regular directory on disk, the result is the same. OK, something fishy here. After some searching, I found out that the resource fork is there, only that it is not on /rsrc but /..namedfork/rsrc. I am running Mac OS X Lion, and it seems that /rsrc is deprecated and it won't work anymore.

So, I edited test.d/30-resource-forks.test from bbouncer distribution and change all /rsrc to /..namedfork/rsrc, ran the test again and now here is the result:

Verifying:    basic-permissions ... ok (Critical)
Verifying:           timestamps ... ok (Critical)
Verifying:             symlinks ... ok (Critical)
Verifying:    symlink-ownership ... ok 
Verifying:            hardlinks ... ok (Important)
Verifying:       resource-forks ... 
   Sub-test:             on files ... ok (Critical)
   Sub-test:  on hardlinked filez ... ok (Important)
Verifying:         finder-flags ... ok (Critical)
Verifying:         finder-locks ... ok 
Verifying:        creation-date ... ok 
Verifying:            bsd-flags ... ok 
Verifying:       extended-attrs ... 
   Sub-test:             on files ... ok (Important)
   Sub-test:       on directories ... ok (Important)
   Sub-test:          on symlinks ... ok 
Verifying: access-control-lists ... 
   Sub-test:             on files ... ok (Important)
   Sub-test:              on dirs ... ok (Important)
Verifying:                 fifo ... ok 
Verifying:              devices ... ok 
Verifying:          combo-tests ... 
   Sub-test:  xattrs + rsrc forks ... ok 
   Sub-test:     lots of metadata ... ok 

Cool.

But not yet. I just realized that I was just running the test against Dropbox directory on this Mac. It's not a volume, so it is probably just like any regular directory except that Dropbox is syncing it with the server...

Sunday, April 1, 2012

In search of RARP server for MacOS

OK, I did not actually find a working RARP server solution on MacOS X, but I found a solution for setting that Yamaha RTX. It turned out that it does not have an IPv4 by default, but it has an IPv6 by default.

Connect the Mac directly to Yamaha RTX, make sure IPv6 is enabled on the Mac. Then from terminal:

netstat -nr

You will get a IPv6 section like this:


Internet6:
Destination                             Gateway                         Flags         Netif Expire
::1                                     ::1                             UH              lo0
fe80::%lo0/64                           fe80::1%lo0                     Uc              lo0
fe80::1%lo0                             link#1                          UHL             lo0
fe80::2a0:deff:fe32:234d%en0            0:a0:de:32:23:4d                UHL             en0
fe80::ca2a:14ff:fe0f:4f25%en0           c8:2a:14:f:4f:25                UHL             lo0
ff01::/32                               ::1                             Um              lo0
ff02::/32                               ::1                             UmC             lo0
ff02::/32                               link#4                          UmC             en0

"0:a0:de:32:23:4d" is the MAC address of the Yamaha RTX, so just telnet to fe80::2a0:deff:fe32:234d%en0

telnet -6 fe80::2a0:deff:fe30:344d%en0

I am relieved I can do away with that rarpd.exe and Windows 2000!

But rarpd on Mac is still a mystery to be solved. On Ubuntu and CentOS it seems to work out of the box.

UPDATE
I forgot why I wrote the above, because it... did not work? I just found out Yamaha RTX's IPv6 address by first pinging to multicast address and see response from an IPv6 address other than the ones belong to my host (check the host's interfaces via the OS, or do "netstat -nr" and see the result, as follows:


ping6 -I en1 ff02::2
PING6(56=40+8+8 bytes) fe80::e2f8:47ff:fe12:d56c%en1 --> ff02::2
16 bytes from fe80::225:dcff:fe14:5a26%en1, icmp_seq=0 hlim=64 time=10.231 ms
^C
--- ff02::2 ping6 statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 10.231/10.231/10.231/0.000 ms