Articles by admin

You are currently browsing admin’s articles.

 

I’ve been busy creating a new project in which I use symfony2 for the first time. Working with symfony1.x for nearly 3 years I really like some of the ideas of symfony2. However there are also some things I dislike, or just don’t fully understand yet.

Here are some quick notes I took while reading the FOSBundle Documentation.

 


Default Templates

The easy and quick way:

  • Basically override the FOS Template by creating a file under ‘./app/Resources/FOSUserBundle/views/layout.html.twig’
  • Be sure to include this block, which will hold the FOSUserBundle Content. 
{% block fos_user_content %}
{% endblock fos_user_content %}

2. The more complicated way

While working inside debian, which is installed inside a VirtualBox and shares a folder with it’s host machine, I repeatingly got errors while creating symlinks. (I use “os x 10.7″ as host and “debian wheezy” as guest os.)

Until now I accepted it but today I got tired of creating these symlink in the host system.

Here’s the solution I found:

1. Shut down the virtual machine. Debian in my case.
2. You need to close the VirtualBox GUI.
3. Type this into your preferred command line.

VBoxManage setextradata DEBIAN VBoxInternal2/SharedFoldersEnableSymlinksCreate/FOLDER_SHARE 1

4. Reboot your virtual machine.
5. Enjoy the stunning power of symlinks again*

* You ask why again ? Because this was possible by default prior to VirtualBox 4.1.8. It has been added for additional security.

Hi there,
I haven’t posted in a while. But this short post should proof im still alive ;)

I’ve been doing a lot emacs lately and decided to give nmh a try. Unfortunately the script that ships with it, to automatically build and install nmh, won’t work on my Macbook running OS X 10.7. It just gives me this output:

make[2]: *** [check-TESTS] Error 1
make[1]: *** [check-am] Error 2
make: *** [check] Error 2
build failed!
build log is in build_nmh.log

The build_nmh.log is full of messages that tell me to go away.

Here’s what I did to manually install it.

$ cd nmh
$ autoconf
$ autoheader
$ configure --enable-debug --enable-pop --with-editor=emacs --prefix=$HOME/nmh
$ make
$ sudo make install

This installed nmh binaries into the “~/nmh” which is ok for now because I’ll just want to try out.

After that you need to got to emacs which includes mh-e since emacs 18. So this should apply to my nightly build version 24.3.50.1 from EmacsForMacOsX.

Now you need to configure the variable ‘mh-path’ so emacs will know where to find the executable.
I did this through calling ‘M-x customize-variable mh-path’ and entered “User/cb0/nmh/bin”
This will set this variable in you .emacs file

