Some days I am more clever than others. Today, I was working on digitizing about 50 older (30 years old) cassettes for a linguist. To organize the data I have need of creating a folder for each tape. Each folder needs to be sequentially numbered. It is a lot of tedious work - not something I enjoy.
So I looked up a few things in terminal to see if I could speed up the process. I needed to create a few folders so I looked up on hints MacWorld:
So I looked at the mkdir command, which creates new folders or directories. It uses the following syntax: mkdir folder1 folder2 folder3
Now I needed a list of the folders I needed... something like 50.
So I created a formula in a google spreadsheet using the Concatenate command. I was able in one column to add the Alpha characters I needed and in the next column I was able to add the sequential numerics I needed.
Now I had a list of 50 names of my folders, but I still needed to remove the return characters which separated them from each other to allow the mkdir command to work. So I opened up TextEdit and did a search for return tabs in the document and deleted them.
Now I could just paste the 50 folder names in terminal and hit enter and it created 50 folders... But I wonder if there was a way to add sequential numbers to a base folder-name in terminal without using google spreadsheets...
Three years late this answer would have been what I was looking for: https://askubuntu.com/posts/731730/revisions from: https://askubuntu.com/questions/731721/is-there-a-way-to-create-multiple-directories-at-once-with-mkdir
I have been thinking about using a MacMini as a media / web server. I wonder if there might be some long-term financial benefit to running the server at home, with higher levels of RAM. Rather than paying an annual cost for a hosted solution.
There are several articles which have been interesting on the matter.
I have been looking for a decent coding application for OS X. I don’t do it fulltime. And I want something intuitive to use, simple to discover the workflows in, and has syntax highlighting. I do CSS, xHtml and am getting into some PHP. I don’t favor Aquamacs‘ command-line-like interface when saving documents.
Time Machine is a life saver. I was backing up a machine recently and error was thrown. Indicated in a form like this message (this message occurs on a machine running Lion and I am running Snow Leopard 10.6.5).
Error From Time Machine
Due to the suggestions by James Pond[1] James Pond. 8 August 2011. C3. Time Machine – Troubleshooting. http://web.me.com/pondini/Time_Machine/C3.html. [Accessed: 9 October 2011] [Link] , I found that there was a widget called Time Machine Buddy[2] James Pond. 16 August 2011. A1. Time Machine – Troubleshooting. http://web.me.com/pondini/Time_Machine/C3.html. [Accessed: 9 October 2011] [Link] . I downloaded the widget and it told me what the offending file was. I deleted the file and happily backed up the rest of my drive. I don’t know what caused Error 11 or exactly what that is but, the deletion of the file, which was not crucial to keep, allowed me to continue.
In a recent (2010-2011) Language Documentation Project we decided to also collect GIS data (GPS Coordinates), about our consultants (place of origin and place of current dwelling), about our recording locations and for Geo-tagging Photos. We used a Garmin eTrex Venture HC to collect the data and then we compared this data with GIS information from Google maps and the National GIS information service. This write up and evaluation of the Garmin eTrex Venture HC is based on this experience. Continue reading →
I had an OS failure while I was in Mexico. I managed to reinstall the combo update and things started working again. However, some of my big files (movies) will not copy, Time Machine fails, Some PDFs are now failing to copy. It always comes back to a -36 Error. I cannot find the error report for this online. It seems to be some sort of I/O error. I left a comment over on this blog.
prompt%> mv /Users/phil/Desktop/movie.avi .
I tried the command line mv command and the command line told me Input/Output error.
Failed mv
But I can play the file on my harddrive. – I have the same error if I try to copy the file to somewhere else on my internal harddrive.
Using OS X 10.6.5 on MBP 15″ moving the file to a WD My Passport via USB. The file in question is a .mts movie file. I can move other .mts movie files which were made with the same camera, at the same time, and are in the same folder to the external hardrive.
Error -36
I can’t figure out why I have this error or how to solve it.
Last night at about 9 pm Camino Crashed… and the whole house came down with it.
Camino had been asking me to update it for several days. I was running at 2.0.0.6 and it wanted to update to version 2.0.0.7. Well, this crash, lead another app to crash, very unusual, considering the isolating nature of apps on OS X (I am running OS X 10.6.5). So I decided to reboot the OS. This lead to OS X booting and getting to the sequence of initializing the mouse, the cursor could be seen. However, instead of proceeding the screen would switch between blue and a lighter blue (this is the blue after the gray screen in the OX boot sequence). Not cool. So I reset the pram.
Hold down ⌘+⌥+P+R during start-up and wait till the second chime is heard. Then let go.
Still no progress. So I booted up in safe mode and went to disk utility to repair permissions. This is where I found out that several of the OS X language packs and Java had permission errors. So I repaired those permissions. Still no joy.
So I looked for an alternative and found out about booting OS X in single user mode.
Hold down ⌘+S during start-up.
Then I followed the instructions on running FSCK. I tried this several times and had no joy.
It booted to target disk mode. But then would not appear as an external disk on any Mac I plugged it into. I tried three different Macs.
The I tried to boot from a retail OS X Snow Leopard install CD/DVD.
Hold down the C key during boot.
Can not see the disk.
Then I tried to select the boot disk by booting to an option menu.
Hold down the ⌥ key during boot.
I can see the Install disk in the options but I select the option and the machine freezes.
I then called Apple Care. I got on Skype and called the 1-800 Apple Care number from Mexico. And told them the problem and then told them what I had done and asked if an archive and install but reinstalling OS X 10.5 and then up grading to 10.6 would work. They said that was not the recommended way but might be a possibility. I asked them if there was anything more that I could do. They said, no you have tried everything that we would have suggested over the phone. Knowing what you know you might have worked for Apple before. They then asked me if I wanted to schedule an appointment with a genius. I replied that I was in Mexico and I would not be back in the States for another month.
So I decided to try and get a Time Machine copy of my hard drive and repair the hard drive. No luck, Time Machine stops with a corrupted file. Then I decided to use Carbon Copy Cloner to copy the drive and fix the cloned drive. I get to a corrupt file and it stops too. But at least it says that the file /Applications/Camino.app/Contents/MacOS/libssl3.dylib was corrupt. Someone else has had this problem too. I downloaded and reinstalled the current version of Camino. I reboot and it gets past the Blue and Gray screen to the login options. I log in an it starts the startup items but then kicks me out to the login screen again. Better but no fix.
I am still struggling with this. I found this on the Apple forums and have cleared the Cashe folder indicated and have removed everything from the startup menu. Still no joy. This was in response to the following thread on Apple’s forums: After 10.6.5 cannot login or boot from DVD or clone .
A friend loaned me a USB hardrive and installed OS X to the harddrive, and made it a bootable disk. It boots just fine. So it does not appear to be a hardware issue. However, when I tried to use migration assistant to pull my files over to the external drive, but migration assistant didn’t make progress after about 10 hours.
We have yet to see what the solution will be… I also am looking at MySQLCOM. So it appears that some start up items’ permissions got mixed up. This post explains how to reset the permissions to root.
I got my computer working again by re-installing OS X 10.6.5 Combo installer. And resting the permissions for the Startup Items via the terminal.
One of the most popular Citation Management software applications among academics is the application Endnote. Endnote has a long history is published by a reputable company, and has some pretty cool features. I use it (version X4) primarily because it is the only citation softwareThere is other citation management software for OS X which claims integration with pages but none of these solutions are endorsed or supported by Apple. Some of the other applications which claim integration with Pages are:
Papers – This is according to Wikipedia, but I own and use Papers 1.9.7 and have not seen how to integrate it with Pages. (However, Papers2, released March 8th, 2011 does say that it supports citation integration with Pages.)
which integrates natively with the word processor Pages, by Apple, Inc. The software boasts a bit of flexibility and quite a few useful features. Some of the really useful features I use are below.
Customizing the output style of the bibliographies.There are several Linguistics Journals with style sheets on Endnote’s Website. Among them are:
Research Notes section in the citation’s file for creating an annotated bibliography.
Copy our all the selected works, so that they can be pasted as a bibliography in another document.
XML Output of Citation DataThe XML Support of Endnote has not been hailed as the greatest implementation of XML but there are tools out there to work with it.
However, regardless of how many good features I find and use in Endnote there are several things about it which irk me to no end. This is sort of a laundry list of these problematic areas.
Can not sort by resource type: For instance if I wanted to sort or create a smart list of all my Book references, or just Journal Articles. This can be done, one just has to create a smart list and then set Reference Type to Contains: “Book Section”. There is not a drop down list of reference types invoked by the user.
Can not sort by custom field: I think you can do this in the interface. Though it was not obvious on how to do it.
Endnote Display Fields
Can not view all the custom fields for a resource type across all resources. This seems to be limited to eight fileds in the sorting viewer at a time.
Can not view all entries without content in a specified field. This would be especially nice to create a smart list for this.
No exports of PDFs or exports of PDFs with .ris files.
There is no keyboard short-cut to bring up the Import function (or Export) under File Menu
Does not rename PDFs based on metadata of the resource. This is possible with Papers and Mendeley. The user has the option to rename the file based on things like Author, Date of publication, etc.
Can not create a smart list based on a constant in the Issue data part. I have Volume and Issue Data. Some of the citation data pulled in for some items has the issue set as 02, 03, etc. I want to be able to find all the issues which start with a zero so I can remove the zeros. Most stylesheets do not remove the zeros and also do not allow for them.
Items are not selectable based on Issue Data
Can not export PDFs with embedded metadata in the PDF.
Can not open the folder which contains a PDF included in an Endnote Library.
Endnote does not have a way to open the containing folder of a PDF
Close-up of the same menu.
Modifying Resource type does not accept |Language| Subject Language|
There is no guide in any of Endnote’s documentation for how to create an export style sheet. This is in the Help Menus I was expecting it on the producers website or in a book.
When editing an entry’s meta-data i.e. the author, or the title of a work, pressing TAB does not move the cursor to the next field. At least some times it does not continue to TAB. If I do a new entry as a Journal article, then it will tab till the issue field, but not beyond. It gets stuck.
There is no LAN collaboration or sharing feature for a local network solution.
There is no Cloud based collaborative solution.
There is no way to create a smart group based off of a subset of items in a normal group. i.e. I want to create a smart group of all the references with a PDF attached but I only want it to pull from the items in a particular group (or set of groups).
Endnote has no option for 'part of group' filter
There is no PDF Preview within the application. The existing Preview is for seeing the current citation in the selected citation style. (Preview of the output.) It would be helpful if there was also a preview pane for viewing the PDF or the attached file.
We want to be able to run the OSX provided Wiki, Calendar and Blog features of the WebService. In addition we want to also run Mercurial (http://mercurial.selenic.com/) and RefBase (http://www.refbase.net/).
We want to run:
OSX services at mephaa.xyz
Mercurial at: hg.mephaa.xyz
Refbase at: ref.mephaa.xyz
These sites are for our work group only, they need not be accessible to the outside world. But if in the process we can make our setup of such a nature that an invited guest could collaborate with us on our project and view our workgroups’s collaboration area that would be ok. We will be using the MacPorts version/method of running mercurial. Aside: Since I originally started out to resolve this challenge I have acquired mephaa.org, as a real registered domain.
Network layout:
Mephaa LangDoc Program Network Diagram
We have a dynamic IP from our neighbor’s router. (We share the line and they are up stream. That is just the way things work in this location in Mexico. They are in turn connected to the ISP.)
The connection from the neighbor is hardwired to the WAN port on the Airport Extreme. The Airport Extreme is using NAT & DHCP (see settings below). I have 9 machines connected to the Airport. One of which is the MacMini server. It is the only one that is hard wired to the Airport. The rest are laptops that connect wirelessly.
The MacMini is assigned a stable IP address by the Airport Extreme based on its MAC address. The IP address for the server behind the firewall: 10.0.1.5.
We do not have an outside domain name that we have purchased. We just are using the name of the computer as it was set up during the install of the OSX.
I have the Wiki, Calendar and Blog features running at macminimarlett.local.
I can type macminimarlett.local in any web browser on the server side of the Airport Extreme and access the OSX provided WebServices (aka the wiki, blog and calendar.)
I would like to make the mercurial repository available at: hg.macminimarlett.local
I would like to make the refbase instance available at: ref.macminimarlett.local
These “additional” websites are hosted on the same machine as MacMiniMarlett.
§1. So What must I do to get hg.macminimarlett.local to resolve at all to anything? §2. So What must I do to get hg.macminimarlett.local to resolve to my mercurial instance?
Currently I can not get hg.macminimarlett.local to resolve at all. “Safari can not find the server”. But browsers do find macminimarlett.local.
This leads me to think that it is a problem with my OSX server settings not with my install of Mercurial.
Suggestions offered on the 20th:
Do not use .local.
Do not use .private.
Change the domain to something other than the computer name.
Computers on the LAN can find macminimarlett.local because of bonjour. Not because of any special DNS entry.
We dropped the .local and the .private and switched to mephaa. instead of using macminimarlett.. I left the macminimarlett. zone in the DNS records just incase. This leads us to the server settings on Nov. 21st.
To this point I had been assuming that .private in the DNS registry was being translated to .local in the bowsers. This was an errant assumption.
Server Settings: Nov 21st
MacMiniMarlett DNS Settings
Suggestions received from John on Nov. 21st:
Your DNS is incorrect. Run the terminal command: sudo changeip -checkhostname
You need to get this sorted out because it effects a lot services.
Here’s the crash course version: the . (period) at the end of the domain name means it is a full qualified domain name (meaning that it is real domain that real people use, like google.com.) also the primary domain record should be like this macminimarlett.com. Or macminimarlett.private. Or macminimartlett.local. (beaware that Microsoft Server 2008+ is droping .local support and you need a real domain name and public IP/dedicated IP – which means using .local isn’t future proofing).
One thing to know, the primary domain record doesn’t have to be a fully qualified domain, but it should be as everything is heading that way in the future.
At the moment your server is thinking the macminimarlett. And mepaa. Are the .com part of the domain name.
Yeah there will be a lot of confusion in the mepaa domain record as there isn’t any reverse mapping for it. And the cname record is at the .com level (layer 1) which won’t resolve very well for clients.
Next, what is the forwarder settings set to? These should be set to the ISP DNS and then to the router (you can add as many DNS servers as you like for redundancy).
What is doing DHCP to the clients? What DNS are they getting? The clients need to know where your subdomains are in the network. For example if a pc is typing in hg.macminimarlett (which is a bad idea – it should be hg.macminimarlett.private or something like that) then the pc client checks the DNS server for which server (IP address) has the subdomain hg.macminimarlett – but if the DNS server doesn’t have a record of hg.macminimarlett then the DNS server will reply with not a real address (because it doesn’t know who that is).
Regards,
Nov. 22nd.
I now realize that the syntax of my DNS entries (when and only when I am not using a registered domain name) need to be:
For a Zone: <Some Name>.<Something Unique>.
Where the above corresponds to the following: (domain name level).(TDL level).
For the domain root, which is an entry in the zone: <Some Name>.<Something Unique>.
Where the above corresponds to the following: (domain name level).(TDL level).
For a subdomain, which is also an entry in the zone: <Some Name>.<Some Name>.<Something Unique>.
Where the above corresponds to the following: (subdomain prefix).(domain name level).(TDL level).
My current entries in my DNS are not set up this way. I need to change them. Before I do that I should likely run the changeip -checkhostname as suggested by John.
I ran sudo changeip -checkhostname
And this is what I got:
changeip Results
Now my question is: is this message saying I need to run this again? What am I to do with the results of the message from changeip? I read the Manuals but that did not yield any profound insights.
I added .private to all the DNS records in the DNS service, in order to fix the syntax of the DNS records as indicated by John. After that I ran changeip again. It now shows that there is nothing needing to be changed. I think this part is now resolved.
Resolved changeip Results
Now this is what the server settings are (Noon 22nd) :
Server Settings (Noon 22nd)
Reverse Zone Name Settings
Aside: I corrected a spelling error in the DNS Records where mephaa was mispelled as mepaa. All the records now read with the mephaa spelling, as indicated in the second picture.
I got hg.macminimarlett.private to resolve from the server to a test index.html page on the server. But I could not get it to resolve from a client on the network.
Is this because I have the wrong type of records?
Is this because I am not passing the DNS records to where the clients are looking for the records?
How do I pass these DNS entries to my clients?
Is this something I have to enter in the Airport Extreme? If so which entries on which lines?
A hostname is a record of a host within the domain. For example, hg.macminimarlett.private is the hostname for the host hg within the macminimarlett.private domain.
I don’t see anything in the Server Admin titled “hostname”… There is one thing under the Primary zone that says “hostname” but what should this be set to? the IP of the computer on this LAN?
Server Admin doesn’t know what additional hostname you want for your domain. It’s up to you to create them. You create additional records (either ‘A’ records (Alias) for physical machines, or ‘CNAME’ records for additional hostnames that you want to map to an existing machine.
§7. Ok so in what manner do I add hg.macminimarlett.private. to that zone? Do I add it as a CNAME, as a secondary zone, as a Machine (A) recored?
In this case it sounds like you want to add three records to your existing zone.
One A record for your server (call it whatever you want, but server.macminimarlett.private seems to make sense). Give this the IP address of your server.
Two CNAME records – one for hg and one for ref that both point to server.macminimarlett.private.
Now you’ll be able to resolve all three hostnames, and they’ll all point to the same physical IP address. From there it’s just Apache’s configuration telling it how to deal with the different requests.
From John:
Yeah there will be a lot of confusion in the mepaa [sic] domain record as there isn’t any reverse mapping for it. And the cname record is at the .com level (layer 1) which won’t resolve very well for clients.
Next, what is the forwarder settings set to? These should be set to the ISP DNS and then to the router (you can add as many DNS servers as you like for redundancy).
What is doing DHCP to the clients? What DNS are they getting? The clients need to know where your subdomains are in the network. For example if a pc is typing in hg.macminimarlett (which is a bad idea – it should be hg.macminimarlett.private or something like that) then the pc client checks the DNS server for which server (IP address) has the subdomain hg.macminimarlett – but if the DNS server doesn’t have a record of hg.macminimarlett then the DNS server will reply with not a real address (because it doesn’t know who that is).
I am not sure what is giving DNS to the clients. I did have to put something (I think it is the IP of my neighbors router, see the image above) in the DNS settings of the Airport Extreme in order to get the Internet to be passed to the clients. So what I did was put the internal IP address of the MacMini Server in the DNS field on the Airport Extreme. I also found this interesting: http://www.dyndnscommunity.com/questions/4567/custom-dns-with-subdomain-and-airport-extreme
I used an ssh connection from the Terminal today for the first time!
Terminal
I feel like a real man now.
I needed to transfer a 106MB folder from one subdomain to another subdomain on my DreamHost webserver. It has been my experience that whenever I copy or move folders with a lot of sub-folders that something(s) do(es) not get copied all the time or all the way. So I needed to archive my files and move them as a single object. But I do not think it is possible to zip files with an FTP client (at least not with Interarchy). For a solution I turned to ssh and a lot of googling.
So to ssh into my webhost I had to enable a user from the DreamHost panel.
Press return/enter key again.
Wait for it to ask for the Password:
Enter the password of the FTP user who's username you inserted in place of the example USERNAME@ftp.yourdomain.com above.
If it asks you for the password multiple times, type in the same correct password each time.
Then you will be at the root in your Terminal window.
type: ssh username@ftp.yourdomain.com
You're logged in!
Now any time you want to log using SSH you can just repeat ssh username@ftp.yourdomain.com
from the command line (Terminal), no need to repeat the other steps.
So from here on I was in my webhost but still didn't know how to get around. Evidently I needed to use long paths so $ cd /home/username/directory would move me from directory to directory. I could not just $ cd /directory.
Once I was able to get to the directory I needed to archive, I still needed the archive commands.
I thought I wanted to use zip as my archive utility. The zip command to do that would be: $ zip -r folder.zip folder
Though my friend Daniel said that I might should have used tar gunzip tar.gz instead of using the zip command: "Zip compresses each file separately and then archives. Tar+gzip or tar+bzip2 archives first and then compresses."
The commands to use the tools Daniel suggested would be like the following:
tar+gzip $ tar -cf blah.tar folder/
$ gzip -9 blah.tar
gzip compressed tar I guess this is a combination of the above two commands. Not sure. Didn't try it. $ tar czvf folder.tgz folder
bzip2 $ tar jcvf filename.tbz folder
After the file was compressed I used Interarchy to move the single zip file to its new location. I also needed to unzip the file. (I also read this.)
To unzip the file I navigated to the directory where the file was located and then used this command: $ unzip folder.zip folder
I had to use the long path too. So it was really: $ unzip /home/username/directory/folder.zip folder