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.
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.
How often did you need 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. Learn how to fix Comodo warning: 0x80070005runtime errors quickly and easily!
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.
#!/bin/bash
mkdir src
cd src
wget http://museum.php.net/php5/php-5.3.2.tar.bz2
wget http://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fmcrypt%2Ffiles%2FLibmcrypt%2F2.5.8%2F&ts=1306411641&use_mirror=ignum
tar xzvf php-5.3.2.tar.bz2
tar xzvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --disable-dependency-tracking && make -j6 && sudo make install
cd ../php-5.3.2/ext/mcrypt
/usr/bin/phpize
MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Developer/SDKs/MacOSX10.6.sdk/usr/bin/php-config && make -j6 && sudo make install
echo "Completed install, now make sure to edit your php.ini"
echo "and check for \"enable_dl = On\" and add \"extension=mcrypt.so\"" to the dynamic extentions"
This is the little bash script I wrote according to his tutorial. This comes without any warranty!!!
Be aware that you have to enter your root password twice while installing this script.
Today I realized that I had not a single song on my notebook hard disk. Thanks to Last.FM 🙂
Unfortunately “Simplify Media” has been adopted by Google Inc. and they do not offer a similar service yet. So I needed a solution to stream my iTunes from home to the office. If found a great solution by “Robert Harder” which works like charm. (source).
This is the bash script:
This week I released my first OS X Dashboard Widget.
It’s called ‘LE Mensa’ and it displays all menues for all cafeterias in Leipzig, which are part of the student union.
If you want to give it a try then visit the project page: http://stinfwww.informatik.uni-leipzig.de/~mai03fln/leMensa/
Today I updated it to version 0.15 !!
It works this way:
1. I wrote a python script which extracts information from the student union homepage and transform it into xml.
2. A .php script can call this .py script and give back those infos.
3. The widget was written in Dashcode with jQuery as an additional package. So it’s mainly javascript, some html and css. The widget now calls this php script, retrieves the xml and displays it in a (hopefully) pretty way.
Finally I found an awnser:
NOTE: This is only for Mac, I don’t know how to do it on a Windows machine.
1. connect your iPhone to your Mac
2. close the starting iPhoto for the last Time 😉
3. open up the “Image Capture” (eng) / “Digitale Bilder” (de) Application
4. select your iPhone and choose “No Application” in the DropDown List.
5. close it and enjoy connecting your iPhone without the annoying autostart
I need to open Safari with a specific URL on command line. The problem is that this has to happen completly in background and should be started through an existing bashscript.
Here is my solutiuon, it should apply to any other app in OS X SnowLeopard. You need to call the bash schript like this:
#!/bin/bash
osascript -e "
tell application \"Safari\"
tell application \"Finder\"
set visible of process \"Safari\" to false
end tell
launch
set the URL of document 1 to \"$1\"
end tell"
[EDIT] It seems that ‘launch’ in AppleScripts starts the app in background. So we don’t need to tell Finder to hide Safari anymore.
tell application "Safari"
launch
set the URL of document 1 to "http://whatever..."
end tell"
There are some features in Snow Leopard that Apple try’s to hide from it’s users. I don’t know why but you can’t find those Settings in the “System Preferences” now anywhere else.
Here are my favorites:
2. iTunes green zoom button
Since iTunes 9 you get the MiniPlayer when pressing the green button in itunes. To get back the max. function you’ll need enter this:
3. Re-enable auto play for QuickTime
The new Quicktime does not have any preferences, because of this you can’t enable AutoPlay by default. Here’s the command to enable it:
4. Keep QuickTime in fullscreen when switching applications
If you are used to work on multi screen systems, sometimes you wan’t to watch a movie or sth. else on another screen. With Quicktime this can be annoying. If you switch to fullscreen and then use Command-Tab to switch the applications QuickTime will automatically quit fullscreen. Type this to get rid of it:
5. screensaver password delay
New SL feature is to set a time delay for password requests. How long does the screensaver had to be active before it requires a password. Do it with:
6. Disable Dock Expose
When clicking on a dock Icon in Leopard you got the “right-click” contex menu. In SL it changed to the DockExpose which will show all current windows of the app. To disable this type:
defaults write com.apple.dock show-expose-menus -boolean no; killall Dock