(custom-set-variables '(mh-path (quote ("/Users/cb0/nmh/bin"))))

After this run “M-x install-mh” to install and “M-x mh-version” to check if everything is installed correctly.

MH-E 8.5

MH-E compilation details:
 Byte compiled:		yes
 Gnus (compile-time):	Gnus v5.13
 Gnus (run-time):	Gnus v5.13

GNU Emacs 24.3.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-03-28 on bob.porkrind.org

nmh 1.5+dev
 mh-progs:	/Users/cb0/nmh/bin
 mh-lib:	/Users/cb0/nmh/etc
 mh-lib-progs:	/Users/cb0/nmh/lib

Darwin snowball.lan 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:26:45 PDT 2012; root:xnu-1699.32.7~1/RELEASE_I386 i386

I also installed the manual so I dont have to leave emacs for a straight start.

Now I’m excited to see nmh live and inside emacs.

Use this when you accidently added a file to svn which should not have been commited at that time.

svn delete --keep-local local_filename

This prevents the file from being removed locally. So you can add it later again.

Set up port forwarding:

VBoxManage modifyvm "VM name" --natpf1 "to_ssh,tcp,,22,<GUEST IP>,22"
VBoxManage modifyvm "VM name" --natpf1 "to_http,tcp,,80,<GUEST IP>,80"
VBoxManage modifyvm "VM name" --natpf1 "to_https,tcp,,443,<GUEST IP>,443"

Replace “VM name” and <GUEST IP> with your desired configuration. If your guest OS use DHCP then can be omitted. natpf1 stands is the network interface to use. In my case NAT is Network Adapter 1.

To remove them again:

VBoxManage modifyvm "VM name" --natpf1 delete "to_ssh"

‘VBoxManage’ should be installed on your host os by the VirtualBox installer.

Today I wrote a new symfony module which needed to use the view of an old model as a detail view.
So the only thing thats missing is a call to the old module’s ‘list’ action with a preset filter value.
However the described

setFilter()

didn’t worked out, because it seems that you can’t set a filter for a different module.
So I analysed the user settings ( see “debug bar”) and came up with this solution:

$this->getUser()->setAttribute('myOldModule.filters', array('filter_att' => array('text' => intval($request->getParameter('id')))), 'admin_module');
$this->forward('myOldModule', 'index');

“myOldModule” = Model Name of backend module.

“filter_att” = The name of the model column you want to filter.

IMG_2319

Hello fellow friends,

today I have some time and I’ll try to write about my UM experience.
So you could ask, what’s an Ultimaker?

In my opinion it’s one of the greatest things that has arised from the open source community. A 3D printer.
If you want to read more about the history of the community I advice you to read this. Without the initial development of the RepRap community this would not have been possible. In this spirit: “Thanks you sooooo much, all of you are awesome”.

So here’s my short history with 3D printers.
I got to know these things about 2 to 3 years ago when the first people wrote about the development.
At this time I did plan to build one on my own. This thought was rejected by myself after I read about, what parts are needed and how this whole thing can be assembled.
I didn’t believed that I can do it without spending months of research for the parts, assembling and tuning. So for the next 3 years I almost forgot about this great technology.

 

When 2011 was running out I first read about the MakerBot community and got a first view a thingverse.
I was blown away about the scope and wide range of great things that other people already created.
2 weeks of surfing across hundreds of sites, comparing different models and checking my budget my decision was clear. I ‘ll buy an Ultimaker. So I placed the order on 12th of december and after the order was processed through a payment provider the great waiting started :)
Estimated shipping time is 4-6 weeks. On the 31st of january the mail that made my day arrived.
Subject: ‘Order Update’, Content: ‘Preparing shipment’
On 3rd feburary the package was delivered. Unfortunately I wasn’t at home so I had to call the service and arrange a new delivery date. Tomorrow will be the day!

So the day came and I was so happy when the door bell rang.

Read the rest of this entry »

Today I struggled with the usage of PDFSam on my Mac.
I just needed the command line tool, not the gui. On Linux it was

apt-get install pdfsam

On my OS X I dowloaded the .dmg from www.pdfsam.org and created this tiny ‘alias’ in my ~/.profile.

alias pdfsam='java -Dlog4j.configuration=console-log4j.xml \ 
-classpath /Applications/pdfsam-2.2.1.app/Contents/Resources\ 
/Java/pdfsam-2.2.1.jar org.pdfsam.console.ConsoleClient "$@"'

On command line I can now use it like I use it on Linux.

How often did you needed to process huge amounts of small files, where a single task uses only a small amount of cpu and memory?
However, today I need a script which does exactly this.

I have a mysql table which contains the filenames located on my hard drive.
Now I created a little script which processes a single file in under 3 seconds. Unfortunately for 10.000+ files this would take more than 8 hours.

So what if I could run them in parallel with a maximum of 10 parallel task’s being executed? This would really speed up the computation!

Luckily in 2005 Ole Tange from GNU merged the command line tools xxargs and parallel into the a single tool ‘parallel‘.
With this great tool there is no need to write any complicated script to accomplish such tasks.
First you need to install it using homebrew.

brew install parallel

After that i had to add the path to my .profile

PATH=$PATH:/usr/local/Cellar/parallel/20110822/bin

Here’s the basic usage:

 $> echo -ne "1\n2\n3\n" | parallel -j2 "echo the number is {.}"

This would echo the numbers 1, 2, 3 to the stdout with a maximum of 2 parallel running echo’s.
Here’s the output:

the number is 1
the number is 3
the number is 2

As you can see printing a 3 outspeeds printing a 2 ;)

So here is my 1 liner to process all my files:

 $> mysql -uroot -p[secretPW] my_database < \ 
    <(echo "SELECT filename FROM files")\ 
    | grep -v 'filename' | parallel -j10 "./processFile.sh {.}"

After using this it took only 37min to process my 10000+ files :)

I haven’t used Netbeans JAX binding for over a year.
And the last time I used it, it was easy to find in the plugin menu of Netbeans 6.
Now I’ve upgraded to Netbeans 7 and wasn’t able to find the plugin.
Happily I found a page that advised me to add

http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/nbms/updates.xml.gz

to the Update Center.
After that I got a huge list of updates, and my missing JAX-RPC.
Now just: install, restart, update-again.
Et voila, there is the missing “JAXB Binding” menu point that was searching for.

« Older entries