Parker MacCready: Computer Notes (most recent on top)
2/12/2015 I got a new Macbook Pro 15" and without much difficulty have moved everything onto it. In order to get it to recognize the aliases I have set in ~/.bashrc I added these lines to the existing ~./profile:
if [ -f ~/.bashrc ]; then
source ~/.bashrc # read my startup file if it exists
Then (after restart) it all works as expected. Note that this was done in .bash_profile on my previous mac.
10/30/2014 I installed the new OS X Yosemite on my mac. Still getting used to the look. Matlab 2013a did not work. Downloading 2014b from mathwork.com. License # 384658, Matlab, Stats, Signal. Now it works. Nice new graphics, especially the default colors. Goodbye jet!
7/22/2014 Yellowstone Notes:
- Info on running jobs
- To see what jobs I have running use: bjobs -u USERNAME
- To kill a job use: bkill JOB_ID
6/10/2014 I got help today on linking my Google Calendar and Contacts with those on my mac. Easy! On the mac just open the Contacts app, then go to Preferences, and click on the + at the lower left to add an account. Select Google from the list, and then provide my Google account info as requested. Then it shows a list of things you can sync, like Calendar, Contacts, Messages, and Mail. On my iOS devices (iPad and iPhone) it is similar but you start by going to Settings => Mail, Contacts, Calendars and then under Accounts choose Add Account. Then the rest is the same. I also got rid of my old Exchange account, with no ill-effects. Works great!
3/26/2014 I decided to start using the bash shell on fjord, instead of tcsh, mainly because (i) it is what I use on my mac, (ii) it is what the Linux Bible I am reading says is more standard, and (iii) it was assumed to be the case when I installed the Enthought-Canopy-python software on fjord. It was easy to make the switch, just added (and reformatted) the aliases in .bashrc, and the MATLAB license line.
3/21/2014 To make a png from any image on my mac screen, type:
and then drag a rectangle from the dot it makes out of the cursor. When you release it creates a file "Screen Shot (dateinfo).png" on the Desktop. Cool!
10/24/2013 On making Matlab figures that you can edit in Illustrator: Neil suggests using the -dpdf print option, with this caveat: "this [graphics aren't vectorized] happens sometimes with very large pcolors, in which case there's an option (-dpainters?) to force matlab to vectorize. Other than that, this has always worked for me. There's always some amount of ungrouping and Object -> Clipping Mask -> Release required in Illustrator to actually get at the component objects."
10/16/2013 Regular expressions in linux (useful for example when trying to scp a selected range of history files):
ocean_his_40[0-9][0-9].nc expands to cover files 4000-4099
Also, you can extract selected files from a tarfile, using syntax like:
tar -xvf Cdia2005.tar --wildcards 'ocean_avg_*.nc'
9/26/2013 I decided to try a citation manager, so at Sarah's suggestion I am using RefWorks (online, supported by the UW libraries, info saved in Gmail - Software). It appears as a URL on my Safari Bookmarks Bar. To logon use "My Institution's Credentials (Shibboleth)" which will bring up a UW NetID login page. This shows a list of the references I have already imported.
To get new references one way is to go (through the UW Library Site) to Science Citation Index, and when presented with a list of papers (e.g. from the citations of one of my papers) at the top or bottom of the page is a button to allow me to mail the records as a text file to myself.
Now in Gmail, copy the text from the email, and in RefWorks select Import => From Text, and then paste in the text (and select the appropriate Import Filter and Database) then click Import and there you are.
** This seems awfully complicated. There has to be a simpler way! **
3/12/2014 Note from Sarah Giddings, "Most sites these days have an automatic export to refWorks link which so long as you are logged in to refWorks will export the entire citation there automatically."
8/29/2013 How to get the MathType roolbar to come back in Word: View => Toolbars => MathType.
7/19/2013 Big Dropbox problem yesterday: for no apparent reason all my shared folders disappeared, one after another. Prompted by this I moved all my remaining folders out of Dropbox. Then I was able to "rejoin" my shared folders (odd since in many cases I was the one who had originated them). I also was able to recreate all my nonshared folders - again from the Dropbox site. One problem was that my folder of Proposals ended up with only the one Shared folder, instead of the 15 or so that it had originally. Luckily I had saved the original.
7/17/2013 On my iPhone I got tired of having new mail show up in Mail when I only use Gmail. so I went to Settings -> Mail etc. -> Accounts -> firstname.lastname@example.org where I turned the Mail button to OFF (left Contacts and Calendar ON). Seems to be working as hoped - did the same on my iPad the next day.
7/9/2013 I downloaded a free LaTeX program, TeXShop (a graphical interface), from here: http://pages.uoregon.edu/koch/texshop/obtaining.html (I got the 4.3 GB MacTeX.pkg). For some reason the installation failed!
6/19/2013 After a Java update yesterday MATLAB R2012b stopped working (desktop came up but would not respond to any input). Calling MATLAB help (who were very responsive) revealed that this was a real problem that they were working on, and it could be solved by updating to R2013a - which I just did and it fixed things. The product download site was also having difficulties, so along the way I had to update my Java at java.com, and install Firefox, and then download MATLAB using Firefox. For future reference, the license number for MATLAB on my MacBook Pro (bought 1/2013) is 384663.
5/29/2013 Following these instructions from David Darr:
You will need to install the Mac version of VirtualBox (which you can get here --> https://www.virtualbox.org/wiki/Downloads) and then get the virtual machine image here --> http://is.gd/MosNIh. Once you bring up VirtualBox then you import the VM (virtual machine image) via "Import Alliance" (under the "File" tab) and then import the .ova file). What this does, in a nutshell, is run a "virtual" version of Linux (Ubuntu Linux, a variant of Debian Linux) on your machine.
I now can run a nice X-window of the linux machines on my mac.
Just launch the Virtual Box application, and then select the LXTerminal and logon using, e.g.:
ssh -X email@example.com
and then execute the command "nautilus" and it will bring up a file browser.
4/19/2013 I couldn't print pdfs in Safari - like journal articles. After searching the web I followed someone's advice and removed the file AdobePDFViewerNPAPI.plugin from "/Library/Internet Plug-Ins" and now it works fine! Note that the file AdobePDFViewer.plugin is still in that folder and I assume this is what is being used.
1/10/2013 Migrating to a new MacBook Pro "PM3" (13" Retina display).
8/15/2012 To make the code view font readable in Dreamweaver you can set it in Preferences > Font > Code View. I changed it from 7 to 10.
8/14/2012 How to make an animated gif:
First make a folder with a bunch of jpeg's, like I do with pan_plot.m.
Then, in Photoshop (CS5.1) do File > Scripts > Load files into stack and select all the jpeg's that you want in the movie. Next, do Window > Animation which brings up a wide, short window. At the top right of this is a think you can click on to access some commands. Use this to execute (1) Make frames from layers, (2) Select all frames, and (3) Reverse frames (not sure why this is needed, but otherwise my movies seem to go backwards!). Then click on a thing on the bottom of one of the frames (in the Animation Window) to set the time interval, e.g. 0.2 seconds. You can also set the number of repetitions there. Finally do File > Save for web and there you can reset the size and save it.
To look at the result, open the gif with Safari.
5/31/2012 I installed OSX Lion on my two laptops (MacBook Pro and Air). This was so I could use the features in iCloud to sync music and photos across all my machines. The general goal (much of which is already achieved through Dropbox) is to have my machines (and to some extent iPhone and iPad) automatically mirror each other, and to be able to work seamlessly on any of them. This also is moving toward having all backup done by having multiple machines, and by backing up to the cloud as well. Some notes on the process:
- The installation was fast and easy. Had to update java runtime to get Matlab to work again.
- I turned on iCloud on all my machines. I still haven't worked out how to deal with syncing Mail, Calendar, and Contacts. Currently I do these with some success using other tools (I think using Microsoft Exchange to sync with my Gmail and Gcal and contacts.
- I bought a year of iTunes Match so that all the music on my two computers and phone would sync automatically, and so it wouldn't matter which I was using when I bought the music. One quirk is that you still have to manually tell iTunes to download the music to the local disk if you want it to be available when you don't have internet.
- I enabled Photo Stream in iPhoto, and places a pile of photos there (it will hold 1000) and these appeared on my Air and iPhone. The main photo archive (some 6000+ photos) is still on my Pro, and backing this up is an outstanding issue if I am giving up on using Time Machine. NOTE: I backed up my iPhoto library to an external disk on 8/15/2012.
- Fugu no longer works and I installed Fetch instead (bought from the App Store - most quickly reached right under the Apple symbol, upper left).
- My Dreamweaver site, like all my personal files, is synced already by Dropbox. In Dreamweaver on my Pro I exported my site settings (Site->Manage Sites->Export->Save my settings) and then imported it in Dreamweaver on my Air. It asked me to redefine the root folder for the site, and then it worked perfectly.
- Goal: I'd also like to be able to use SourceTree on my Air to push changes to my Mercurial repositories.
5/17/2012 New note on installing Quicktime 7 Pro (on my Air which has no Snow Leopard install DVD): just go to http://store.apple.com/us/product/D3380Z/A and you can buy it directly. Oops, I still had to download it first, which I was able to do from here: http://support.apple.com/kb/DL923.
5/2/2012 Working in the Terminal on my (two) macs I added various aliases to my .bashrc, but in order to get these to be seen I also added a .bash_profile to my home directory that instructed the (bash) shell to source my .bashrc on startup. Now it works.
In contrast, on waddle my shell is tcsh, and setting of aliases is done in ~/.cshrc.
8/12/2011 I am trying to use Dropbox to sync my Safari information (like bookmarks) between my macbook pro and my air. So I took the suggestion from http://wiki.dropbox.com/TipsAndTricks/SyncSafariBookmarks and did this:
1. Move the folder ~/Library/Safari into your Dropbox (on my macbook pro)
2. Make a symbolic link from the old location to the new Dropbox location. You can either use the terminal and type
ln -s ~/Dropbox/Safari/ ~/Library/Safari
Then I went to my Air and put its ~/Library/Safari folder in the trash, and then executed the same "ln" command. Does this work? YES it seems to!
8/14/2012 I decided to have OSX Lion handle this instead, so (on my Air) in the terminal I executed
to remove the symbolic link. I also moved the folder ~/Dropbox/Safari to the trash since there seems to be a working ~/Library/Safari. Seems to work. I had to turn the bookmarks synchronization off and on again in iCloud on my Pro to get it to work there.
6/16/2011 Finally, Design Science came out with MathType 6.7 that works with Word for mac 2011. I bought the upgrade, and it works great (also with PowerPoint). Hooray!
6/7/2011 I installed python 3.2 on my mac, from www.python.org/downloads/mac. I also installed ActiveTcl 220.127.116.11 from www.activestate.com/activetcl/downloads which is a graphics package required to run IDLE, the python editing environment. I still need to figure out how to get this version of python to be the default from the terminal window.
6/2/2011 I checked the box in matlab Preferences/General/MAT-Files to save mat files so they can be opened by matlab 7.3 and higher ("files can exceed 2 GB")
4/11/2011 I installed the software from http://perian.org/ to get an avi movie to play using QuickTime 10. Now it works. Easy! Thanks to Sarah Giddings.
3/30/2011 To run a long matlab job on skua, starting from my mac, first log on to skua from the mac terminal (no -X needed). Then cd to wherever your standalone matlab code lives (meaning that it requires no user input) and then just execute something like:
matlab < lp_driver.m > lp_out &
and you are escaped back to shell, but the job is running. I tested restarting my mac and it still was running when I came back to skua!
3/26/2011 The cursor wasn't moving in Gmail when I composed messages. I fixed it using: Go to Gmail > Settings and set the attachments to Basic attachment handling. But the downside is that now I can only attach one file at a time. Hope for a better fix later (apparently a Flash problem). NOTE: this problem seems to have gone away recently, as of 5/2/1021.
3/22/2011 After much consideration I installed the (free from UW) Sophos anti-virus software on my new macbook. It was quick and easy. I updated the software and then ran an initial scan. The scan to 37 minutes for the 227GB on my computer, and "no threats were detected." It is my sincere hope that the software does not slow performance. So far it seems good: no noticeable slowdown of matlab, possibly slower downloading attachments - but that it hard to tell.
3/17/2011 Installing Quicktime 7 on my new mac: from http://support.apple.com/kb/HT3678
To install the QuickTime Player 7 from the Mac OS X v10.6 Snow Leopard install DVD:
Insert your Mac OS X 10.6 Snow Leopard Install DVD.
Open the Optional Installs folder and double-click "Optional Installs.mpkg".
Select the QuickTime 7 option and click Continue.
QuickTime Player 7 will be installed in your Utilities folder.
and then I still had to pay $30 to upgrade to QuickTime Pro, so that the Open Image Sequence command would work, which was the only thing I wanted.
3/17/2011 MATLAB (MATLAB Version 18.104.22.1684 (R2010b)) notes for new laptop: Macbook Pro (Mac OS X 10.6.6). I deauthorized the license on my old macbook (from that machine) and then (on the new machine) authorized the new one and downloaded the software. Easy. Then to get NetCDF working, first there is some info at http://mexcdf.sourceforge.net/. Then I went to the Downloads page (http://mexcdf.sourceforge.net/downloads/10b.php) and got the version for 2010b. This gives me a folder mexcdf, containing the folders mexnc (maybe not needed) and snctools. I did not bother getting the "version 4.2 of netcdf-java from Unidata for OPeNDAP support." Then I put the mexcdf folder in applications folder, and in MATLAB added the folders mexnc and snctools to the path (just used add folder, not add with subfolders).
Reset the startup folder by executing: userpath('/Users/PM/Documents');
NOTE: the new version boots in about 4 seconds, whereas version 7.9.0 R2009b took more like 40 seconds. Not sure why. One small difference is that now all the folders in my Documents are not in my path, whereas before they were... I wonder if I used add with subfolders when I added Documents to my path? In fact I just tried removing that folder from the path on my old mac, and then adding it back ONLY by using the "userpath" command above. Result: it boots in 4-5 seconds even on the old machine. So much needless suffering!
3/10/2011 Notes on running MATLAB on skua: from Sarah Giddings:
David Darr set it up for me so that I could run it by just typing in a line of code to share the license with me. Then the only thing I changed was the paths.
You can generate a .m file that sets your paths every time you open matlab by setting savepath folderName/pathdef.m where folderName is where you open matlab from (/home/sarahgid/ for me)
Then in pathdef.m you can add paths that you want to always be found, so for example, I added /home/sarahgid/mexcdf/snctools/
So to get my pandora code working on skua I first moved my mexnc and snctools folders from my mac into /home/parker. I also moved most of my pandora folder, including psvs which I keep inside it. Then in matlab (on skua) I added paths from the command line using e.g.
>>addpath /home/parker/mexnc /home/parker/snctools
>>addpath /home/parker/pandora/psvs /home/parker/pandora/psvs/roms
>>addpath /home/parker/pandora/psvs/utility (how can I do all the subfolders at once?)
>>savepath pathdef.m (saved in /home/parker, and this then executes when I start Matlab but only if I start Matlab in /home/parker. Maybe I need to make a startup.m file ... so set the startup folder using "userpath" as described on 9/15/2009)
10/12/2010 How to print Matlab figures to files on a remote linux machine, WITHOUT having a figure window appear. This is useful when you want to make movies or figures from ROMS history files that are stored on one of our linux machines.
From the mac terminal, login to the linux machine, and don't use the -X option, e.g.:
Then start matlab with the following flags:
matlab -nodisplay -nodesktop
Now in matlab make and save a figure like this:
>> h = figure;
The results look nice. Note that when I saved in other formats like jpg and tiff it was a lot grainier image. Still have to work on optimizing this for when I am trying to make a bunch of files for a movie.
9/15/2009 Dreamweaver NOTE: to add a line break that doesn't add whitespace, just do SHIFT+RETURN
(instead of just hitting RETURN)