Newsyland Blog tail -f /dev/brain >> blog.newsyland.com

21Nov/073

Leopard Broke SMB Tunnel Mounting via Finder

In Mac OS X 10.4 Tiger, you could use Finder (GUI) to mount an SMB mount which was being tunneled through ssh
For example:

  • From Terminal establish the tunnel:

    ssh -L 139:remote_machine:139 user@remote_machine

  • Then, in Finder, Go ? Connect to Server...
  • In "Server Address", smb://localhost/mountpoint

However, this doesn't work in Mac OS X 10.5 Leopard anymore!
The workaround is instead of using Finder, to use the mount_smbfs command in Terminal:

mount_smbfs //samba_user_name@localhost/samba_share /local/mount/point/

For example:
After establishing the tunnel (see above), I first made a mount point:

cd ~; mkdir sambamount

Then mounted it:

mount_smbfs //samba_user_name@localhost/data ~/sambamount

Once mounted, you should see the volume appear on your desktop, and you can drag it to the trash (or use 'umount') to unmount it.

**** UPDATE 25 Mar, 2009 ****

I'm getting many hits for this post, so I'm adding a little more detail for my setup specifically.

My work blocks almost all ports to incoming traffic. In order to log into a machine from the outside (for example from my home computer) I must first ssh into a firewall computer and setup a tunnel, or can ssh or telnet to another computer (you can do nothing on the firewall computer except ssh or telnet).

So, here's my setup for tunnelling the SMB traffic within a ssh session (and still mount via Finder):

home <-ssh/tunnel-> firewall.example.com <-smb traffic-> smb_server.example.com

My work account credentials are the same on both the firewall computer and the SMB server.

You can add your modified version of the following to the file '/Users/mac_username/.ssh/config':

#------------------------------------------------------
# For mounting smb shares locally from home:
#-- This is the name of this alias to this specific
#  configuration:
Host smb_tunnel_from_home

#-- Work's firewall computer (can also use IP number here)
Hostname firewall.example.com

#-- In place of 'work_username', your firewall username goes
#  here:
User work_username

#-- 127.0.0.2 is your computer, the second (where there are
#  x's) is the SMB server. Seems like I have to use the IP
#  number (instead of smb_server.example.com for this!):
LocalForward 127.0.0.2:139 xxx.xxx.xxx.xxx:139
LocalForward 127.0.0.2:445 xxx.xxx.xxx.xxx:445

#------ TO USE: ------
#--Using Terminal, at the prompt type (this creates an alias
#  of 127.0.0.1 at 127.0.0.2):
#    sudo ifconfig lo0 alias 127.0.0.2 up
#--Now start the ssh session:
#    sudo ssh work_username@smb_tunnel_from_home \
#    -F /Users/mac_username/.ssh/config
#--Then, in finder, Go->Connect to Server (Cmd-K), in the
#  box type:
#       smb://127.0.0.2/work_username
#--In the box which pops up, enter your work_username
#  and work_password.
#--Be sure to unmount the volume in finder when done using.
#------------------------------------------------------

Filed under: Mac OS X 3 Comments
16Nov/070

Updated X11 for Leopard

There are a few complaints and bugs with the X11.app which shipped with Leopard Mac OS X 10.5.0. You can download and install updates from x.org which incorporate many fixes. Works great. Also, you can get Darwin 9.0 source code.

Filed under: Mac OS X No Comments
15Nov/070

Give a real gift this year

It's coming up to that time of the year (Christmas) when most people buy gifts for friends and family, but I've found it much more rewarding to give to those who really need a helping hand. One place which comes in handy in helping me to evaluate an organization is
Charity Navigator (abbreviated CN below).

