Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'A script to determine Maximum Transmission Unit' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to determine Maximum Transmission Unit
Authored by: b00le on Feb 08, '06 02:04:37AM

I wanted to use this to see if it would solve a problem I was having at work, but the instructions are incomplete - some of us would rather drill our own teeth than use Terminal (life is too short) and I don't know how to point that chmod command at my file. My real question is: there's a whole scripting facility built into OS X, with a script editor and all - geek value zero. Is there a way to test the MTU using that? And why not? The script as given is incompatible with Script Editor.



[ Reply to This | # ]
AppleScript not so easy...
Authored by: gabester on Feb 08, '06 06:45:02AM

Yes, this likely could be rewritten as an AppleScript, but for most people, AppleScript is actually a much more difficult language to learn, implement and use than shell scripting or perl - mostly because on the face of it simple commands like 'tell Application "Finder" to open the selected file' seem to work, but once the script becomes more complex than that elements of error checking and even syntax parsing become quite obtuse.

Learn to use the command line - it is your friend, and skills there apply to many more computing platforms than OS X. Spending time learning AppleScript is probably not worth the investment for most people, given its esoteric nature. g=



[ Reply to This | # ]
AppleScript not so easy...
Authored by: b00le on Feb 08, '06 07:30:56AM

Well that's interesting, but I've only ever once needed Terminal before (and I've been using OS X professionally from the start) and at least that time the ubergeek waas condescending enough to provide complete instructions. I found out by myself that I can drag a file into terminal to get the path, and did the chmod o+x thing - so nice and intuitive: nothing at all seemed to happen - and I still don't know how to 'run' the script I have. I know this site is for 'hints' but what does it take to actually tell us how to do something?



[ Reply to This | # ]
AppleScript not so easy...
Authored by: mistersquid on Feb 08, '06 09:55:30AM

Download the script and open a Terminal window. Change the permissions on the script so that the script is executable. It seems you know how to get this far.

The next step is to type at the command line

./NAMEOFSCRIPT
where "NAMEOFSCRIPT" is the name of the script you made executable. The "./" is command line-ese for "run what comes next."

Gabester is right, however. If you really want control over your Mac the most direct way is the command line. Because of this, many advanced techniques will specify command line interaction. If you've been around Macosxhints for any length of time, you almost certainly know this to be true.

That said, yes, the command line is scary for most GUI-only users. There is a learning curve to the command line but--and this is an important but--it is very simple to get started on that learning curve. You can learn a lot in twenty minutes that will make your Mac OS life much easier (and richer and complex) by dipping a toe into the "mysterious" waters of the CLI (command line interface).

The best way is to get experience in a UNIX shop. But since you are a professional and, as you say, "life is too short," there is a great batch of OS X command line tutorials at Macdevcenter.com. The first tutorial is a great place to start since it is designed to help beginning CLI users with a "step by step [of] how to get comfortable with the Terminal".

Happy travels.



[ Reply to This | # ]
AppleScript not so easy...
Authored by: b00le on Feb 09, '06 02:10:22AM
Thanks, but I still can't make it work - here's the session (I tried it twice because I couldn't figure out how many slashes were needed)
Welcome to Darwin! grant-thompsons-power-mac-g5:~ grant$ chmod o+x /Users/grant/Desktop/scriptmtu
grant-thompsons-power-mac-g5:~ grant$ .//Users/grant/Desktop/scriptmtu
-bash: .//Users/grant/Desktop/scriptmtu: No such file or directory
grant-thompsons-power-mac-g5:~ grant$ ./Users/grant/Desktop/scriptmtu
-bash: ./Users/grant/Desktop/scriptmtu: No such file or directory
I might have a look at those tutorials if I ever have time but frankly, I want to use my computer, not futz with its vitals. I started out in the era of punched cards and men in white coats and thought back then there must be a better way. I see neither charm nor virtue in the CLI. As I said I've only used it once before, following a hint from this site. At least it worked that time (though it didn't help...)

Maybe one of you wizards can tell me why Msoft Windows Service Pack 1 breaks OS X access to servers - in exactly the same way it was broken when 10.4 first came out. I'm running 10.4.4.
mount_smbfs: error from NetrShareEnum call: exception = 382312522
mount_smbfs: tree connect phase failed: syserr = Permission denied


[ Reply to This | # ]
AppleScript not so easy...
Authored by: el bid on Feb 10, '06 03:07:53AM

>Maybe one of you wizards can tell me why Msoft Windows
>Service Pack 1 breaks OS X access to servers - in exactly
>the same way it was broken when 10.4 first came out.
>I'm running 10.4.4.

The usual joke here is that Windows is expecting encrypted passwords and OS X is offering plain passwords, or the other way round. There's a hint about this at http://www.macosxhints.com/article.php?story=20050506120948120

As to the "scriptmtu" issue (actually mine downloaded under a different name -- you might need to check that, and perhaps "echo <filename>" to confirm that it looks like a script and isn't some junk), the easiest thing is just to change into the directory where the script is (cd <FullPathToDirectory> -- and, as you've discovered, you can drag the directory from the Finder to fill out that path) and then type "chmod a+x" and then <space> and then your dot-slash-filename. A handy tip to make sure you're spelling the filename right is to put in the first three or four letters and then hit <Tab>.


---
el bid



[ Reply to This | # ]
AppleScript not so easy...
Authored by: el bid on Feb 10, '06 02:08:14AM

> The "./" is command line-ese for "run what comes next."

Not quite. It's just the path name locating the file you want to run -- "in the current directory". Folks coming to UNIX from DOS trip up on this because DOS automatically assumes "current directory" as the location, although in fact that "." means the same thing in DOS (but they get their slashes the wrong way round...). UNIX needs to know exactly where the executable is, so you need this abbreviation for the whole path.

BTW I wholeheartedly agree that the command line is your friend. C'mon, guys, we've all grown up now and we're running UNIX, the greatest operating system the world has ever seen... :-) Applescript belongs to the thin proprietary veneer on the top, and isn't even anything to do with the much thicker mid-layer NeXTStep stuff that does most of the non-UNIX work around here.

---
el bid



[ Reply to This | # ]
A script to determine Maximum Transmission Unit
Authored by: codeProle on Feb 08, '06 11:10:20AM

You can diddle file permissions from the Get Info dialog. Right-click (or CTRL-click) the object and select Get Info from the resulting menu.

Once the Get info dialog is display find the Ownership & Permissions section towards the bottom. Expand it to reveal a graphic interface to the permission settings.

---
--
15" G4 TiBook 867MHz 768 MB 40 GB



[ Reply to This | # ]
A script to determine Maximum Transmission Unit
Authored by: RickoKid on Jun 08, '08 10:51:21AM
I've written an AppleScript to set the MTU, and it includes parts of this script to lookup the maximum MTU ... you can get it from my blog: http://www.torrfamily.org/tumbleseed/products/set-mtu/

---
Visit my technology (and Apple in particular) blog at http://tumbleseed.torrfamily.org/

[ Reply to This | # ]