Archive for the 'Mac OS X general' Category
Saturday, September 2nd, 2006
Sorry to say the spammers have won the war with me. I have turned comments off on my blog and that was one of the primary reasons I even started a blog. I like to hear what I am doing wrong, different ways I can go about what I am doing and ways you are [...]
Posted in Mac OS X general | Comments Off
Friday, August 18th, 2006
Mac OS X comes with so many tools now, that there are myriad ways of getting things done. I had to present a list of files in a directory with the modification dates recently. I came up with this one liner:
ls -lT | awk ‘{print $10, $7, $8, $9}’ | bbedit
if you do a ls [...]
Posted in Mac OS X general | Comments Off
Thursday, July 27th, 2006
A while back I wrote a post about a ftp shell script. A number of people told me I should use curl instead. Here is one I wrote using both perl and curl to move some files from a site. I start with a list of file names. They don’t have the .pdf extension in [...]
Posted in Mac OS X general, Perl, Shell Script, Unix | Comments Off
Monday, July 24th, 2006
I had to sort directories of pdf files that had identical names except for the last characters before the extension.pdf. Perl has a nice built in sort routine, but when I used it to sort like this:
@sortedlist = sort @listOfFiles;
I would end up with filenames in sort order for the most part except 10 would [...]
Posted in Mac OS X general, Perl | Comments Off
Thursday, April 13th, 2006
Javascript has come a long ways. The Mozilla project has released a couple of tools for javascript writers. I recently added the capability to my Mac of being able to write javascript then run and debug it from the command line, just like I would a perl script. Rhino is a java tool that will [...]
Posted in General, Mac OS X general, Shell Script, Unix | No Comments »
Wednesday, March 29th, 2006
I run into the situation of having to rename so often that I am constantly tweaking my solution. Here I had to remove some extraneous characters on file names that a client had added. All we wanted where the first characters that started with DSFC and then the 4 digits. I had to drop off [...]
Posted in General, Mac OS X general, Perl, Unix | No Comments »
Saturday, March 11th, 2006
I have several handy applications that I use on my mac daily. Obviously a mail app and browser. Safari is very nice. I’m using Apple Mail, but Thunderbird is really a nice mail app, too. But for me, much of the business of computing is storing information, and being able to get to that information [...]
Posted in General, Mac OS X general, Perl, Shell Script, Unix, wordress | No Comments »
Tuesday, January 24th, 2006
Do you ever need to move a bunch of files to a specific location? Or do you want to backup certain files and need a nice method for moving them to a second drive or location? This following script can be helpful. You can re-write it for your particular purpose. I originally wrote it to [...]
Posted in Applescript, General, Mac OS X general, Shell Script, Unix | No Comments »
Monday, January 23rd, 2006
I’ve been asked this a couple of times, so I’m revisiting this topic (see post 50). I didn’t think it would have been too common for people to want to restart classic from a script, but apparently there are some. If this doesn’t interest you, at least you might want to take a peek at [...]
Posted in General, Mac OS X general, Shell Script, Unix | No Comments »
Sunday, July 10th, 2005
It has been quite some time since I have had a chance to write. I finally made the switch to Tiger. It was a long process for me. I installed a DVD drive into my blue and white G3 to make Tiger installation easier. While I was upgrading my machine I decided to soup it [...]
Posted in General, Mac OS X general, Unix | No Comments »
Friday, February 25th, 2005
Since I upgraded to WordPress 1.5, being a web designer, I had to give themes a try. Kubrick is a beautiful interface, but I desired to build my own interface. I have called this one soothe, since it is aqua inspired.
It took me a little while to figure out what files controlled what behaviour. It [...]
Posted in Apache, General, Mac OS X general, Unix | 6 Comments »
Tuesday, January 25th, 2005
This is a little easy trick for those in a Windows network environment. If you have a laserwriter that your pc can’t see (such as an appletalk protocol printer) and you have an OS X box that sees it, you can turn on Windows sharing in your preferences and share your printer. This is sometimes [...]
Posted in General, Mac OS X general | Comments Off
Monday, January 10th, 2005
I have been having a lot of difficulty using Moveable Type in recent weeks. This has slowed progress on the website. I’ve made the switch to Wordpress which is a php alternative to the perl powered Moveable Type. I have found it to be a very nice editor that is very easy to install and [...]
Posted in General, Mac OS X general, Shell Script, Unix | 4 Comments »
Wednesday, November 17th, 2004
Here is a shell script you can use to shutdown and restart classic. I created this to run as a cron script, so that I could shut down classic at an interval. It seemed like Classic was having memory problems if it ran too long without a reboot, so I set it up to run [...]
Posted in General, Mac OS X general, Shell Script, Unix | 3 Comments »
Thursday, October 7th, 2004
I’ve been trying to understand the mount command in Unix. If anyone can shed some light on it, please do post. This is what I have figured out. You can mount an afp volume using the command mount -t afp. But you first have to establish a share point for the mount to land. So [...]
Posted in General, Mac OS X general, Shell Script, Unix | 1 Comment »
Thursday, August 26th, 2004
One thing that OS X is lacking that I used all of the time in OS 9 is the print window command in the finder. There are a few ways to get around this limitation. One way is to open the window you want a print out of. Grab the icon at the top middle [...]
Posted in General, Mac OS X general, Shell Script, Unix | No Comments »
Monday, August 16th, 2004
Apple has provided a command line utility to match the Aqua software update. This can be scripted to run and also can be run remotely using ssh.
I ran the softwareupdate command by typing in softwareupdate -i -r for install required. The discovery of this command line command is really rather nifty. Next time you need [...]
Posted in General, Mac OS X general, Shell Script, Unix | No Comments »
Tuesday, July 27th, 2004
In OS X you use the Go menu to Connect to a server. If you have installed the Script menu that comes with Applescript in your Applications folder you can place an applescript in there that will be a shortcut to mounting an often used server. Below is a script you can use:
tell application “Finder”
–activate
try
mount [...]
Posted in Applescript, General, Mac OS X general | 1 Comment »
Wednesday, July 21st, 2004
You can use Perl’s File::Copy module to move files around your system. The only drawback is that if the files are macbinary and have a resource fork, that portion of the file gets lost. You can use Apples ditto command with –rsrc parameter to move files and maintain the resource.
Following is a perl subroutine I [...]
Posted in General, Mac OS X general, Perl, Unix | 2 Comments »
Sunday, July 18th, 2004
One of the great advantages of OS X is that you can control applications using Applescript. There is a command line version of calling applescript called osascript. The really cool thing is being able to use this command inside of another script such as a perl script or a shell script. One of the things [...]
Posted in Applescript, General, Mac OS X general, Perl, Unix | Comments Off