Sunday, September 30, 2012

Had a look at several methods to add binaries to shared servers. This one is the best I encountered.

Wednesday, November 9, 2011

Installing Ant on Mac OS X

I'm installing Ant to be available in Terminal. This way I can set up workflows to compile as3 projects with mxmlc.

This tutorial is useful for getting Ant installed, provided you have sudo privileges.

Thursday, September 8, 2011

Telnet LAN Primer

Dialog of a telnet session on the LAN.

The Nodes:
Ubuntu Linux Box
MacBook OS X

The Protocol:
Telnet from the TCP/IP suite

Network Addresses:
Ubuntu on static IP 192.168.1.xx
MacBook on DHCP, currently assigned to 192.168.1.101

Prerequisites:
Available default port of 23
Client must be running Telnet daemon
  1. Test port 23 on MacBook from Ubuntu Terminal window using nmap:

  2. jason@thecube:/etc/bind$ nmap -p 23 192.168.1.101
    Starting Nmap 5.21 ( http://nmap.org ) at 2011-09-08 16:04 EDT
    Nmap scan report for 192.168.1.101
    Host is up (0.084s latency).
    PORT   STATE  SERVICE
    23/tcp closed telnet
    
    Nmap done: 1 IP address (1 host up) scanned in 0.27 seconds

    Port is closed because no Telent service is running. Run Telnet service on Mac:

    macbook:sudo launchctl load -w /System/Library/LaunchDaemons/telnet.plist
    
    
    Scan again:

    jason@thecube~$ /etc/bind$ nmap -p 23 192.168.1.101
    
    Starting Nmap 5.21 ( http://nmap.org ) at 2011-09-08 16:15 EDT
    Nmap scan report for 192.168.1.101
    Host is up (0.052s latency).
    PORT   STATE SERVICE
    23/tcp open  telnet
    
    Nmap done: 1 IP address (1 host up) scanned in 0.24 seconds

    Prerequisites met.

  3. Establish telnet connection:

  4. jason@thecube:~$ telnet 192.168.1.101
    Trying 192.168.1.101...
    Connected to 192.168.1.101.
    Escape character is '^]'.
    
    Darwin/BSD (macbook.local) (ttys001)
    
    login:mylogin
    password:
    Last login: Wed Jul 27 21:54:24 on console
    
    
  5. Success. Logout. End telnet connection.

  6. macbook:sudo launchctl unload -w /System/Library/LaunchDaemons/telnet.plist
    
A final word: Best not to use telnet as the data sent is unencrypted. Consider instead using SSH on a nonstandard port for comprehensive security.

Wednesday, September 7, 2011

DNS on Ubuntu

I've been configuring DNS services under Linux to streamline my intranet browsing and addressing. In particular, I did this to resolve my intranet addresses sans IP so that I can e.g. type 'production' into Chrome and it takes me to my internal 192.168.1.xx address automagically. Then I can view the http output from my Ubuntu Apache box from a laptop across the room via domain name. Sometimes it's the little conveniences that count.

I thought I'd summarize the circumstances to do this procedure, as doing so organically takes some serious site hopping to synthesize the elements. It's not a particularly memorable mix, and it's as much for me as anyone else. A cheat sheet of sorts, and here are the broadly-defined tasks:
  1. Select a Linux box on your system to be a dedicated DNS server (I'll call it the DNSbox)
  2. Give DNSbox a static ip 
  3. apt-get install bind9 DNS service on DNSbox 
  4. configure bind9 on DNSbox 
  5. Divert DNS queries from router to DNSbox 
  6. Test using CLI utilities ( dig and nslookup ) as well as the bind9 log Hopefully that will get you through the woods.
Here in greater detail, the steps:
  1. I used a Ubuntu box set up as my intranet fileserver. As I begin to use more ultraportable and SSD devices, the fileserver will take on a greater storage role for my media and development files. The Ubuntu box is connected to my Linksys WRT45 (I'll call it the router), which in turn is served by my ISP. At the start of this procedure, the router had DNS IPs pointing to Comcast's DNS servers: 75,75,75,75 and 75,75,76,76.
     
  2. Give your Linux box a static ip. Edit /etc/network/interfaces, here is a good example of how to structure the interfaces text file. Chances are your network connection is eth0, so set inet static and give an address outside of the DHCP range on the router.
     
  3. Install bind9.
  4. Configure bind #1: Enable logging
    First thing is a real time saver, which is to enable bind to output logs. Syntax errors in your bind configuration files will cause it to fail silently. You can monitor this in the log.
    Add the following to the bind config file at /etc/bind/named.conf:

    logging {
            channel "logfile" {
                    file "/var/log/named/named.log" versions 5 size 5m;
                    print-time yes;
                    print-severity yes;
                    print-category yes;
            };
            category "default" { "logfile"; };
            category "general" { "logfile"; };
            category "update" { "logfile"; };
            category "queries" { "logfile"; };
    };
    

    Be sure that /var/log/named/named.log exists and is accessible by i.e. owned by bind. Test it with a quick:

    sudo /etc/init.d/bind9 restart

    Ensure you see stopped and started dialog in the log file. Keep plugging until you have success.

    Configure bind #2: Add DNS forwarders. Add this to /etc/bind/named.conf.options:
    options {
    ...
    forwarders {
    *Put auxiliary DNS IP 1 here*;
    ... 
    *Put auxiliary DNS IP n here*;
    };
    ...
    };
    
  5. Divert DNS queries from router to DNSbox #1
    Visit your router's web-based config and set DNS IP to the static IP of your DNSbox.

    Divert DNS queries #2
    Declare your nameserver on the DNSbox. Visit /etc/resolv.conf. I simply commented out (#) all lines and added:

    nameserver 192.168.1.xx   <- ( the static ip set in step 2 above )
    
    
  6. Test using CLI utilities dig and nslookup
Appendix A: Helpful Linux commands for DNS
sudo /etc/init.d/networking restart
sudo /etc/init.d/bind9 restart
nslookup
dig

Appendix B: Useful locations for DNS

# config files for use with bind
/etc/bind/named.conf
/etc/bind/named.conf.local
/etc/bind/named.conf.options # holds forwarders among others
/var/log/named/named.log # declared in named.conf

# config files for use with networking
/etc/resolv.conf 

Appendix C:

Monday, August 1, 2011

File Sharing Using AFP and Netatalk

Here's how things look at the Linux/Mac meet and greet:

Mac, may I introduce Linux.
Apple Filing Protocol, meet Netatalk.
Bonjour, this is Avahi.

They are, in short, Apple services and their open source counterparts.

My process of setting up an HTPC did not involve purchasing a mini mac, rather I repurposed my trusty and well-worn Cube PC as a newly reformatted 500GB Ubuntu 11.04 file server.

For seamless file serving, the UCube now utilizes Avahi and Netatalk to provide intersection to my LAN. When you gather crumbs of info to make your own similar setup, I recommend you use a succinct, updated guide such as Sidi Kahawa's. Though hundreds of responses exist on the older stalwart of this process, most of them have been fully addressed. It's close to turnkey at this point.

Friday, March 11, 2011

SVN on Eclipse using JavaHL

If you're finding that Subversion is not working with Eclipse due to an error such as:
unable to load default svn client
Visit Collabnet and download the latest Universal Subversion Binaries. I searched for a direct link to get software using the Eclipse software utility, but found nothing as useful as the repository on Collabnet. Unfortunately you have to register first, but it's a quick form.

After you install the binaries, you should be able to verify that JavaHL is working by visiting Eclipse>Preferences>Team>SVN, on the drop-down for SVN interface client.

Tuesday, March 1, 2011

References and Cloning examples

A very interesting example of the subtleties of cloning and referencing variables. Particularly noteworthy is the manner in which the references can be exploited to show ambiguous behavior. See the following example from php.net.

Object cloning with php5