V O T E !
You are currently browsing face’s articles.
Date-shifting in iPhoto 08
I get a lot of requests to add date-shifting support for iPhoto 08 to my iPhoto AppleScripts. But in most cases, the scripts would be completely unnecessary, iPhoto finally built this feature into the application. Here’s how to use it.
This is a nice and handy thing. I can finally get all of my “web-saved” images into a sensible spot.
THIS DOESN’T WORK. Logs get confused (logging stops). Haven’t figured out a way to make it *really* work on Leopard.
Receive syslog info from router on iMac (Leopard)
Posted: Nov 28, 2007 6:51 AM in response to: YamaLuha
Solved
To enable your Leopard system to receive network syslog submissions edit /System/Library/LaunchDaemons/com.apple.syslogd.plist and uncomment the lines specified in the comments so that the end of the file looks something like this.
<key>NetworkListener</key>
<dict>
<key>SockServiceName</key>
<string>syslog</string>
<key>SockType</key>
<string>dgram</string>
</dict>
NB - the NetworkListener is part of the Socket dict entry!!!
Then execute the following commands (wait a few seconds between commands):
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist
That is enough to get an apple base station to dump it’s log into the system log.
Why is FeedBurner so hard today?
Sed is the ultimate stream editor. If that sounds strange, picture a stream flowing through a pipe. Okay, you can't see a stream if it's inside a pipe. That's what I get for attempting a flowing analogy. You want literature, read James Joyce.
Anyhow, sed is a marvelous utility. Unfortunately, most people never learn its real power. The language is very simple, but the documentation is terrible. The Solaris on-line manual pages for sed are five pages long, and two of those pages describe the 34 different errors you can get. A program that spends as much space documenting the errors than it does documenting the language has a serious learning curve.
Do not fret! It is not your fault you don't understand sed. I will cover sed completely. But I will describe the features in the order that I learned them. I didn't learn everything at once. You don't need to either.
cat /System/Library/CoreServices/backupd.bundle/Contents/Resources/StdExclusions.plist
defaults write com.apple.mail DisableDataDetectors YES
macosxhints.com - 10.5: Enable https on 10.5’s Apache2 web server
This short how-to explains how to get HTTPS/SSL working on Leopard, which uses apache2. First, follow the steps in this hint, but instead of following Step 5, do the following:
Edit /private/etc/apache2/httpd.conf, and uncomment the following line (it’s line 473 in my installation):
Modify as necessary for macports conf/certs
This page Using mod_ssl on Mac OS X is also quite good, useful, handy, whatever.
howto/ccache - MacPorts - Trac
This HOWTO covers how to enable building with ccache. It is a compiler cache. It uses the gcc -E switch and a hash to detect when a compilation can be satisfied from cache. The effect is that packages frequently compile 5-10 times faster than they would otherwise.
We’ll see how this changes behavior - installed 2008-06-06 05:00:00
Daring Fireball: Spaces in 10.5.3
Spaces was one of the new features in Leopard I was most excited about, but I found the actual implementation unusable. Henry Story wrote a fine description of the problems with Spaces in 10.5.0. When I linked to his critique, I wrote:
Double w00t!
Task-based spaces are just wonderful. It works for me.
sudo ipfw add deny src-ip 123.45.67.89, 127.0.0.1/8
That should do the trick.
The following describes what is not backed up by Time Machine, how to get a list of files that are excluded, and a reminder that you need to keep track of those paths that you have excluded via the Time Machine interface.
The list of paths, and the magic command came from Mac OSX Hints.
Read the rest of this entry »
Well, I hosed my printing system. At least it appeared that way.
I know - let’s go backwards in time and make like it didn’t happen.
Boot from the Leopard DVD. Tell it we want to restore from a Time Machine backup.
Wait about 90 minutes for the whole thing to restore. So far, so good.
I got the printing working as desired. All the systems can see the shared printers.
That should do it, right? Wrong!
1. I have a leftover swap file on the Time Machine disk - easy to get rid of - delete it.
2. I have a *very* large backup snapshot in the Time Machine - like 55GB - like it is a complete snap of the restored system. You would think that it would know that I restored from snapshot “A” and would simply make a hard link to that…hmmm
3. mail doesn’t work. My nightly cron job that backs up the databases sends mail. I didn’t get it.
Have to fix mail - wound up trying sudo /etc/postfix/post-install create-missing which got me most of the way there. I had to restart to get the mail daemons all “happy” again.
Oh, yes.
iTunes lost window positioning, had to be re-authorized for iTunes Store songs.
Mail.app decided that it had to import all of my mail! Only real problem there was that it had lots of messages marked unread that had actually been read. Not a big deal. It got the 66,000+ messages into the right places.
macosxhints.com - 10.5: How to reset the printing system
But these features are still here, just in new spots. To reset the printing system in Leopard, open the Print & Fax pane, then control-click in the Printers sidebar. There it is: Reset printing system. And the advanced method is available in a toolbar button, as detailed in this hint.
Apple - Downloads - Dashboard Widgets - hiddenfiles:
Simple widget that toggles visibility of files that are hidden from the Finder.
I am using Time Machine (an experiment) to do backups. I had a perfect opportunity to test it.
Read the rest of this entry »
Mac OS X 10.5 Leopard: the Ars Technica review: Page 7
To prevent events from being logged at all for changes to a particular volume, simply create a file named no_log in the .fseventsd directory on that volume. And in case it doesn’t go without saying, FSEvents honors the Mac OS X access control rules; you cannot receive events about directories that you don’t have permission to read.
I wonder if I could place a no_log on my clone volume and keep it when the rsync happens?
The description of FSEvents is short and to the point. Something a deep-down OS geek can appreciate
I knew that *something* had to be keeping track of changes - 20 seconds for an hourly Time Machine backup is nice and unobtrusive.
I have a *lot* of WordPress blogs that are served up on a Mac OS X Server platform.
The server has the web performance cache enabled. This causes problems with assumptions about how Apache identifies things.
Read the rest of this entry »
“Well Known” TCP and UDP ports used by Apple software products
This article lists TCP and UDP ports used by Apple products, such as Mac OS X, Mac OS X Server, AppleShare IP, Network Assistant, Apple Remote Desktop, Macintosh Manager, and .Mac. Many of these are referred to as “well known,” industry standard ports.
sys.UnixShellCommand("osascript -e '(path to pictures folder) as string'")
More better (since you get a newline at the end of the above)
string.trimWhiteSpace(sys.unixShellCommand("osascript -e '(path to pictures folder) as string'"))
The list of possible “magic” folders in AppleScript
Get multiple folder paths in one swell foop
osascript -e '{(path to pictures folder) as string, (path to applications folder) as string}'
returns a comma-separated list.
The path to command now has the following new folder constants:
- applications folder
- documents folder
- favorites folder
- home folder
- library folder
- movies folder
- music folder
- pictures folder
- public folder
- shared documents
- shared documents folder
- sites folder
- utilities folder
From the Applescript folks…
An additional tip about “path to”: you don’t need to wait for us to add an
explicit enumeration, since it can also take any four-character string that’s a
FindFolder selector. Get your hands on a copy of Folders.h (part of the Master
Interfaces) and go nuts.
Look here
/Developer/SDKs/MacOSX10.4u.sdk/Developer/Headers/CFMCarbon/CarbonCore/Folders.h
When FlickrFan starts it makes sure that your default browser is running.
Determining what your default browser is (on the Mac) isn’t all that easy.
The “open” command knows what it is.
in photoFanThread.script
if system.environment.ismac {
«webbrowser.launchMacBrowser () // [001]
// [001] use the system utility
sys.unixShellCommand(”open ” + homeurl) // [001]
};
photoFanSuite.init ();
system.temp.photoFan.flStarted = true;
// [001] we have already “opened” the URL on a Mac
// [001] don’t do it again
if not system.environment.ismac {
webbrowser.openurl (homeurl)
};
webbrowser.bringtofront ();
photoFanSuite.background.everyHour () //do a scan on startup
macosxhints.com - 10.5: Migrate crontabs from 10.4
n Mac OS X 10.4 (and earlier?), crontabs (the lists of tasks scheduled with cron) were stored in /var/cron/tabs. However, in 10.5, they are now stored in /usr/lib/cron/tabs, and the installer doesn’t seem to move any existing files from the old to the new location. So, the easy way to bring your old crontabs across is to run the following command in a Terminal:
sudo mv /var/cron/tabs/* /usr/lib/cron/tabs
Note that this command will replace any crontabs you’ve edited or set up since upgrading to Leopard with the version you had in Tiger; if you think there’s likely to be a clash, it would be a good idea to open the old files in a text editor and copy-and-paste the entries across to your new crontab (using crontab -e) instead.
Common Mailman administrative tasks
This advanced article describes how to perform some common Mailman tasks:
Reset Mailman to defaults
Back up Mailman data
Restore from a Mailman backup
Migrating from one server to another
System Startup Programming Topics: Customizing Login and Logout
If you want to run custom scripts or applications when the user logs in, there are several ways to do it. You might use this feature to perform maintenance tasks or set up the operating environment for your own applications when the user first logs in.
From the macports-users mailing list. A response to
“how do I tell which variants I used when I did a port install blah”
Just remember that list is generally not interesting. The different
commands you should remember are install, uninstall, upgrade, outdated,
installed, variants, and info.
i lost my file with the complete, detailed instructions on how I built/installed PHP5 and MySQL5 on my box.
The backup of the backup created a bogus file.
The nightly backup was a “recycle”
I’ll learn
Mac OS X Server 10.3.9
How do I know where a “visitor” is coming from?
The most commonly found method is to look at the server setting (let’s use PHP-speak here) REMOTE_ADDR.
That’s all well and good, unless you have turned on the web performance cache for any web site being served.
When you enable the performance cache Apache now returns REMOTE_ADDR in HTTP_PC_REMOTE_ADDR.
Anything that looks at REMOTE_ADDR will get the IP address of the server itself.
SPAM blockers, poll runners, anything that wants to know about who is talking to you. Wordpress, etc.
Oh, yes, as a side note: when you enable the web performance cache using ServerAdmin the httpd.conf file and all of the site conf files get re-written. Especially fun is the fact the PHP4 gets re-enabled if you have had it turned off.
Talk about scratching your head for a while.
I found an interesting performance tweek that was staring at me the whole time. After noticing 2-4 second delays in page rendering before geelog would load (I noticed geeklog said it loaded in, say .91 seconds yet from the time I hit enter on the web page, it tool 4-7 seconds to load).For those using Apache, you MUST list index.php first as your DirectoryIndex . This one fix jumped my render time from 4-7sec to the true .91 sec. Mine looks like this now:
DirectoryIndex index.php index.htm index.html
Take care and happy GL’ing.
I was looking for something else and this little note caught my eye.
Why not try it and see what happens?
Load all the PHP home pages.
Swap the pair (.html / .php).
apachectl graceful
Yes, wall clock time to load pages is shorter.
Who knew?
Microsoft Remote Desktop Connection Client for Mac 2.0 (Beta):
Remote Desktop Connection Client lets you connect to a Microsoft Windows-based computer and work with programs and files on that computer from your Macintosh computer. Remote Desktop Connection Client for Mac 2.0 (Beta) includes the following new features:
zoomed text editor icon coming back in 5.6? - The Omni Group Forums
Looks like builds after r89238 will enable resizable textareas with this default command in the terminal:
defaults write com.omnigroup.OmniWeb5 ShowResizableTextAreas -bool true
interesting. i would rather use the “zoomed” text window myself.
macosxhints.com - Burn a playable DVD from a VIDEO_TS folder
After searching the forums and trying various things, I still couldn’t find a quick, reliable, free method of burning a VIDEO_TS folder to a pure UDF DVD, so that it would play in regular DVD players, as well trigger DVD Player to start up automatically. Anyway, as often is the case, Terminal had the answers. Just type in this command and change the paths to suit:
hdiutil makehybrid -udf -udf-volume-name DVD_NAME -o MY_DVD.iso /path/to/VIDEO_TS/parent/folder
Make sure that /path/to/VIDEO_TS/parent/folder is the path to the folder containing the VIDEO_TS folder, not the VIDEO_TS folder itself. Once the .iso file has been created, drag this to Disk Utility and hit the Burn button.
Apple - Software - AppleScript - Image Events
THE IMAGE EVENTS APPLICATION
The Image Events application is used by AppleScript to control the SIPS architecture. It has no visual interface and presents no menus, windows, or dialogs for user interaction. It is intended to run invisibly as a background process, only accessible via AppleScript commands.
macosxhints.com - 10.3: Create icon previews and more in the Terminal
I’ve wanted to generate icon previews for image files from the command line for a long time, even though there are many fine applications avaliable for this task (pic2icon, Photoshop, Graphic Converter, IconDropper, and PathFinder to name but a few). However, Panther includes the “scriptable image processing system,” which makes this task trivial:
% sips –addIcon imagefile(s)
Use sips -h and sips -H for help, and see Apple’s page on the new Image Events application
Transforming a Shell Script into an Automator Action
Automator is a powerful technology for building custom workflows. But sometimes you need functionality that the existing actions don’t provide—functionality that could be easily accomplished using the shell with a scripting language like Perl, Python, or Ruby. With Custom Shell Script actions, script developers can quickly turn their work into Automator actions.
Top 15 free SQL Injection Scanners - Security-Hacks.com
Top 15 free SQL Injection Scanners
Friday, 18 May 2007 - 15:05 EST | Tools, Web Security, Network
While the adoption of web applications for conducting online business has enabled companies to connect seamlessly with their customers, it has also exposed a number of security concerns stemming from improper coding. Vulnerabilities in web applications allow hackers to gain direct and public access to sensitive information (e.g. personal data, login credentials).
perl -pe 'use MIME::Base64; $_=MIME::Base64::encode($_);'
perl -pe 'use MIME::Base64; $_=MIME::Base64::decode($_);'
That’s the piece I needed this morning. I found all sorts of entertaining things.
Some of them are vaguely in my memory. Most not, since I started before bash.
For Jan - edit command lines in the EDITOR
On Macintouch Don Hurter says
I cannot stress enough performing system updates one step at a time (others here have detailed their cautious procedures, so I won’t repeat them), but one additional step is to monitor the first reboot after the update using ‘verbose mode’. You can do this by holding down command-v at startup, or make it a permanent routine by typing the following into a terminal window:
sudo nvram boot-args=”-v”
Doing so will allow you to see exactly where in the boot process the system is taking its time (such as during an Airport firmware update, for example), whereas relying on the default graphical boot status leaves you guessing as to what’s happening during the long pauses.
Since users now reboot so infrequently, who cares if the startup screen seems pretty or not? Err on the side of more information, and switch to verbose mode.
11 Ways to Optimize Your Mac’s Performance:
9. Keep an Eye on Activity MonitorThere may be other things hogging your processor’s attention or sucking up RAM. How will you know about them? By using Apple’s Activity Monitor, which comes with OS X. Activity Monitor will tell you about CPU usage, RAM requirements, virtual memory usage, and whether a given application is a PowerPC or Intel (Universal) build. Check it occasionally to see if there are any red flags - or keep it running for a few days (with one of the useful Dock icons or floating windows enabled) to keep an eye on when things are spiking.
It’s a fine idea, but could be part of the problem.
I have been running Activity Monitor quite constantly since late January.
the underlying “pmtool” loses memory. a lot of memory. It starts off consuming just over 1MB of “real memory” (1.4MB).
After 18 hours that will be about 80MB of real memory. So if limited memory is the problem, and you keep it running for a few days, well…
Update - 2007-03-15 -
Today my pmtool has been running for over 4 hours and the memory consumption is still at/around 1MB. This is most strange. But one of two things
1. the latest update to the OS fixed it
2. the fact that I haven’t changed the sort order of processes in the window (currently CPU time descending) to Real Memory descending.
Let’ change the sort order and watch the memory.
no change - I would see memory grow, eben after just 5 minutes
curious
Text* Snippets: MySQL launchd item for Mac OS X Tiger [mysql] [osx] [10.4] [tiger] [launchd]
I had to reinstall Mysql because it wasnt one of the things I backed up before erasing my hard drive. Since Im now running Mac OS X 10.4 Tiger, I decided to set it up to start when the system boots, but the system for creating startup items has changed slightly. So I saved the following xml in /Library/LaunchDaemons/com.mysql.Mysql.plist:
Lingon is your friend. It is a GUI for creating launchd plists. Only a little obtuse, but switching to “advanced” mode will show you what your plist looks like, so it’s easy to compare to any samples you may be looking at.
StorageMojo » Everything You Know About Disks Is Wrong:
Which do you believe?Costly FC and SCSI drives are more reliable than cheap SATA drives.
RAID 5 is safe because the odds of two drives failing in the same RAID set are so low.
After infant mortality, drives are highly reliable until they reach the end of their useful life.
Vendor MTBF are a useful yardstick for comparing drives.
macosxhints.com - Add emacs key bindings to Microsoft Word
Emacs users get addicted to the standard key bindings (which are also available in Cocoa apps). Microsoft Word doesn’t support these by default, but you can add them through customization. Here are the ones I find most useful:
StartOfLine: Control-A
EndOfLine: Control-E
LineUp: Control-P
LineDown: Control-N
CharLeft: Control-B
CharRight: Control-F
To set these up in Word, go to Tools » Customize » Customize Keyboard. From the Categories panel, choose All commands. Find each of the entries in the above list, select the Press new shortcut key box for each, then type the shortcut as shown above and click Assign. (Word will tell you if any of the shortcuts are currently assigned to other commands.)
found in the mac os X system admin list
Just wanted to say thanks to Michael Wise for taking time out today
and providing me with a great set of forensic tools and techniques
for locating message queue IDs, and using postcat on the queue to
view actual messages/headers. Now I can start the real investigation.
Haven’t found the offending script yet, but am getting closer.
Notes from my conversation with Michael, for the archives:
* First, find suspicious looking lines in /var/log/mail.log
* Look for the smtp ID, such as: postfix/smtp[25897]
* Grep for other instances of that ID in the log: grep 25897
mail.log
* From there, youll be able to see postfix queue IDs, such as
159A347C89C
* You can use this queue ID to find deferred messages in the
postfix queue
* cd /var/spool/postfix/
* Find where in the queue directory hierarchy this message
lives: find . -name 159A347C89C
* The messages are stored in a format not easily readable. To
make them readable, use the postcat command, e.g. postcat deferred/E/
E9B8F4F0E7C
* Now you can see the real message, with all of its headers,
which should give you a lot more info about its origins. You can see
whether it came from outside, or if it comes from a process ID, there
should be some indication. If user is www, you know its coming from
a web script.
* To delete a message from the queue, use e.g.: postsuper -d
E9B8F4F0E7C Do not use the path with this command - just the queue ID.
Other tools:
Monitor incoming network connections, filtering out legit traffic on
port 80:
netstat -na | grep EST
netstat -na | grep EST | grep -v ‘\.80 ‘
netstat -na | grep EST | grep ‘\.25 ‘
To find files or dirs owned by www (that might be illegitimate):
find / -user www -ls
In case attacker named directories with spaces or other weird chars
in them:
find / -user www -ls | cat -vet -
(take your cat to the vet - its sick)
Thanks also to others who responded on this.
Best,
Scot
–
Scot Hacker, Webmaster
Graduate School of Journalism
UC Berkeley
http://journalism.berkeley.edu
Readline shortcuts
GNU Readline is the library used to make advanced command-line wizardry convenient and conistent across a multitude of command-line applications. These programs include bash, bc, ftp, gnuplot, gpg, ksh, mysql, psql, python, smbclient and xmllint.
The cheatsheet at the right contains a summary of many of the useful line editing command shortcuts which are available in all applications that use libreadline.
Optimizing an Xserve for Web Hosting
A single Xserve is ideally suited for smaller scale Web hosting, where the task is to host a handful of moderate-traffic sites. (With a fleet of Xserves, you could host an eBay or an Apple.com, but that’s a topic for another article.) The Xserve’s Apache Web server software has a multitude of configuration options. In this article, I will go over how to set up Apache to serve multiple Web sites from the same machine—so-called “virtual hosting.” I will also look at ways to optimize the server’s setup for fast, robust Web hosting. This article assumes that you have already followed the steps in the Mac OS X Server Administrator’s Guide to start Web service. (You can find the Guide on the Mac OS X Server Manuals page.)
macosxhints.com - 10.3: Use the x-man-page URL type to open UNIX man pages
The Terminal application in Panther supports the x-man-page URL type. That is, the following URL, when used with Safari or the open command, will open a Terminal window with the ls man page displayed:
x-man-page://ls
x-man-page
ssh
telnet
sudo dd if=/dev/rdisk0 of=/dev/rdisk1 bs=131072
At its core, Xserve is a two-socket Core microarchitecture Xeon (Woodcrest) rack server. As I wrote in my review, in hardware design, Xserve lives up to market standards. Some touches, like the SAS/SATA drive bays, a PCI-X slot for existing expansion cards and the SuperDrive dual-layer DVD burner, help tip the scale in Xserve’s favor. But the reason to buy Xserve is OS X Server: No other server app platform rivals it, and no other server system runs it. If you want OS X Server, you need a Mac, and Xserve is the only Mac that’s equipped with external drive bays and a baseboard management controller.
Learn 10 good UNIX usage habits
Adopt 10 good habits that improve your UNIX® command line efficiency — and break away from bad usage patterns in the process. This article takes you step-by-step through several good, but too often neglected, techniques for command-line operations. Learn about common errors and how to overcome them, so you can learn exactly why these UNIX habits are worth picking up.
I still don’t like what xargs does
sed one-liners are here
sed FAQ is here
I wanted to change all occurrences of PRIVATE to NJPRIVATE in a bunch of files. It’s a simple command in sed, but what about replacing the file? output to temporary, then copy? yes, but.
the PERL solution is
perl -pi -e 's/PRIVATE/NJPRIVATE/' `grep -l PRIVATE *.php`
the magic is
-p loop and swallow the files, and print default.
-i edit the files in-place
-e do the command
solution found at Debian Administration
So, I got my PHP 5 to work, and talk to MySQL.
I wonder if Netjuke works? Nope. Not at all.
Everywhere I read I see that Netjuke is not supported and will never work on PHP 5. Use Jinzora they say. Uck - that wasn’t fun.
Simply put. Fix “play.php” to only output one header at a time. Search for the header() call. It’s pretty obvious.
Change the test in the config.inc.php for
`PRIVATE == true`
to be something like
`NJPRIVATE == true`
Fix every file that has a
`define(”PRIVATE”, true/false)`
to be a
`define(”NJPRIVATE”, true/false)`
private is a reserved word in PHP 5.
That’s all it took. All of about 30 minutes once I decided to ignore all of the advice on the web.
Classic maintenance programming attack.
10.3.9 - no help beyond 4.3.11 from Marc Liyanage.
Apple’s 4.4 is of no help - no GD support, missing other things - PEAR, XML things, etc.
How do I make a compatible build?
Start with Apple’s configure command (use phpinfo() on a standard installation). It *will* screw up your system files nicely, so make sure you know what each of the files and directories means! I didn’t. I have an interesting mix of system/local files now.
Add extensions as needed. Test ./configure each time, and you might as well re-build each time.
Decide where to get libraries. I finally decided to use darwinports for the non-Apple standards. Look out for X11 when not installed!!!!
Use the built-in GD ‘–with-gd’ - no path. darwinports gd has issues (won’t build).
I wound up with this
configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –with-apxs –with-ldap=/usr –with-kerberos=/usr –enable-cli –with-zlib-dir=/usr –enable-trans-sid –with-xml –enable-exif –enable-ftp –enable-mbstring –enable-mbregex –enable-dbx –enable-sockets –with-iodbc=/usr –with-curl=/opt/local –with-config-file-path=/etc –sysconfdir=/private/etc –with-pear –with-mysql=/usr/local/mysql –with-openssl=/usr –with-gd –with-png=/opt/local –with-jpeg=/opt/local –with-expat=/opt/local –with-gettext=/opt/local –with-dom=/opt/local –with-dom-xslt=/opt/local –with-xslt-sablot=/opt/local –enable-xslt –with-xmlrpc –enable-wddx
I still need to figure out about IMAP support.
Replacing my home backup server with Amazon’s S3 (by Jeremy Zawodny)
Not too long ago, Amazon released their Simple Storage Service (or “S3″ for short). It provides a hosted storage platform which developers can build all sorts of applications on top of. Smugmug, a popular photo sharing web site, is using it to store and host pictures.
I’ve been considering using S3 as the backend to an on-line backup, since I’d been beating that for a while (see: Swimming Pools and Hard Disks and Cheap On-Line Storage Coming Soon).
In a few days I’ll write about how to do this–I’m only partially through the process right now. But right now I want to lay out the motivation for doing this.
macosxhints.com - Modify cursor movement keys in Terminal
The defacto standard in Terminal’s shells is meta-b (backward) and meta-f (forward) for word-by-word movement. In every other Cocoa app, however, it’s Option-left arrow and Option-right arrow. I wanted Terminal to behave the same way.
What a difference a little conf file makes!So, we here at AFP548.com are by no means DBAs in any way shape or form. We cross our fingers every time we upgrade the server that MySQL works when it comes up. We’re not sure what we’d do if it didn’t.
I tried it. First impression is that dynamic pages on the blogs *are* faster.
PHPit - Totally PHP » Taking a first look at the AutoCRUD for PHP library
In this article we’ll take a look at the AutoCRUD for PHP library, which is a database abstraction library specifically for MySQL. I’ll take you through all major features of this library, and demonstrate everything with examples.
macosxhints - 10.4: System-wide iPhoto browser
For example, if I want to add a picture to a TextEdit RTFD document, I had to launch iPhoto, chose the picture, and drag it to the document. Waiting for iPhoto to launch can be long if you have a lot of photos.
But there is a way to get around this, using an Automator action.
macosxhints - 10.4: Demystify Spotlight’s saved search syntax
Spotlight saved searches, or “Smart Folders,” are simply XML files with a .savedSearch extension. Within that XML file, which you can open using any text editor, there is a tag called RawQuery; immediately following that is another called (ambiguously) string. The string tag right after the RawQuery tag is the “code” for your search.
macosxhints - 10.4: More expressive saved searches
To use the query language in a saved search, add a new criterion to the search and click “Other…” for the search attribute (the first field of the criterion, usually something like “Kind” or “Last Opened”). Then select “Raw Query” from the list of search attributes. Enter your query in the text field.
Deleting Mac OS X users remotely with dscl - O’Reilly Mac DevCenter Blog
I had occasion recently to need to remotely delete a user — let’s call him “George” — on a Mac OS X box that is running the Client version of Tiger. I have ssh access to that machine and, since I keep meaning to learn how to do it, I decided to take the time to make a few notes on the process for the next such occasion.
Wouldn’t the services menu be much more useful if it weren’t overcrowded by services you never even thought of using? With Service Scrubber, you can:
restructure the services menu
change service keyboard shortcutsdisable services
Handy little app.
Now I can find ManOpen’s “apropos” service. Nifty.
is here
configure.env-append LD=g++ CC=g++
darwinports
need to add that line after configure.args - elsewise it never loads
spent all day trying to figure this out
pdb2csv csv2pdb
Preferred to export Apple’s Address Book to Mozilla Thunderbird.
Simply drag all contacts from the Address Book to your desktop and upload the created vCard file.
WP Tiger Administration // Ordered List by Steve Smith:
First, download the plugin. Unzip the file, and place the entire wp-admin-tiger folder into the /wp-content/plugins directory. For clarification, the plugin file ‘wp-admin-tiger.php’ and plugin file directory ‘wp-admin-tiger-files’ should be located in the /wp-content/plugins/wp-admin-tiger/ folder. After the files are in place, browse to the Plugins page in your WordPress Administration area, and activate the plugin. The administration design should immediately change. To revert back to the original design, just deactivate the plugin. No core files are (nor should be) modified to install this plugin.
/etc/httpd/sites_disabled/0000_default_default.conf
the location of the default settings for virtual hosts (VirtualHost) that are used by the ServerAdmin GUI interface.
Add or change things here to have newly added web sites get your favorite changes to the configuration.
httpd configuration default virtualhost
MacInTouch: timely news and tips about the Apple Macintosh
[C. Alexander Cohen]
On a tip from Larry Pina (credit where it’s due dept.) I have found that simply dropping a CD over the antenna(s) boosts wireless range. (CD coasters are great for this). On a 2 antenna box, orienting one at 90 degrees to the other seems to help. Should this not work well enough for Ben Levi, well, no harm done and no cost!
Product Reviews at OtherWorldComputing.com
I’ve tried a couple different solutions, and my first “acceptable” solution was to control the remote computer via a VNC client such as Chicken of the VNC. I like CotVNC, and I use it daily at work, but for this usage, there was the annoying aspect of having to have a separate window open in order to do something on the other computer. What I needed was something that would just let me use my keyboard and mouse with both computers.
from your terminal
man ipfw
the command to deny/drop packets for a host is simply
sudo ipfw add drop src-ip 217.59.146.158
which can be seen to be effective by doing this
teatime 5 # sudo ipfw show
A modest solution would be to improve AS’s pretty printer so it
uses different styles to distinguish between commands, properties,
elements, types and enums, rather than using a single style for all
as it currently does. If anyone wants to file a feature request to
that effect then be my guest.
Something you can do right now (thank you for the perfect segue) is
to change the style for application keywords to be underlined.
Because it will also underline the space, you can tell, for example,
that “path to” is a single term, while “path of” is two. (I did this
a while ago while tracking down a terminology bug, and discovered it
was generally useful.) However, has’ idea is still a good one.
–Chris Nebel
AppleScript and Automator Engineering
[1] How to do it:
Read the rest of this entry »
Product Reviews at OtherWorldComputing.com
Backing up your system is something you rarely think about. That is, of course, until that inevitable day when your hard drive decides to shuffle off this mortal coil and join The Great RAID Array in the Sky, taking with it all your saved email, financial info, and any of a number of other bits of irreplaceable data. Its a situation we all will face one day (if you haven’t already) and it’s best to be prepared with a good backup for when it does strike.
Macworld: Feature: Tiger Secrets: Preview, Page 1
While you’re sorting through folders of images or PDFs, why not also add keywords to them so they’re easier to find with Spotlight later? Preview makes this easy. Drag the images or PDF files you’d like to tag into Preview and then select Tools: Get Info (or just press Command-I). In the Document Info window, click on the Keywords tab. Click on Add and then enter the keyword you’d like to use. If you have a group of files open, you can then simply click on the next image or PDF in the drawer. The window will change to reflect the selected file’s information. When you’re done, save the files. The next time you perform a Spotlight search, you’ll be able to use the keywords to home in on your target.—RG
get last month using bash and the date command
MON=`date +”%m”`
((MON=$MON-1))
-bash: ((: MON=09: value too great for base (error token is “09″)
So, do this
MON=`date +”10#%m”`
((MON=$MON-1))
echo $MON
8
How entertaining - bash treats the leading zero as an indicator of octal.
Same would need to be done for any of the `date` formats that return leading zero as part of the result.
to get the seconds since EPOCH for other reasons -
date -r $((`date ‘+%s’` - 86400))
This version has no problem with the boundary condition of month number 1
MYDATE=`date +”%Y%m”`
YEAR=${MYDATE:0:4}
MONTH=$((10#${MYDATE:4:2} - 1))
[[ $MONTH == 0 ]] && MONTH=12 && ((YEAR–))
theReport=Web-Report-Monthly-$YEAR-$MONTH.html
This is where the Terminal’s edit menu comes to the rescue. Indeed, since the Panther days, it features a “Paste Escaped Test” item, allowing you, with one swell key combination, to enter any path you desire, no matter as complex, all with\ the\ right\ escape\ characters\ in\ place.