Computers & Tech posts page 13

back on mac os x

I guess I forgot to mention it, but my server is back to running the mac os, and it has been for a good while now. My brother had sent the install DVD finally. I erased the old partition and installed the OS cleanly, then copied over my files from backup, which I’m glad I’ve finally been doing. Of course, I could have backed them all up before wiping the drive in this instance, but it could have been worse, and there may have been some file corruption of some sort.

Unfortunately, I forgot to backup some of the files that weren’t in my home folder. Mainly game related stuff. I lost nearly my entire collection of video game ROMs, which I’ve been having trouble finding now. I also lost some game saves, including some EVN ones that I had spent some time setting up. This has led me to start doing an occasional backup of the entire boot drive. This was made possible by my purchase of a 120GB drive.

I have recently purchased a new computer for use for myself. This one will become server only. I may take it back to linux once again for less overhead and what not. The new computer is just an updated version of my iBook G3, an iBook G4. It will be nice to again be able to take my computer elsewhere without taking down the server.


mac drive troubles; now using ubuntu

A few weeks ago, I came home and my iBook crashed. One app after another gave me the spinning beachball of death, until I could do nothing but move the beachball. I restarted, and no startup disk was recognized. I restarted several times to no avail. Finally I shut down and then started it up. It booted, but then all the apps quickly started crashing again.

I booted using a Techtool 4.0.1 disk. It was ridiculously slow. The volume structes test took 8 hours, and told me I had a problem and needed to rebuild the structures. I told it to do its thing. It took another 8 hours. Rebooting after that, my disk was no longer found again. I gave up on the problem then, and decided to install linux so I could get my server up and running as quickly as possible (see below).

Later, I got a new version of Techtool from my mom that was on a thumb drive. It allowed me to do much more, such as run disk utility and a terminal window. Disk utility could not fix the disk though and I couldn’t access it with terminal. I ran its test of the volume structures. It was crazily faster than the other one, taking perhaps 10 minutes for the test. It went so fast I felt hopeful it could fix it. It said there was a problem. I fixed it and ran the test again, but unfortunately it said there was the same problem as before, a directory node missing or something like that. I tried fixing and retesting a couple more times, but it gave the same problem every time.

I can access the files from linux, but have had no luck writing to the drive. I imagine the old version of Techtool, as it was from the early days of OS X, did not know how to properly handle the current volume structures, so it messed them up. I think I will need to reformat the drive and reinstall everything. Luckily, after my previous drive problems, I have been backing up most everything weekly. I shouldn’t lose anything, though I do want to look through the drive before I erase it just to make sure. I also want to try to find a way to only reformat the partition affected, so I don’t lose my linux setup or any of its data. I’m not sure how to do that for HFS+ without buying another utility.

Linux

I had burned a Gentoo and Ubuntu CD a couple of years back to mess around with. I never got either installed then, but this time it was more necessary. I tried installing the Gentoo. The installation is not directly guided at all; I had to open up a webpage (luckily the internet was no problem to get working) in one terminal window (no gui) and carry out the steps from the instructions in another. I was going along alright, but some of the choices were a little confusing. I came to the point where I had to compile my kernel, and decided I was spending too much time with Gentoo. Ubuntu was supposed to be quick and easy to install, and this was only to be temporary anyway.

Ubuntu provided a guided, GUI install that was fairly easy. The only problem I had was choosing the (prebuilt) kernel, as the default one didn’t work. I got that up and running, and it started up easily with a GUI and the internet working just fine. It was the desktop version, though, so no server stuff was installed. I was able to install apache2 with the package manager, but could not find php 5. I had converted all of my site stuff to mysqli, so I needed php 5: I certainly wasn’t going to go through my files and change all the pertinent lines for a temporary server. Searching the web, I found php 5 available for the Edgy and some other versions of Ubuntu. I was confused as to what those different versions were, at first thinking each one was of a progressively more unstable branch. I changed my repositories that I was getting packages from to one that had php 5, after figuring out how to do that. It wouldn’t let me install because it said there were some dependency problems. By this time I figured the different word versions of the OS were actually newer and newer revisions, like Jaguar and Tiger for OS X. So I figured if I installed the entire new version with the package manager, then all the dependencies should be met. It took quite some time to download and install all those files, and it gave some errors before completing. At that point, things like the GUI started breaking. I tried hard to fix the problem, including manually removing some package files, but it kept giving me errors.

