Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

Webserver Pref Pane

In newer versions of OS X, apparently the web sharing disappears. This can be added back using a prefpane from this link: http://clickontyler.com/blog/2012/02/web-sharing-mountain-lion/

SVN Server on Mavericks - OS X Server

Great instructions here http://pablotips.blogspot.com/2013/12/install-svn-on-mac-os-x-again-this-time.html

First run this
xcode-select --install
Then get the matching version of subversion already installed
Then run these
./configure
make
sudo cp subversion/mod_dav_svn/.libs/mod_dav_svn.so /usr/libexec/apache2/.
sudo cp subversion/mod_authz_svn/.libs/mod_authz_svn.so /usr/libexec/apache2/.
and then run these
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_repos-1.0.dylib /usr/local/lib/libsvn_repos-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs-1.0.dylib /usr/local/lib/libsvn_fs-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_fs-1.0.dylib /usr/local/lib/libsvn_fs_fs-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_fs_util-1.0.dylib /usr/local/lib/libsvn_fs_util-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_delta-1.0.dylib /usr/local/lib/libsvn_delta-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_subr-1.0.dylib /usr/local/lib/libsvn_subr-1.0.dylib
# Optional ? sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_wc-1.0.dylib /usr/local/lib/libsvn_wc-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_client-1.0.dylib /usr/local/lib/libsvn_client-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_diff-1.0.dylib /usr/local/lib/libsvn_diff-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra-1.0.dylib /usr/local/lib/libsvn_ra-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_local-1.0.dylib /usr/local/lib/libsvn_ra_local-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_neon-1.0.dylib /usr/local/lib/libsvn_ra_neon-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_serf-1.0.dylib /usr/local/lib/libsvn_ra_serf-1.0.dylib
sudo ln -s /Applications/Xcode.app/Contents/Developer/usr/lib/libsvn_ra_svn-1.0.dylib /usr/local/lib/libsvn_ra_svn-1.0.dylib
Also note that if you are using OS X Server, the httpd.conf file in /etc/apache2 is no longer used. Rather, all the configuration files are located in /Library/Server/Web/Config/apache2 (Or something very close to this). Therefore, all the httpd-svn.conf and other files must be placed in the Other folder inside this directory.

Here are a few links that I found helpful when setting things up
https://discussions.apple.com/thread/5283885
http://superuser.com/questions/691808/how-to-customize-mavericks-mac-osx-server-apache-configuration
http://support.apple.com/kb/ht4813

Matlab Mex with XCode 4

Some settings have to be changed to get matlab to work with XCode 4.  I found good help here.

http://stackoverflow.com/questions/12643236/matlab-2012a-mex-to-work-with-xcode-4-5-on-mountain-lion

OSX Quicklook for other file types

Here's a hack to allow this
https://coderwall.com/p/dlithw

Coding and debugging external builds in Xcode

Create a new project, select "External build system" and specify the location in which to save the project files

Then add the source files with Project -> Add to Project…

Then add a new target with Project -> New Target…

Then delete the old target

Then double click on the new target and change any of the necessary settings including parameters for the make file and the path to the make file

Then add a custom executable with Project -> New Custom Executable… And set the full path to the executable including the file name

Now "Get Info" on the Project under the Groups & Files section.  Double click on "ARCHS" to change the architecture change "32" to "64" if necessary.
Then go to preferences and uncheck "Load symbols lazily" and that should be sufficient to build and debug an external project within Xcode.

ssh config

I recently discovered a convenient shortcut for ssh hosts which works on a Mac but I expect it should work on any *nix system.  In the ~/.ssh folder you can create a file called config and add the following lines:
Host nickname
Hostname ipaddress.or.hostname
User username
Then when you want to ssh to that server you only have to type
ssh nickname
and the remaining information is automatically added.

Application List

Application List:
Papers – organizes articles, references and PDFs
EndNote – Not nearly as good as papers but it integrates with Microsoft Word
CyberDuck – Secure FTP
Kaleidagraph - graphing software
Quicktime Player 7 – make movies from image sequences
svnX – SVN GUI
SCToolbarButton – SVN menu that aims to be like TortoiseSVN for Windows
Chmox – opens windows CHM files
GraphClick – much better than DataThief
PaintBrush – like Microsoft Paint

VMD
Ovito
ParaView

MATLAB
Mathematica

Adobe CreateSuite
Microsoft Office
Apple's Keynote – has some great features and can export each animation in a PDF

LaTeX – powerful publishing software
LaTeXiT – able to make equations to put in Apple's Keynote

Xcode
Smultron – Liked it but development has been stopped

Dashboard Widget List:
StickiesPlus – allows you to have more than one sticky note on the dashboard
ScreenShot Plus -
iStatPro

sed

sed is a great command line tool for *nix operating systems.  There's a great tutorial on it here.

I definitely don't use it to it's full potential but it's convenient for stripping parts of a file out.  Say you want to get a part between two key words, use this
sed -e '1,/StartKeyword/ d' -e '/EndKeyword/,$ d' in.txt > out.txt
This command says to delete everything from line 1 to 'StartKeyword' and then to delete everything from 'EndKeyword' to the end of the file '$' and to put it into out.txt.

Alternatively, you can use the ! (not) sign to do the opposite.  For example, say I want to keep everything between lines 1-10 and put that into a file, use this
sed -e '1,10 !d' in.txt > out.txt
So, sed becomes quite convenient for working with large text files, and I haven't even begun to scratch the surface of what it can do.

New Programs and Websites

