A couple of days ago my Terminal.app (console) got a really annoying feature. When launching the console or when I created a new tab it got stuck for about 5-10 seconds before I got my prompt.

If you are like me and are spending most of your time in Terminal.app you understand how annoying this is/was.

I tried to rename .profile, .inputrc and evey other startup script I had in my home folder but the problem did not go away.

Then I found an OSX user which had his Terminal crash when started. He solved his problem by cleaning up some OSX systemlogs. So I thought I try the same trick.

The logfiles which he removed where the asl files under /private/var/log/asl/

I read about them here: http://macosx.com/tech-support/can-i-deleteasl-log/24223.html

But I figured I’d just remove them all :)

[cc lang=bash]
sudo rm -rf /private/var/log/asl/*
[/cc]

When all asl files where removed my Terminal went back to normal again and I am sooooooo relieved.

This worked for me BUT I do not recommend you to remove anything if you do not know what you are doing!!!

Cheers!

Posted in Operatingsystem, Utilities at September 11th, 2009. 4 Comments
Tagged with , , , , . Written by: Mathias Stjernström

So, last night I upgraded my dev machine to Snow Leopard and what kind of a dev machine would it be without Vim?
Fortunately, for some at least, OS X still ships with Vim precompiled, unfortunately for me tough it still don’t come with ruby support enabled.

Since MacVim, which I usually use, isn’t yet compatible with Snow Leopard I decided to try and compile the regular vim as Mathias explained in a previous blog post about compiling for leopard, well that attempt crashed and burned. I did however get it to compile correctly after a minor tweak to his instructions:

On line 7 in src/auto/config.mk I changed the following line:
LDFLAGS = -L. -arch i386 -arch x86_64

To look like:
LDFLAGS = -L. -arch x86_64

While it did compile successfully, launching Vim just resulted in it exiting immediately with the message: abort trap.

Back at square one I started browsing the vim_mac mailing list and here’s how I finally got it working:

Start off by cloning the macvim repository:
~ $ git clone git://repo.or.cz/MacVim.git

Then change into the MacVim/src directory and configure and run make:
~ $ cd MacVim/src
MacVim/src $ ./configure --enable-gui-macvim --enable-rubyinterp
MacVim/src $ make

Now change into the MacVim directory:
MacVim/src $ cd MacVim

Normally this is where you would run xcodebuild, however that resulted in the following:
** BUILD FAILED **
The following build commands failed:
MacVim:
PhaseScriptExecution "Make Document Icons" /Users/pmh/Downloads/MacVim/src/MacVim/build/MacVim.build/Release/MacVim.build/Script-1D1C31F00EFFBFD6003FE9A5.sh
(1 failure)

The way to get around this is a bit cumbersome, but works.

Start by deleting line 6 in the Makefile that lives under the icons directory:
MacVim/src/MacVim $ cd icons
MacVim/src/MacVim/icons $ vim Makefile
# delete line 6 and save

Then change line 22 in make_icons.py, in the same directory, from:
dont_create = False
to:
dont_create = True

Change back to the MacVim directory and run xcodebuild:
MacVim/src/MacVim/icons $ cd ..
MacVim/src/MacVim $ xcodebuild

You should now see something like the following:
PyObjC not found, only using a stock icon for document icons.
** BUILD SUCCEEDED **

Now move the MacVim.app to the /Applications folder:
MacVim/src/MacVim $ mv build/Release/MacVim.app /Applications/

In order to invoke vim from the command line you need to add the following alias to your ~/.profile or what have you:
alias vim=/Applications/MacVim.app/Contents/MacOS/Vim

Note however that this only lets you use the command line version of MacVim, there seems to still be some issues with the graphical one.

Update:
As Björn pointed out in the comments, the graphical version of MacVim does work under Snow Leopard, also be sure to checkout his precompiled binary

Posted in Mouseless, Operatingsystem, Utilities at September 1st, 2009. 2 Comments
Tagged with , , . Written by: Patrik Hedman

If you, like me, are tired of vim’s pesky backup and swap files littering your project directory then you too should create a .vimtmp directory in your home folder and add this little snippet to your .vimrc

" Store vim backups and *.swp files in ~/.vimtmp with a unique name
set backupdir=~/.vimtmp//
set directory=~/.vimtmp//

Now all your backup and swap files will be stored in ~/.vimtmp/ and prefixed with a formatted file path, eg, %some%where%on%my%computer%some_file.ext.swp

Posted in Utilities at August 17th, 2009. 2 Comments
Tagged with , , . Written by: Patrik Hedman

So in order to save your fingers the pain I updated the ffmpeg gem today. You see, previously you had to do this:


convert "finding_that_nemo_dude.avi", :to => "finding_that_nemo_dude.flv" do
...
end.run

Doesn’t look to bad, right? Well, maybe not, but if you pay attention you would notice some repetition here, since the only thing different about the filenames is the extension. So, to keep things nice and dry you can now do this instead:


convert "finding_that_nemo_dude.avi", :to => :flv do
...
end.run

The old way still works if you really want a different filename all together or if you just really like to type :)

Posted in Ruby, Utilities, gems at August 15th, 2009. 2 Comments
Tagged with , , , . Written by: Patrik Hedman

FFmpeg is a great tool for recording, converting and streaming audio and video. It can, however, be quite cumbersome to use. For example consider the following command:

ffmpeg -i some_file.flv -ss 00:00:20 -t 00:01:30 -s hd1080 -aspect 16:9 some_file.avi

Now, even though this is a simple example, it’s still kind of hard to know exactly what it does, so you can imagine what it will look like once you need to accomplish more complex tasks. By contrast, here is the same example using my ffmpeg gem (gem install polly-ffmpeg):

require "rubygems"
require "ffmpeg"
include FFMpeg

convert "some_file.flv", :to => "some_file.avi" do
seek "00:00:20"
duration "00:01:30"
resolution "hd1080"
aspect "16:9"
end.run

This is in my opinion much easier to understand and use.

For more information checkout the documentation and the source code

Posted in Ruby, Utilities, gems at August 5th, 2009. 2 Comments
Tagged with , , , . Written by: Patrik Hedman

I generate a loooot of passwords. I try out a lot of webservices and all those needs passwords. I control about 70-100 servers and all those have different services and accounts. So I generate a lot of passwords… and this post is about how I do it do make it as easy as possible.
Read More…

Posted in Mouseless, Operatingsystem at January 13th, 2009. 2 Comments
Tagged with , , . Written by: Mathias Stjernström

We recently got in trouble with two Gentoo machines that where running under VMware ESX & ESXi.

The hosts froze randomly (Even the console in vmware froze). Especially when putting a little load on the machines. After hours of testing we found that removing virtual CPU’s from the host solved the problem. More that one CPU got the machine to freeze after some time.

!! Unsatisfied solution !! So after a couple of more hours we found a working solution….

Read More…

Posted in Hosting, Operatingsystem at November 5th, 2008. 2 Comments
Tagged with , , , , . Written by: Mathias Stjernström

I’ve just released v0.5 of keyFinder. keyFinder is the simpliest frontend for OSX’s keychain that you can think of. Its basicly a little window that filters your passwords (live) as you type your keywords. Select the one you want and hit enter. The password then gets copied to your clipboard. 

More information can be found on the keyFinder page under my projects.

Cheers!

Posted in Projects, Utilities at August 3rd, 2008. No Comments
Tagged with , , , , , , . Written by: Mathias Stjernström

FreeBSD come with a firewall software called IPFILTER (IPF).

I dare to say that almost any sysadmin have locked himself out when playing with firewall rules… .

This is a simple tip on how to prevent that from happening when working with IPF.

Read More…

Posted in Operatingsystem at March 28th, 2008. No Comments
Tagged with , . Written by: Mathias Stjernström

pastbedti.me is using WP-Gravatar