Showing posts with label osx. Show all posts
Showing posts with label osx. Show all posts

Wednesday, April 25, 2012

osx - set disk as startup disk via terminal

to set a disk as startup disk is quite simple just execute:


sudo bless -mount /Volumes/"name of your startup disk" -setBoot

Thursday, February 10, 2011

locking an application to a space in OSX Snowleopard

since i have several monitors connected to my max I like to have some apps always in one window on the same screen and not have to keep searching for it.

Most importantly I always want to keep my browser and terminal on the right screen and on the left screen I have several different IDE's.

Like...

  • eclipse in space 1
  • intellij in space 2
  • etc
solution?
  1. Go to your System Preferences and enable Spaces.
  2. Now, in the box in the middle of the Spaces settings that says Application Assignments, add an application using the + button.
  3. Just navigate to the chosen program in your Applications folder.
  4. Now the trick here is in the Space column to choose Every Space from the picklist.
  5. rinse and repeat for all applications

Tuesday, July 13, 2010

finding all external reference names in pubchem sdf files

currently I'm working on a simple way to find all external reference names in the pubchem sdf files. Which is rather trivial, but time consuming:



cat *.sdf | grep PUBCHEM_EXT_DATASOURCE_NAME -A 1 | grep -v PUBCHEM_EXT_DATASOURCE_NAME | grep -v '\-\-' | sort | uniq



once this finished it should give us a list of all possible data sources from pubchem as a unique list of names.


...
Ambinter
Burnham Center for Chemical Genomics
Calbiochem
CC_PMLSC
ChEBI
ChemSpider
DiscoveryGate
Emory University Molecular Libraries Screening Center
InFarmatik
KUMGM
LipidMAPS
MICAD
MLSMR
MMDB
MTDP
Nature Chemical Biology
NCGC
NIAID
NMMLSC
NMRShiftDB
ORST SMALL MOLECULE SCREENING CENTER
PCMD
ProbeDB
Prous Science Drugs of the Future
R&D Chemicals
Sigma-Aldrich
Specs
SRMLSC
Structural Genomics Consortium
The Scripps Research Institute Molecular Screening Center
Thomson Pharma
UM-BBD
UPCMLD
...

Thursday, May 13, 2010

renaming all files in a directory

some of the simple things in live




for x in *.php5; do n=${x/.php5/.php}; mv $x $n; done



taken from here

http://www.debianadmin.com/rename-multiple-files-to-another-extension-in-linux.html

Tuesday, November 17, 2009

maven2 - choose dependcies based on platform

today I run into an old friend. I was compiling my stuff happily under oxs and building eclipse plugins with maven2 and the psteclipse plugin, which I by now more or less rewrote and adapted to my project to perform as good as possible. Anyway, basically I encountered the issue that eclipse ships with different dependencies under osx/win32 and linux.

So promptly it fails to compile under linux...

solution for this problem?

maven2 profiles, your best friend for cross platform development. They actually allow you define dependencies based on the current platform.

Example for out case would be:


<profiles>
<profile>
<id>dev-windows</id>

<dependencies>
</dependencies>

<activation>
<activeByDefault>true</activeByDefault>
<os>
<family>windows</family>
</os>
</activation>
</profile>
<profile>
<id>dev-mac</id>
<dependencies>
<dependency>
<groupId>psteclipse</groupId>
<artifactId>org.eclipse.swt.cocoa.macosx</artifactId>
<version>3.5.1</version>
<scope>provided</scope>
</dependency>

</dependencies>

<activation>
<activeByDefault>false</activeByDefault>
<os>
<family>mac</family>
</os>
</activation>
</profile>
<profile>
<id>dev-linux</id>

<dependencies>
<dependency>
<groupId>psteclipse</groupId>
<artifactId>org.eclipse.swt.gtk.linux.x86</artifactId>
<version>3.5.1</version>
<scope>provided</scope>
</dependency>
</dependencies>

<activation>
<activeByDefault>false</activeByDefault>
<os>
<name>linux</name>
</os>
</activation>
</profile>
</profiles>