I found a new website I really like alternativeto.net. I often find programs I like, and want somethings similar on another platform. This website can help with that and it can also help you find other programs that may be cheaper too.

On another note, the SCplugin for Subversion for Mac is taking a while to be updated to support 10.6 and in the meantime, I found SmartSVN which is a full GUI for Subversion.

Create DVD/CD ISO on Mac

The following text is taken from http://www.slashdotdash.net/2006/08/14/create-iso-cd-dvd-image-with-mac-os-x-tiger-10-4/.

1. Insert CD/DVD source
2. Fire up a Terminal, you can then determine the device that is you CD/DVD drive using the following command:
$ drutil status
 Vendor   Product           Rev
 MATSHITA DVD-R   UJ-835E   GAND

           Type: DVD-ROM              Name: /dev/disk1
      Cur Write:    8x DVD          Sessions: 1
      Max Write:    8x DVD            Tracks: 1
   Overwritable:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
     Space Free:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
     Space Used:  364:08:27         blocks:  1638627 /   3.36GB /   3.13GiB
    Writability:
      Book Type: DVD-ROM
3. Umount the disk with the following command:
$ diskutil unmountDisk /dev/disk1
Disk /dev/disk1 unmounted
4. Create the ISO file with the dd utility (may take some time):
$ dd if=/dev/disk1 of=file.iso bs=2048
5. Test the ISO image by mounting the new file (or open with Finder):
$ hdid file.iso
6. The ISO image can then be burnt to a blank CD/DVD.

Mac Icons

I like to customize my Mac with Icons using the LiteIcon program (which is free as opposed to CandyBar) and then I can use custom Icon sets from Icon Factory.  I think my favorite set is the Float icon set.

Mac Finder Tweaks

The other day I came across an article on LifeHacker I really liked about how to improve the Mac OSX Finder.  Take a look, it has some really great suggestions.

Time Machine

We had an incident with our computer and lost our hard drive. Luckily, we were using Time Machine on the Mac and it's amazing to just plug the computer in again and everything works great! That was a huge relief to be able to know that everything was backed up. Anyway, occasionally when I'm looking to save space on the backups, because Time Machine definitely does not worry about that, I exclude certain folders that just balloon quickly because a large file might change and then it backs everything up again. Here's the list of ones I do exclude, although I sometimes add or remove others:
  • /Users/user/Library/Caches
  • /Users/user/Library/Mail
  • /Users/user/Library/Thunderbird/ImapMail
  • /Users/user/Music/iTunes/iTunes Music/Podcasts
These seem to help a lot and I don't have to worry if I lose them because that information is not essential to my long term needs.

Some Mac Programs

I have already mentioned two websites in previous posts (1,2) that I think provide a good list of useful Mac applications, but here are a couple of Mac programs I have installed that I like:

BusySync - a program that allows calendars to be synced with google, although google now allows this to be done directly with iCal
Cyberduck - a great FTP client
Dock Dividers - Keeps the Mac Dock clean
Fantasktik - A taskbar for Mac, which I really wish was built in to OSX
Flip4Mac WMV - play windows media files on a mac
Gimp - an open source Photoshop application
Handbrake - software for creating iPod sized movies from DVDs
LiteIcon - a program that lets you change system icons easily
SCPlugin - a plugin for using svn source control through mouse menu
Smultron - a excellent editor for different source types
VLC - another media program that can be useful for converting movies to iPod format
Witch - Allows me to use alt-tab to move through all windows not just the command-tab for programs


Programs I installed but don't use
Plugsuit and Afloat - I'm not currently using this but it was suggested software that I installed at one point, and can't remember why
DragThing - another dock and organizer type application
Spirited Away - an application that hides windows which are open but which haven't been used recently
SplashID - software which is useful for storing important but sensitive information

Free Mac Software

Here's a site with a long list of Mac applications, not all of which I think are useful, but sometimes it's hard to find these sites, so here's a new one FreeMacWare.

Subversion

A long time ago I heard about version control tracking, or software that can keep track of changes to documents so that you don't have to, and thought it sounded pretty cool, but until about a year ago, I had never used it.  Well, I love it.  It makes it so much easier to code when you know that every time you commit a change it will be saved and so if you make any undesirable changes you can always roll back to a version that works.  It has also made my programming much more focused because I work on fixing one bug at a time and after I fix that bug, I commit that change and work on the next.  It's much easier to isolate problems with the code and have confidence that I am keeping track of my past work.  My preferred software is Subversion or SVN and comes standard with most Linux packages.  I just recently discovered a port to Windows that I really like called TortoiseSVN which is implemented as a Windows shell extension, for seamless integration into Windows Explorer.  I really like it so far and even provides for tracking of other non-text file formats such as '.doc' and '.xls'.  I searched to see if there's something similar for OSX and found this post which refers to a plugin called SCPlugin.  Although I haven't used it yet, it appears to be integrated with Finder.  Anyways, I'm excited to try it out.

Making ISO image files

To make an ISO image file to be burned to a CD or DVD later execute the following command
mkisofs -graft-points -U -r -o filename.iso -path-list pathlist.file
where the following flags -U -r give more flexibility in naming files and permissions
and -o refers to the output file name filename.iso
and -path-list refers to the file pathlist.file that contains the list of files to be included in the image file.  pathlist.file should look something like
pathOnISO1=/path/to/file1
pathOnISO2=/path/to/file2
and the flag -graft-points allows the files written to the image to graft in at specific folder levels

Mac Programs

I have been searching for good Mac programs that are free and have found the following website which I think has an excellent compilation of programs bestmacsoftware.org