November 18, 2013

Open URL from Sublime Text

I keep a lot of text files to track progress/notes on projects with a lot of URLs.  For some notes, it has too many URLs and it became a hassle to copy&paste in a browser to check the page.  I found this handy tool for the purpose:
https://github.com/noahcoad/open-url

I tried on Mac and Windows -- and it works quite well. 

The installation steps are straight forward and well explained -- but I'm just entering the steps here as a note to myself.  You'll need GIT client for your OS to follow below step.

For Windows:
  1. Open Sublime Text
  2. Press CTRL+`
  3. Copy and paste (for Sublime Text 2) this (see https://sublime.wbond.net/installation#st2):
    import urllib2,os; pf='Package Control.sublime-package'; ipp = sublime.installed_packages_path(); os.makedirs( ipp ) if not os.path.exists(ipp) else None; urllib2.install_opener( urllib2.build_opener( urllib2.ProxyHandler( ))); open( os.path.join( ipp, pf), 'wb' ).write( urllib2.urlopen( 'http://sublime.wbond.net/' +pf.replace( ' ','%20' )).read()); print( 'Please restart Sublime Text to finish installation')
  4. Restart Sublime Test
  5. Select from menu, Preferences -> Browser Packages.  This will open a folder -- for my case, it is "C:\Users\kkim\AppData\Roaming\Sublime Text 2\Packages"
  6. Open cmd in that folder (or move to that directory)
  7. Run git command (see the above open-url github page):
    git clone --branch st2 https://github.com/noahcoad/open-url.git
  8. Restart Sublime Text.
Use CTRL-u or ALT-double click on URL in text file to open the web page using default browser.

November 16, 2013

Trying ApacheDS

I only had a few times to use LDAP in the past, and now I need to explore some of the features in ApacheDS.  I'm putting some notes here on installation and using it.  The environment used here is CentOS for server, Windows 7 for client, both are 64 bits.

There are mainly two open source LDAP servers:
ApacheDS
OpenLDAP

For installing Apahce DS on CentOS, download RPM from here:
https://directory.apache.org/apacheds/download/download-linux-rpm.html

Below is install/setup process:




-bash (1025) $ rpm -qpl apacheds-2.0.0-M15-x86_64.rpm
/etc/init.d/apacheds-2.0.0_M15-default
/opt/apacheds-2.0.0_M15
/opt/apacheds-2.0.0_M15/LICENSE
/opt/apacheds-2.0.0_M15/NOTICE
/opt/apacheds-2.0.0_M15/bin
/opt/apacheds-2.0.0_M15/bin/apacheds
/opt/apacheds-2.0.0_M15/bin/wrapper
/opt/apacheds-2.0.0_M15/conf
/opt/apacheds-2.0.0_M15/conf/wrapper.conf
/opt/apacheds-2.0.0_M15/lib
/opt/apacheds-2.0.0_M15/lib/apacheds-service-2.0.0-M15.jar
/opt/apacheds-2.0.0_M15/lib/apacheds-wrapper-2.0.0-M15.jar
/opt/apacheds-2.0.0_M15/lib/libwrapper.so
/opt/apacheds-2.0.0_M15/lib/wrapper-3.2.3.jar
/var/lib/apacheds-2.0.0_M15
/var/lib/apacheds-2.0.0_M15/default
/var/lib/apacheds-2.0.0_M15/default/conf
/var/lib/apacheds-2.0.0_M15/default/conf/config.ldif
/var/lib/apacheds-2.0.0_M15/default/conf/log4j.properties
/var/lib/apacheds-2.0.0_M15/default/conf/wrapper.conf
/var/lib/apacheds-2.0.0_M15/default/log
/var/lib/apacheds-2.0.0_M15/default/partitions
/var/lib/apacheds-2.0.0_M15/default/run 
 
sudo ln -s /etc/init.d/apacheds-2.0.0_M15-default /etc/init.d/apacheds 
sudo chkconfig apacheds on
sudo service apacheds start

ApacheDS failed to start. In the log file, it showed that it can't locate java executable.  Modify /opt/apacheds-2.0.0_M15/conf/wrapper.conf
to set 'wrapper.java.command' :

# Path to java executable
wrapper.java.command=/opt/java/bin/java

And use LDAP client to connect to port 10389, no authentication.  LDAP instance files are located at: /var/lib/apacheds-2.0.0_M15/

 LDAP client software

Microsoft Active Directory Explorer
Apache Directory Studio
LDAP Admin
JXplorer

Since I'm using ApacheDS, I want to try Apache Directory Studio here. Here is the screenshot from the site:



If you use this software and just want to test LDAP locally, there is no need to install separeate ApacheDS.  Studio comes with ApacheDS, and you can set up local LDAP servers.

Some readings

MS Strategy for Lightweight Directory Access Protocol (LDAP)



November 1, 2013