Johan Rylander

2011-06-14

Blatant copy: Using Subclipse on OS/X with Homebrew

Postat i: java, Programming — Johan Rylander @ 13:09

From: http://tedwise.com/2010/06/21/micro-tip-using-subclipse-on-osx-with-homebrew/

 
brew install --universal --java subversion
sudo ln -s /usr/local/lib/libsvnjavahl-1.dylib /Library/Java/Extensions

2011-05-18

dcommit inte lokal branch till svn från git

Postat i: Programming — Johan Rylander @ 13:34

Från egen erfarenhet fungerar det inte att merge in på en lokal branch som har en svn-motsvarighet och sedan försöka göra git svn rebase. Kort: kör enbart git svn rebase och git svn dcommit från och till trunk. Lokala brancher kan inte användas ”normalt” mot svn.

Se också: http://stackoverflow.com/questions/190431/is-git-svn-dcommit-after-merging-in-git-dangerous

2011-05-11

Editera som root i emacs

Postat i: Computers — Johan Rylander @ 14:53

Med ”tramp” kan man editera filer över ssh och samma paket kan också användas för att köra sudo lokalt när man editerar. Tramp kommer installerat i emacs 23 åtminstone, så då kan du skriva:

M-x find-file, /sudo::/etc/hosts

för att redigera /etc/hosts på din lokala maskin som root

Från: http://lostwebsite.wordpress.com/2008/08/26/superuser-edit-in-emacs/

2011-05-10

Git; status och completion i bash

Postat i: Computers, Programming — Johan Rylander @ 13:06

Om du har git installerat har du nog bash-completion installerad också. Har du installerad med brew på mac kan du i din .profile eller vad du nu använder skriva:

source /usr/local/etc/bash_completion.d/git-completion.bash
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWSTASHSTATE=1
export GIT_PS1_SHOWUNTRACKEDFILES=1
export PS1='\W$(__git_ps1 " (%s)")\$ '

2011-05-09

Annotera konstruktor-argument i Scala

Postat i: Programming, scala — Johan Rylander @ 16:26

När man annoterar argument till en konstruktor i Scala måste man också ange till vilken användning man avser att annoteringen ska vara till. Det finns ju både instansvariabel, getter och setter. Därför annoterar använder man en lite rolig syntax med @(annotering @scope), t ex @(Nullable @field)

Se: http://stackoverflow.com/questions/3769624/annotating-constructor-parameters-in-scala

2011-04-10

Använda maven (och android) med IntelliJ

Postat i: Programming — Johan Rylander @ 10:12

För att IntelliJ ska se variabler måste de sättas med launchctl:

launchctl setenv M2_HOME /usr/share/maven
launchctl setenv ANDROID_HOME /usr/local/Cellar/android-sdk/r10

2011-03-10

git svn crash course

Postat i: Programming — Johan Rylander @ 10:49

git svn clone -s <svn-url-without-trunk-or-whatever>

Om det skiter sig, cd in i utcheckningen och kör git svn fetch tills klart

Ev kör git reset –hard HEAD om svn status ger fel

vi .git/config och lägg till ”svn” efter ”remotes” dvs /remotes/ blir /remotes/svn/

git svn fetch för att hämta remotes under nya namn

git branch -r | grep -v svn | xargs -n 1 git branch -d -r för att ta bort de gamla remotes

Det sista gör att man slipper ”ambigous” mellan svn-branches och lokala d:o

Welcome to it! :)

 

Referenser:

 

2010-12-31

Using private/public key to login with putty

Postat i: Computers — Johan Rylander @ 15:38

On Windows 7, using putty the private key file needs to be in a directory without slashes. A stored config to login with a key file is:

  1. Session->Host Name: Whatever host you want to access
  2. Connection->Data->Auto-login username: The login name to use at remote host
  3. Connection->SSH->Auth->Private key file…: The file containing the private key. N.B that the path to this file cannot have spaces in it.

Sleep and wake your mac from Windows

Postat i: Computers, Uncategorized — Johan Rylander @ 15:31

I use my mac mini to backup my windows box using the (free) software from crashplan.

The mac mini sits at the top of a book shelf and so is hard to reach so to wake it up and put it to sleep, I use putty with a stored config that executes:

pmset sleepnow

I use puttygen to get a public/private key and put the public one into .ssh/authorized_keys on the mac and then put:

putty.exe -load MiniSleep

into a batch file (MiniSleep is the stored config).

To wake it up, I use mc-wol.exe and use the ethernet-mac address on the mac as argument. That is also put into a batch file.

So, now I have two batch files, wakeup.bat and sleep.bat

Links:

2010-10-07

ant completion in bash

Postat i: Computers, java, Programming — Johan Rylander @ 14:32

Originally from http://matthew.mceachen.us/blog/ant-bash-completion-on-mac-os-x-43.html

  1. sudo brew install bash-completion
  2. Add to .profile or .bash_profile:
    if [ -f `brew --prefix`/etc/bash_completion ]; then  . `brew –prefix`/etc/bash_completionficomplete -C /usr/share/ant/bin/complete-ant-cmd.pl ant
« Nyare inläggÄldre inlägg »

Tema: Silver is the New Black. Blogga med WordPress.com.

Follow

Get every new post delivered to your Inbox.