The Simpsons in CSS

Some days ago I found this in my Google Plus stream and it’s so great that I have to reshare it here: The Simpsons in pure CSS.

Chris Pattle wrote some great stylesheets for drawing the main characters of the sitcom in the browser. No images, no javascript. Just pure and modern CSS.

Take a look at the astonishing result and check out the code on Github. You will be amazed!

php5-fpm on Ubuntu won’t restart

Just had some strange issues with php5-fpm on Ubuntu. I installed php5-mysql via apt but after the installation I still got errors like the following when my php website tried to load data from mysql:

FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught exception 'Exception'
with message 'could not find driver' in /foo/bar/medoo.min.php:22

I checked everything. The driver was activated in the configuration. MySQL was running and the credentials were correct. The MySQL configuration for PHP looked ok. The only odd thing was the missing mysql-driver in phpinfo()-output.

The solution was quite simple! The restart of php5-fpm failed after installing the mysql extension. Even service php5-fpm stop failed to stop php5-fpm. So I rebooted the machine and now everything’s fine. Not elegant but effective.

Text Snippets with Regex

Just found this nice Regex snippet that helps you, getting the first 100 characters of a text, but won’t cut your text in the middle of a word.

^.{0,99}\S\b

Test it here: regexstorm.net

Many thanks to Coder’s Block for sharing this with us.

Remove an address from ARP cache on FreeBSD

Here’s a very useful command if you are running pfSense and want to remove a single IP/Mac-mapping from the ARP-table:

arp -d <ip-address>

Since pfSense is a FreeBSD system, you can log in to a shell and do it. This is useful, for example, when you replaced one of your servers behind your firewall with a new one and with this changed the mac address of the hardware.

run Java applet from command line

Yes they still exist. Java applets. Now and then you come across one of them but your browser complains. You don’t have the plugin installed or the applet is not certified and looks very insecure to the computer,…

You are a system administrator or even a java expert, but you don’t know how to fix these warnings. At least you don’t want to know it. All you want is to run this applet. No wonder that java never became widely accepted on desktops.

But hey, there’s an alternative way to run the applet: If you have java installed, you can use the appletviewer command line tool:

appletviewer http://www.example.com/path/to/the/website/containing/the/applet.html

This will pop up the applet just like a normal application.

install restricted extras on Ubuntu for being able to play DVDs

You installed VLC on your Ubuntu because you thought with this you can play any Video and any DVD you want? You thought VLC always works? Sorry, it doesn’t.

Here on my fresh installed Ubuntu 14.04 my VLC player showed up an error window, containing many lines like these when I tried to play my (yes, original) DVD:

File reading failed:
VLC could not read the file (Input/output error).
File reading failed:
VLC could not read the file (Input/output error).

I was very surprised, because I knew that I also installed the ubuntu-restricted-extras package, and I thought it contains all the required codecs for playing any DVD in this world. Nope. Now I know, installing VLC and this package was a good idea, but I also had to run a script afterwards.

So, here is what you have to do to install the codecs:

sudo apt-get install ubuntu-restricted-extras
sudo /usr/share/doc/libdvdread4/install-css.sh

Afterwards your VLC will (hopefully) play what you want. If not, welcome to the codec- and encryption-hell brought you by the media industry (because of course, mass media has to be encrypted so that only the mass and not everyone is able to view it).

Thanks to DaimyoKirby on askubuntu.com for this solution: https://askubuntu.com/questions/309857/dvd-movie-not-working/309950#309950

Fix author of git commits

Sometimes, when I started a new git repository, I have to realize that I did some commits using the wrong user name or e-mail information. Yes, I have many identities, for example one with my work e-mail address and one with my personal e-mail address.

Updating this history information is not so easy and it’s much more difficult, when we already pushed these commits to a remote repository. It is good, that it’s difficult, because it changes the commits and therefore also changes the commit-IDs. But, as already mentioned, in most cases this happens at the very beginning of a project, when I was the only one who did commits, so here’s my simple solution.


Only run these commands if you were the only one who committed to this repository! It overwrites ALL authors of ALL commits and with this it also overwrites ALL commit-IDs. So, be careful!
# update the author e-mail address
git filter-branch --env-filter 'GIT_AUTHOR_EMAIL="jasonleroy@leranda.com"; export GIT_AUTHOR_EMAIL'
# remove the backup branch
git update-ref -d refs/original/refs/heads/master

# update the author name
git filter-branch --env-filter 'GIT_AUTHOR_NAME="Jason Leroy"; export GIT_AUTHOR_NAME'
# remove the backup branch
git update-ref -d refs/original/refs/heads/master

# re-push all commits to the remote repository
git push --force

connect to physical display using TigerVNC

When connecting to a VNC server it usually creates a new display session, which runs independently to your “real” desktop session. This new session is not displayed on a physical display connected to your computer, so you won’t see the windows that are visible on your physical screen.

That’s a nice feature, because with this many people can use one computer at the same time, but what if you want to see what’s going on on your physical screen?

TigerVNC’s answer to this question is x0vncserver. To start a VNC server for your physical display, simply call the command

x0vncserver -display :0

On a remote machine you can then use vncviewer to connect to the machine:

vncviewer DotWhenNoCursor=1 <server>

Replace with the IP or DNS of your machine. The parameter DotWhenNoCursor is optional, but in my case a big help, because sometimes the cursor of the computer is not visible.

100% disk usage but I don’t know why

In the last days I noticed that my hard drive was much louder than usually. Some process was using it all the time, but I didn’t know which one.

So, first I needed to find out, which process got crazy, and came up with iotop (found here).

I installed and started it and immediately saw the process that used 100% of my disk IO: gvfsd-metadata. So I did another search and found this post. The solution was simple:

mv ~/.local/share/gvfs-metadata/ ~/DEL_gvfs-metadata/

After this, the pc got quiet immediatley. I did not had to reboot or something else. Just this command.

Now the only thing I had to do, was to remove the DEL_gvfs-metadata folder.

Very strange.

Select another apt-mirror on Ubuntu Server

Once again I got annoyed because of the Austrian Ubuntu mirrors. They are really slow and that’s the point why I always choose the czech archive mirrors when getting asked.

Ok. This time I did not get asked but I felt it already when I did apt-get update. So, how to change it? It’s easy: Just replace all links in /etc/apt/sources.list with the links to the mirror you really want. But hey. I’m a developer. I don’t do this 2 or more times. Therefore I want a script and if there is no script, I write it. With sed, this was simple:

sudo sed -i -e 's/at\.archive\.ubuntu\.com/cz\.archive\.ubuntu\.com/g' /etc/apt/sources.list

That’s it. I wanted to install openjdk and when downloading it from at-mirror it said 1 hour 22 minutes remaining. Switched to cz-mirror and the installation was done after less than 2 minutes. It’s a shame.

Next Page »