And sets a different library for osx and linux. Sweet!

Friday, October 16, 2009

OSX - upgraded my macbook pro to an SSD and the differences

After long considerations I updated my macbook pro to a SSD, from corsair. Since the price seemed to be not to outragios.

Now the tests are clear:

SSD

Drive Type CORSAIR CMFSSD-128GBG2D


Disk Test    173.68   
    Sequential    132.15   
        Uncached Write    143.67    88.21 MB/sec [4K blocks]
        Uncached Write    101.53    57.44 MB/sec [256K blocks]
        Uncached Read    94.19    27.56 MB/sec [4K blocks]
        Uncached Read    351.79    176.81 MB/sec [256K blocks]
    Random    253.29   
        Uncached Write    121.43    12.85 MB/sec [4K blocks]
        Uncached Write    196.26    62.83 MB/sec [256K blocks]
        Uncached Read    1503.47    10.65 MB/sec [4K blocks]
        Uncached Read    556.60    103.28 MB/sec [256K blocks]


Drive Type ST9500325AS

 Disk Test    43.26  
    Sequential    80.53  
        Uncached Write    78.89    48.44 MB/sec [4K blocks]
        Uncached Write    68.76    38.91 MB/sec [256K blocks]
        Uncached Read    77.68    22.73 MB/sec [4K blocks]
        Uncached Read    104.42    52.48 MB/sec [256K blocks]
    Random    29.57  
        Uncached Write    10.43    1.10 MB/sec [4K blocks]
        Uncached Write    73.40    23.50 MB/sec [256K blocks]
        Uncached Read    64.02    0.45 MB/sec [4K blocks]
        Uncached Read    98.74    18.32 MB/sec [256K blocks]

I think these result's speak for them self!

my trouble with snowleopard and java5

well snow leopard messed up my java installation.

Luckily there is an easy fix to it!

taken from here


cd /tmp/
curl -o java.1.5.0-leopard.tar.gz http://www.cs.washington.edu/homes/isdal/snow_leopard_workaround/java.1.5.0-leopard.tar.gz
tar -xvzf java.1.5.0-leopard.tar.gz
sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard
cd /System/Library/Frameworks/JavaVM.framework/Versions/
sudo rm 1.5.0
sudo ln -s 1.5.0-leopard 1.5.0
open "/Applications/Utilities/Java Preferences.app"


and move java5 to the top.

Wednesday, September 2, 2009

osx - set disk as startup disk via terminal

to set a disk as startup disk is quite simple just execute:


sudo bless -mount /Volumes/"name of your startup disk" -setBoot

Friday, July 10, 2009

OSX and SuperDuper - bug on raid systems

If you hapend to restore your superduper backup to a raid system you will encounter a small bug which prevents you from booting your nearly restored system.

For some reason super duper cannot choose the active device to boot from, if it's a software raid. And it result's in a hanging system at boot.

Fix

go into system preferences before you boot and set your raid as the boot device. This should make it work.

Tested on
  • raid 1 of 2 disks
  • raid 0 of 4 disks (450mb/s transfer rate)

Thursday, July 9, 2009

Restoring OSX, backups are great

well my mac pro was running happily since january 2008 on a raid 10 configuration without any major issues. Sure it forgot it's keyboard from time to time and once a week I have to recharge all batteries. But otherwise it was the most reliable pc I ever had.

The wonderful timemachine software also did it's best to keep my backups up to date. So I never worried about a thing.

Till 2 harddrives started to report read/write errors 2 weeks ago. So I ordered a couple of new harddrives (500Gb x 4, I need speed and not space on this thing, and they are supposed to be nearly as fast as velicio raptors) To replace them.
At the time I noticed that I need more speed and 200mb/s write speed is just not fast enough for my stuff. So I decided to replace all 4 old harddrives with the 4 new ones in a raid 0 configuration.

I like to live risky? Sure, but I got backup's and timemachine is a great piece of software to restore a system...

Ok the idea was nice, but it turned out that you have to boot from the original osx cd to get timemachine to restore the complete system.