I got the GUI back up and running just so I could burn another CD of a new version of the OS. I figured that then all the dependencies should be met no problem. I downloaded not quite the newest version though, as the newest couple of versions didn’t seem to mention the need mysqli in their depository (I now think mysqli is installed automatically with the mysql php extension in these versions). I downloaded the server version so that I could hopefully have a server running right from install. It took me some time to find a program that would let me burn a CD, but I finally got it burned.

Installing was about as easy as with the Desktop version, save for one screen where I had to manually select to install the web server, which I skipped the first two times through. To my delight, after the install, not only was an apache 2 server up and running, but so was a MySQL server, and PHP 5 with mysqli was already installed. After figuring out how to mount UFS (that took some time as well), I copied my site files over to the linux partition and easily got my site running.

Unfortunately, the server version wasn’t set up out of the box for my own regular use. It had no GUI at all. I used the package manager to install KDE, as KDE seems to have more applications that come with it. It took a good bit of time to set that up so it would actually work. It didn’t just work like it had when the desktop version was installed; it took some messing around with configuration files. When I finally got that working, it still was not working fully properly; I still have a desktop that is bigger than my actual screen, so I have to drag the mouse to the sides and move it to see the rest. This is very annoying to work with. I also have no sound. Other than that, though, it works just fine.

Linux seems to work quite nicely. It has plenty of good applications available, of course for free. I was able to work with all my important Excel files in OpenOffice with the only problem being that if I made changes, I had to save them in the OpenOffice format. I was surprised that the Control-enter functions worked. After downloading several extensions, I’ve been able to get firefox to work mostly the way I want for browsing. Safari still works better in some ways as I had it set up, but there are a lot of cool things that can be done with firefox extensions that can’t be done in Safari. Kate is a very nice text editor, though unfortunately I’ve not been able to find anything with live PHP previews like Taco Edit. It of course has desktop paging, which I never got working nicely in OS X. App launching has been a problem though. I’m used to Butler. Linux has Katapult, but it is not nearly as good and is very slow. File browsing is quite nice for the most part. The image browsing capabilities of Konquerer far exceed those of the Finder. I miss the Next-like columns view though.


Workgroup Manager

For a long time I had wanted to be able to manage the groups on my *nix OS so that I could better manage access to files. The functionality is very limited in the OS X gui, and I couldn’t find command line stuff that worked. Finally, I found out that some of Apple’s server utilities are available for download for free, and work with a regular install of OS X. One of the utilities is called workgroup manager. It allows you to create groups and add users to them. So I can now create groups for specific projects or purposes, add the users involved to the related group, and make all related files owned by that group so the users have proper access to those files.


finder desktop views

similar to desktop paging type applications – these allow you to switch between several ‘desktops’ each with a set of windows or designated applications. This would be like the ability to save these desktops, but including the ability to include windows in a ‘desktop’ view that might be visible in other desktop views as well.

one would have a large collection of views, that, upon opening, would launch requisite applications and open windows, possibly moving them to certain positions, and possibly filling them with certain contents (such as a certain finder directory or the last edited project file), and hiding all other windows. One could quickly switch between these as in normal desktop paging. One could leave multiple open, or quit some. When quitting a view, all windows in it are closed, and the applications involved in that are quit if they are not open in another view (a la adding to and removing from a retain count).

due to the nature of these views, there will be many more to choose from than would be in a normal desktop paging system. Therefore, a different access method would be good. I’d propose a list accessible via button and keyboard shortcut. When opened, this menu would work like a normal menu, but all keypresses would enter into a search field and would work to narrow the list items via a search through it. All currently open view items would be highlighted in some way, and could be filtered into this list. One could also quit all open views. This would then open the default view, likely a finder one with windows or just a view of the desktop.

in using a computer, there are many different sets of tasks that a user might perform. some or many of these tasks might cause the use of a certain set of windows, perhaps even setting them into a certain pattern for ideal use. They often span multiple applications, so that a single application properly sorting its windows would not be sufficient.

stub, sorry I’m tired, I will have to revise this jumble later.


>console is back