Here's my list in decending order of importance or amount given for the last few years:

  • Kiva:
    They are one of the only peer-to-peer Microfinance gateways. They use the power of the internet to facilitate microlending, which allows YOU to participate in microfinance with as little as a $25 loan (credit card via PayPal) . Your loans go out to people who desperately need the money, and you'll get your money back from them in usually 9-16 months. They currently have a repayment rate of near 100%. So, want to have a direct affect on someone's life, and it won't cost you anything but a temporary loan? Donation page of Kirk Ireson.
  • Donors Choose (CN):
    Their mission is summed up well in their tagline: "Teachers ask. You choose. Students Learn." Unfortunately many of US school systems are drastically underfunded. This organization gives you a chance to help change that by supporting a specific project a teacher proposes. Good karma.
  • International Rescue Committee (IRC) (CN):
    According to 60 Minutes, one of the few organizations helping out in Darfur, and they assist millions of refugees in 25 other countries as well.
  • Natural Resources Defence Council (NRDC) (CN):
    One of the US's most effective environmental action groups. They use law, science and the support of 1.2 million members to protect the planet's wildlife and wild places.
  • Environmental Defense Action Fund (EDAF) (CN):
    Similar to the NRDC, they start with rigorous science, then work directly with businesses, government and communities to create lasting solutions to the most serious environmental problems.
  • Medecins Sans Frontieres / Doctors without Borders (CN):
    An important international medical humanitarian organization that delivers emergency aid to people affected by armed conflict, epidemics, natural or man-made disasters in more than 70 countries.
  • Union of Concerned Scientists (UCS) (CN):
    A leading science-based nonprofit working for a healthy environment and a safer world by combining independent scientific research and citizen action to develop innovative, practical solutions and to secure responsible changes in government policy, corporate practices, and consumer choices.
  • AmeriCares (CN):
    An international relief organization whose passion to help is matched by an ability to deliver; whether it's an epic disaster or a daily struggle, they go to extraordinary lengths to ensure that medicines, medical supplies and aid reach individuals in need.
  • Gifts in Kind (CN):
    The eighth-largest charity in America receives donations from thousands of large and small companies then distributes the donations to more than 150,000 community charities across the United States and throughout the world.
  • First Book (CN):
    A non-profit with a single mission: to give children from low-income families the opportunity to read and own their first new books.
  • Carter Center (CN):
    Is committed to advancing human rights and alleviating unnecessary human suffering by waging peace, fighting disease, and building hope.
  • Seacology (CN):
    With a sole and unique purpose; preserve the environments and cultures of island nations.
  • Heart to Heart International (CN):
    A leading humanitarian organization which spends 99.1% of your money to work to improve health and respond to the needs of disaster victims worldwide.
  • There is always supporting your favorite open source project! In the past, I've given to Electronic Frontier Foundation (EFF), Wikimedia, Firefox extensions, python.org, and several which are hosted at sourceforge.net.

Filed under: Charity No Comments
15Nov/070

Matlab 2007b on Leopard Bug

Mathworks Matlab version 2007b in Mac OS X 10.5 Leopard has a scrolling bug where the desktop GUI is sluggish and scrolls slowly. There is a bug fix posted at the Mathworks website, bug #412219, (login required).   It's due to a different default Java Graphics2D rendering engine used by OS X 10.5 (Sun2D), where OS X 10.4 used Quartz2D.

Filed under: Mac OS X, Matlab No Comments
11Nov/070

Newsyland blog starts!

Newsyland blog starts today.

Yes, the world is treated to yet another blog.  I have wanted to have a blog for some time now, to share, give back if you will, things I have learned - some internet wisdom and some of my own discoveries.  I spent some time looking at CMS software and wanted to do something based in Python since I'm learning it, but since my web provider (1and1.com) only supports version 2.2.1 (yes, a version over 4 years old, and yes I asked for a newer version but was shot down), I decided instead on the ubiquitous WordPress.

I'm an oceanographer in California, where I use Matlab and build websites, so will hopefully pass on nuggets of wisdom regarding Matlab, Javascript, PHP and CSS. I'm also a recent and enthusiastic Mac OS X convert, but dabble in Linux (Fedora) and am a Windows power user, so these subjects may come up. I'm also learning python and planning on taking some of the O'Reilly on-line classes, so will probably post some things about them too.

Oh, and "newsyland" is, I hope, a witty homophone to New Zealand - a place I'd love to live some day...

Filed under About

Filed under: Original, Python No Comments