So plan B was on the table, let's call superduper to the rescue and use timemachine only for archiving my data.

Basically superduper generates a complete image of my system on an external harddrive and if my system fails, I can boot this HDD, keep working, while my system restores in the background.

And it only cost 27$ and makes live so much easier for me.

My new backup plan?

  • hourly timemachine archives
  • weekly super duper images

OSX and the Keyboard Pain

well it turns out you can only use apple WIRED keyboards to execute boot flags.

You also have to press the button before and during the 'boing'. And you need to keep it pressed!

Now I was thinking you could use just a windows Keyboard. But no it won't work reliable.

Now if you happen to own a wireless bluetooth apple keyboard, like I do. Be prepared to order a second wired keyboard to be able to execute commands before the OS is up.


Conclusion:


lame...

Mac OSX Boot options

taken from here

Boot key combinations:

Everybody knows about some of these boot key combinations, but some of the more obscure combinations have been long forgotten (like how many of us have a Quadra AV and use a TV as a monitor!) – Check these out, you may need one of them someday!

  • C : Forces most Macs to boot from the CD-Rom drive instead of the internal hard drive. Only works with Apple ROM drives and with bootable CD discs.
  • D : Forces the first internal hard drive to be the startup disk.
  • N : Netboot (New World ROM machines only) – Looks for BOOTP or TFTP Server on the network to boot from.
  • R : Forces PowerBooks to reset their screen to default size (helpful if you’ve been hooked up to an external montior or projector!)
  • T : Target Disk Mode (FireWire) – Puts machines with built-in FireWire into target Disk mode so a system attached with a FireWire cable will have that device show up as a hard drive on their system. Very useful for PowerBooks!
  • Mouse Button Held Down : Ejects any mounted removable media.
  • Shift : Disables all extensions (Mac OS 7-9), or disables Login items when using Mac OS X 10.1.3 or later. Also works when booting Classic mode up just like you were using the OS natively.
  • Option : When using an Open Firmware "New World ROM" capable system, the System Picker will appear and query all mounted devices for bootable systems, returning a list of drives & what OS they have on them. On "Old World" systems the machine will simply boot into it’s default OS without any Finder windows open.
  • Space bar : Brings up Apple’s Extension Manager (or Casady & Greene’s Conflict Catcher, if installed) up at startup to allow you to modify your extension set.
  • Command-V : Boots Mac OS X into "Verbose Mode", reporting every console message generated during startup. Really shows what’s going on behind the scenes with your machine on startup!
  • Command-S : Boots Mac OS X into "Single User Mode" – helpful to fix problems with Mac OS X, if necessary.
  • Command-Option : Rebuilds the Desktop (Mac OS 7-9).
  • Command-Option-P-R : Erases PRAM if held down immediately after startup tone. Your machine will chime when it’s erased the PRAM, most people will hold this combination for a total of 3 chimes to really flush the PRAM out.
  • Command-Option-N-V : Erases NVRAM (Non-Volatile RAM). Used with later Power Macintosh systems mostly.
  • Command-Option-O-F : Boots the machine into Open Firmware (New World ROM systems only).
  • Command-Option-Shift-Delete : Forces your Mac to startup from its internal CD-ROM drive or an external hard drive. Very helpful if you have a 3rd party CD-ROM drive that is not an Apple ROM device.
  • Command-Option-Shift-Delete-#(where #= a SCSI DEVICE ID) : Boot from a specific SCSI device, if you have your 3rd party CD-ROM drive set to SCSI ID 3, you would press "3" as the # in the combination.

And, the obscure ones :>) Older computers only, on some.

  • Command-Option-I : Forces the Mac to read the disc as an ISO-9000 formatted disk
  • Command : Boots with Virtual Memory turned off.
  • Command-Option-T-V : Forces Quadra AV machines to use TV as a monitor.
  • Command-Option-X-O : Forces the Mac Classic to boot from ROM.
  • Command-Option-A-V : Forces an AV monitor to be recognized correctly.