Hey hey, it’s back. For quite some time I would boot OS X into ‘console’ only when not in need of GUI type stuff. At some point in the OS updates, around perhaps 10.4.3, this stopped working, I believe because of a security risk related to it. Once installing that update, I haven’t used that capability, until just recently. I don’t know when it happened, but I currently have 10.4.9, and it works perfectly. I hadn’t noticed before, but doing this leaves all windowserver related processes turned off, so all of that memory is freed. To get back to the GUI, typing exit will bring you to the normal login window. I am quite happy. I am posting this from in >console right now, with lynx. Unfortunately, lynx isn’t very nice for posting in wordpress. I may have to clean up this post later with a GUI.


finder views saving

The list view of the finder is good for looking at information about files. I use the column view for browsing, as it shows the hierarchy better and is faster to use, but for information I list. I find myself frequently changing the view settings of a window in list view depending on the information I am interested in. I might want to calculate folder sizes and sort by folder size to see where all my disk space is used. I might want to look at the comments field to see what I’ve said about the files. I don’t always want the processing power usage to calculate folder sizes or the screen real estate of all these columns viewable at once. It’s a pain to set these list views up each time. The dsStore files will save the settings for a single folder, but in general I’d want these settings the same for all folders. All folders contain files and folders, and I have similar information to view about all of them.

I think one should be able to save a view setup that can be applied to any window. Setting a window to the view should be simple, such as with a submenu off the list view menu item, a small menu icon somewhere on the window, and/or a contextual menu. They’d simply have user designated names preferably describing their function. This all would become much more relevant if the list view could have columns with other metadata, such as author, status, or owner.


automatic 3rd party software update

The OS would have a standard system for developers to implement an auto-update feature for their 3rd party apps, making it easy for them, consistant, and simple to ensure all apps are up to date for the user.

Each installed app would register its name, .app path, current version, url for update information, etc. For all apps released prior to this OS and library feature, much of this info would have to be added manually by the user. New apps could possibly add themselves on first launch, asking the registry on launch if they are registered. This would not allow currently existing software to register, so these apps would have to be registered by some other means. Probably a better solution that would support both new and old apps, as well as not need a specific call to be added in the apps code, would be to have the registry check for the name of the app every time an app is launched. If it is not in the database, it could ask the application for the information. Current apps wouldn’t provide this, so it would have to bring up a dialog alert window in which the user would enter as much of it as known. It could be updated by the user later. Since some people download apps just to try them, then delete them, these apps should be removed from the database. This could be implemented to be done automatically. On each update check, if no .app is at the path specified, then the app was probably deleted and can be removed from the registry. Also, the user could specify an interval after which dormant apps could be removed from the list, something like a month or so. If either of these remove apps that are still desired by the user, they will be re-added to the registry on next launch, and will then be checked on next check anyway.

The developer would use a standard method, perhaps one of several, to post the current version and the files for download on their website. The url would be provided by the app, as stated above. The information at the url would have to be standardized so that the updater could parse it to get the information needed. It might contain just the current version in a tab delimited text file, listing version number, url to file parts or perhaps script to get them, update history (in case the user wants to review the update before doing it), etc. It might also be a list of all versions with this information, each version seperated by a new line appended to the file. Some developers would add the new line to a text file by hand, while others could have a script update it, or a script serve it. The file parts would have to be in a standard format as well, so that the updater app could handle them easily. It could be simply a .pkg, with all modified files stored in their destination paths inside.

The funcionality would probably be added to the software update application already used for the OS vendors software. The third party stuff would be kept somewhat seperate, to ensure things like security updates to the OS were given greater precedence and what not. The user would have seperate preferences to set for handling 3rd party apps, including whether to maintain a database at all, whether to update automatically or ask permission first, seperate update interval (could be ‘same as system updates’ though). The user would be able to view a table of all registered apps with information on them such as current version, if installed version is current, and an editable list of the app name, path, and update url. Clicking on each line item would provide additional information provided from the server, such as a revision history. All information would be stored in a database to save on disk space and be faster than a collection of files for each app.


quicken files and rsync

