11.27.06
Posted in web dev, mac/os x at 1:33 pm by Clinton
So you need a local host file entry in Mac OS X eh? It’s
/etc/hosts
However you’ll need to sudo to change this (say sudo nano /etc/hosts).
So you change the hosts file, and save it, but you see no change in behaviour … unless … you flush the name lookup cache of lookupd. How do we do that?
lookupd -flushcache
This might help others.. but it’s mainly to reminder me in future. :)
Permalink
09.26.06
Posted in web dev, programming, mac/os x at 3:32 pm by Clinton
Moving between home and work, I sometimes have issues with the proxy settings of my web browsers.
Today, I was trying out Eclipse, and while looking at the “what-new” and other tutorial related into, I had problems. The proxy.pac file that work has was making requests for 127.0.0.1 (aka “localhost”) also go through the proxy. Now, 1) I think that’s the wrong setting - if I ask for localhost it should go straight back to me - not to the local proxy and (then be ignored). 2) yes, I could set up the manual proxy settings with the appropriate “ignore proxy for” … addresses, but… i’m a coder at heart, so what I could I do?
Write my own (local) .pac file, and tell my browser to use that of course! :)
// Clinton’s custom proxy files - works at home and at work.
// Change the work vars to suit your home/school/work needs
// If you have multiple proxy setups at home, double-up the proxy behaviour.
function FindProxyForURL(url, host)
{
var work_ip = “136.186.0.0″;
var work_ip_mask = “255.255.0.0″;
var work_proxy = “PROXY 136.186.1.14:8000; DIRECT”;
// If only hostname specified, local host so go direct
if (isPlainHostName(host))
return “DIRECT”;
// local host is always direct
if(isInNet(dnsResolve(host), “127.0.0.1″,“255.255.255.255″))
return “DIRECT”;
// Am I at work? Check for my IP in the work ip range
if (isInNet(myIpAddress(),work_ip,work_ip_mask))
{
// Connect directly to local work domains
if (isInNet(dnsResolve(host), work_ip, work_ip_mask))
return “DIRECT”;
// Is this a protocol that needs to be sent to the proxy?
var bits = url.split(‘:’,2); // set limit - only need 2
var p = (bits.length==2) ? bits[0] : ‘’;
if (p ==‘http’ || p == ‘https’ || p == ‘ftp’ || p == ‘gopher’)
return work_proxy;
}
// if you get to here, you don’t get a proxy
return “DIRECT”;
}
It’s a quick hack, it works (so far) for me, and ymmv, but if you find it useful as well, that would great. This technique could be (and has been) extended to support ‘ad’ filtering from known URLs as well. There is a shExpMatch(url, “http://ads.somedomain.com/*”) function - I was hoping for regex powers, but alas it just supports “shell expressions” and that ain’t half as fun. :)
Helpful links on PAC files:
* http://en.wikipedia.org/wiki/Proxy_auto-config
* http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html
* Firebug http://www.joehewitt.com/software/firebug/ - yes it will tell you about errors in the pac file as well - v.cool.
Permalink
09.15.06
Posted in mac/os x at 10:23 am by Clinton
Okay, in the ever-increasing learning path of doing things the os x way, here’s a few more things I now know that I didn’t know that Andrew hasn’t posted :) …
- VNC - I’m using “Chicken of the VNC” (GNU) (based on the VNCViewer)
- SFTP GUI - Fugu (thanks Lucien for that pointer)
- IR Control (for PowerPoint that is) - iRed Lite (Free beta download - shareware in future). (Thanks Andrew for that one)
- Date/Calendar from Entourage - MenuCalendarClock
from Objectpark Software. Free and Pay version.
Installed the os x dev tools… coding time. Screen shots to follow :)
Major frustration - shift+up/down arrow group selection behaviour. Not what I expect, not useful from my pov as is, can’t find a way to make it work the windows way. Yes - windows.
Delphi 7 under parallels runs fine.
Permalink
08.30.06
Posted in mac/os x at 8:54 pm by Clinton
I haven’t been as vocal about this as Andrew (parts [1], [2], [3], [4]), but I too have joined the mac world with the use of a nice silver intel-based MacBook Pro replacing my desktop. Now many thoughts have been accumulated during the learning process :) but I guess I wanted have some “well-formed” ideas before posting (and so avoid showing a greater-than-necessary amount of ignorance!). But now I have to post on my fun with .chm viewers…
I have been happily using parallels to get back to the XP/Visual Studio world as needed, and rebooting with bootcamp when I need DirectX 3D acceleration. (I’m sooooo looking forward to a VM that can give me that without a reboot).
However, although I can do all the things I’ve wanted so far, I have been frustrated by the limits, such as not being able to browse to my bootcamp XP partition and just open a windows compiled help file (.chm). So today I started my search.
Here’s my list
My testing process is a bit of a blur, but some programs crashed… to be honest I didn’t care why, I just moved on. However, significantly for me, only xCHM correctly showed (buit?) an index/contents for the DirectX .chm files I wanted to read.
Having the contents/index to look at is essential. Not having it is like reading a book but you can’t turn the pages! Almost useless. I don’t know why the DirectX help files had indexes that didn’t show (I’m sure its something different about those files) but the bottom line is I needed to read those files with indexes and xchm did the job.
So, that’s my pick for the day. ymmv, but it was a good Google/test/win day for me.
Permalink