[20-12-2010]

MacOS X – screen shoot location and file format

If you want to change screen shoot location and file format do as follows defaults write com.apple.screencapture type image_format defaults write com.apple.screencapture location /Users/user/your_preffered_directory You have to log out and log in again if you want changes to take effect. image_format: png, tiff, jpg, pdf


[13-12-2010]

Removing ^M from UNIX file – remove DOS new line char

VI: :%s/^M//g sed: cat $FILE_NAME | sed ‘s/^M//g’ > $OUTPUT_FILE_NAME tr: tr -d ‘\r’ < inputfile > outputfile (Note! In order to produce ^M press Ctrl-V, Ctrl-M)


[17-11-2010]

NetBeans nightly build updater for Mac OS X

In case you wanted to upgrade manually your NetBeans nightly build for Mac OS X you can use following script: nb_update NOTE! Be warned that this script will remove everything under /Applications/NetBeans Store the file at ~/bin/nb_update.sh and set it’s permission to +x (chmod +x ~/bin/nb_update.sh). Then, execute following commands: cd /tmp sudo ~your_mac_user_name/bin/nb_update.sh find […]


[17-11-2010]

Directory size in Linux

If you have ever wondered how to get list of directories together with their sizes sorted with descending order, here comes the solution found here: http://serverfault.com/questions/62411/how-can-i-sort-du-h-output-by-size


[13-10-2010]

Samsung SCX-4500W – network scanner and Mac OSX issues

I was struggling with Samsung SCX-4500W scanner configuration for a while. Currently I am using two, separate networks: 192.168.1.xxx and 10.0.0.x. While most of my machines are connected to 10.0.0.x network, scanner is connected to other one – 192.168.1.xxx. Additionally, 192.168.1.1 serves as a gateway to the outside world. Now comes a trick. If you […]


[10-09-2010]

jEdit vs. TextMate (MacOSX)

I am still evaluating both editors – I have already paid for TextMate – question is: was it worth buying? I am starting to think it was not :( So far, I am quite happy with jEdit, with following plugins: – XML – Buffer Selector Maybe jEdit is not that beautiful as TextMate is but […]


[25-06-2010]

Simple JNI example

Create these files: /* Simple.h */ #include “jni.h” JNIEXPORT void JNICALL Java_Simple_displayMessage(JNIEnv *env, jobject obj); /* Simple.c */ #include <stdio.h> #include “Simple.h” JNIEXPORT void JNICALL Java_Simple_displayMessage(JNIEnv *env, jobject obj) { printf(“Hello from JNI!\n”); } /* Simple.java */ class Simple { public native void displayMessage(); static { System.loadLibrary(“Simple”); } } /* Main.java */ public class Main […]


[25-06-2010]

creating SNV repository + NetBeans 6.9 integration

Create SVN repository and start server svnadmin create /home/svnrepos echo “anon-access = read” >> /home/svnrepos/svnserve.conf echo “auth-access = write” >> /home/svnrepos/svnserve.conf echo “password-db = passwd” >> /home/svnrepos/svnserve.conf echo “user_name = user_password” >> /home/svnrepos/passwd svnserve -d -r /home/svnrepos Import NetBeans 6.9 project into SVN repository Projects -> Right click project -> Versioning -> Import into Subversion […]


[15-06-2010]

Disable terminal bell – Suse 11.2

System bell is quite irritating. In order to turn it off in Gnome you can either: gnome terminal -> Edit -> Profiles … -> Default -> Edit -> General -> Terminal bell (uncheck) or gconf-editor -> /apps/gnome-terminal/profiles/Default/silent_bell (check)


[10-06-2010]

sed + path substitution

By default, I am using “/” character in sed substitution scripts. However this may lead to issues with UNIX path substitution. sed is capable of using any other character within scripts. Instead of using sed ‘s/\/sUNIX\/path/\/new\/path/g’ you can use sed ‘s|/UNIX/path|/new/path|g’ or you can even use environment variables (remember to replace ‘ with “) sed […]


[03-03-2010]

Pages – FAQ

1. Cudzysłów polski – „czyli taki” otwierający – alt + [ zamykający – alt + shift + [


[20-02-2010]

NetBeans 6.8/MacOS X 10.6/Web service issue

In NetBeans 6.8, saaj-impl is not quite compatible with JDK 1.6 saaj- [Caused by: java.lang.IllegalArgumentException: com.sun.xml.internal.messaging.saaj.soap.LocalStrings != com.sun.xml.messaging.saaj.soap.LocalStrings] That’s what we get in JDK 1.6 find . -name “*.jar” -exec find_jar.sh {} \ “com.sun.xml.internal.messaging.saaj.soap.LocalStrings” \; File: ./jre/lib/resources.jar ————————————————- com/sun/xml/internal/messaging/saaj/soap/LocalStrings.properties ————————————————- that’s what we get in netbeans-6.8 find . -name “saa*.jar” -exec find_jar.sh {} \ “com.sun.xml.messaging.saaj.soap.LocalStrings” […]


[25-01-2010]

Ubuntu – convert image to PNG

Simple way for converting images into PNG format shell> sudo apt-get install inkscape shell> inkscape input_file –export-png=output_file.png


[14-01-2010]

XML formating in Linux

export XMLLINT_INDENT=” ” xmllint -format -recover input.xml > output.xml


[26-11-2009]

Xcode – give me my console back

I have started working with Xcode recently and the first thing I have really missed was console window. Yes, it is not that intuitive when it comes to showing console up: Run -> Console (typically this kind of menu is located in View, Window, or something). Another issue, that I want to solve is: how […]


[19-11-2009]

iWork ’09 – installing from DVD

I have recently found an issue with upgrading iWork ’09 Trial to full version of iWork ’09. Unfortunately, there is something wrong happening while you do that. After you install software from DVD, it will ask you for the serial number – even though it is not required according to Apple’s policy! Now, what you […]


[03-11-2009]

Eclipse issue within Ubuntu 9.10

It seems, that most recent version of Ubuntu doesn’t go well with Eclipse (eclipse.buildId=M20090211-1700) org.eclipse.swt.SWTException: Device is disposed is thrown when you try to add new Class into project – one more thing to solve before going back do development. — solved: shell:~/eclipse$ export GDK_NATIVE_WINDOWS=1 shell:~/eclipse$ ./eclipse


[31-10-2009]

Ubunut 9.10 is here – and fails with Intel 965GM Chipset

So, after the upgrade of Ubuntu I am working now with openSUSE 11.1. Why, because Xorg consumes more than 90% of CPU and it is virtualy impossible to do anything. I think I will spent some time now looking for the solution – simply saying: “Ubuntu 9.04 -> Ubuntu 9.10 is just grate if you […]


[27-07-2009]

C like gg status

main(){char _[0x13]={0,2,98,3,-4,19,-84,84,-12,-7,19,-84,27,-18,-31,0,37,99,0};while(*(_+(*(_+1))))printf((_+0x10),*_+=*(_+(*(_+1))++));}


[10-06-2009]

Objective-C under Ubuntu

If you are interested in iPod/iPhone programming but you have never ever used Objective-C you can easily check it out. You will not be able to write iPod applications, of course, but you can get familiar with the language. Below, are four easy steps towards Objective-C application development under Ubuntu: 1. Install Objective-C compiler shell> […]