Backing up quicken files via rsync evidently doesn’t work: the resource forks are destroyed, which the files “need”. Files saved in this way will just give an error message when opened in Quicken, “Unable to open file.” However, the data is not lost at all. The data file is actually a package. If you show package contents, you will get to the actual data file (/Data\ File/Contents/Data\ File). To recover this data, use vim or some other text editor that can handle the data properly. TextEdit or many other similar programs won’t work. You need to get the Contents/Data File from a working data file, perhaps a newly created one. Yank all the data from the file with your data in it: there are a lot of lines, so ‘500dd’ or something like that will get them all, or simply using the graphical version to select all. Then open the working file and replace all with the yanked lines. This worked great for me.

After my recent hard drive crash, I had to use whatever I had backed up. Quicken wise, I had backed up about 15 days before the crash using rsync. I also had an old file from nearly a year ago. Unfortunately, because of my saving methods, the data in both seemed to be from more than a year and a half ago. I soon discovered that the recent data file had been rsynced to the inside of the contents of the data file I had intented it to replace. This was the actual recent data file. Unfortunately it would not work. I searched the web for solutions, but no one seemed to have one. I did get information that the resources were removed by rsync, however. I decided to figure out how to put the new data into a data file that worked. Simply copying via the finder the Contents/Data\ File didn’t work. I tried replacing the contents via TextEdit, but that didn’t work either. I tried modifying a single line in the working data file with vim, and that worked. I then tried replacing the whole file contents, and that worked well.


Boot to console

I’m working on getting my computer to boot to a text console at startup instead of GUI. I had done this with previous versions of OS X, but never got around to it since installing Tiger. I really just want to figure out how to do it, but I could save some memory and a little bit of CPU time, and add to the coolity of startup by getting this to work.

In /etc/ttys, near the top, there are two lines that say console followed by some stuff. I commented out the second and uncommented the first. I have the verbose flag set as well (sudo nvram boot-args=”-v”), twice actually, but this doesn’t work once I change the line in ttys. I get the starting mac os x progress bar, which goes on forever instead. If I hit command-V to boot to verbose at startup, I can get to console. I read someone say that the progress bar screen is simply covering up the console, so I will look into disabling it. I don’t want to have to hold down command-V every time I restart, with penalty of having to hard-restart again if I forget.

For some reason, logging into >console doesn’t work in Tiger. I simply get an error message, then have 30 seconds or so to sit and wait till the login window reappears.

I should update this once I figure more out.

[Update:]I renamed /usr/libexec/WaitingForLoginWindow. Now boot goes through verbose startup direct to a console login prompt, which often has some additional startup messages after it. Thus startup is fine now. I got a startaqua script gathered from macosxhints.com that allows me to start up the regular mac interface. See http://www.macosxhints.com/article.php?story=20030716220410216 for the script and other instructions/discussions relating to this modification. The script must be run by root.


Excel: CSE formulas

I found a strange and for some reason hard to access feature of excel. Functions such as ‘sumif()’ allow you to sum one column based on the content of itself or another. But some very desirable formulas are too complicated for sumif().

One possibility is multiple condition columns. Typing “=sum(if(a1:a100=’Red’,if(b1:b100=’June’,1,0),0)” should be a good formula to count all flowers that are red and bloom in june in the proper table. It should sum the range the results of the first if, which will be 1 if both ifs are true, or 0 otherwise. But excel doesn’t understand this, and can’t normally handle ranges in non-ranged functions.

Another example, which I discovered this by (something like the above is the example I found that allowed me to figure this out, thanks http://www.mrexcel.com/tip011.shtml ), is to sum the totals of only negative numbers in a column. I wanted to do this for a worksheet I have monitoring the amount of gas I have used from my propane tank. One column has use, which is negative if it was filled. I wanted to sum all fills. Sumif() didn’t work at all, so I tried (based on Mr. Excel’s example) to put “=sum(if(a1:a100<0,a1:a100,0))”, but that didn’t work either.

The solution to allowing Excel to handle ranges in regular functions is simply to hit control-shift-enter after entering them. Suddenly, they work properly. The formula then has curly brackets around it in the formula bar. Every time the formula is changed, you must hit control-shift-enter. If you hit regular enter, it will revert back to a non-functioning function. You must click on the formula in the formula bar to get this to work again.

I don’t know why Excel hides this functionality behind a rather unknown and unusual key combination. The functions are worthless otherwise, so there is no reason to have the non-CSE functionality when entering these functions. They add a great amount of power to the analysis of data, allowing many of the possibilities that otherwise only real databases would allow.