Robin Gloster

Python, Ubuntu, Web, Admin-Stuff, Go and more

More Recordings

Here are some more recordings.

Soldii Elisabeth and Max Mumme covering Under by Alex Hepburn:

https://www.facebook.com/SoldiElisabeth

Alex Wagner covering Ventura Lights – Superheroes on drums.

https://www.facebook.com/AlexWagnerDrums

Both were recorded and mixed with Ardour.

Dieser Beitrag wurde 1 Mal editiert, zuletzt am 30.05.2013 um 00:45 von Robin Gloster
0 Kommentare, 13 Views


Firefox 20 and old JS

The old "for each"-loop in JS seems to not work in Firefox 20 anymore.

We just found some historical code using it at work which suddenly didn't work anymore after upgrading.

Changing to for ( .. of .. ) works.

2 Kommentare, 176 Views


New Recordings

Last monday I recorded a friend of mine. She sung Titanium to a piano backing track.

Her Facebook page: https://www.facebook.com/SoldiElisabeth

The song was recorded and mixed with Ardour.

The next few days more will follow, from her and more that still has to be announced.

Dieser Beitrag wurde 2 Mal editiert, zuletzt am 02.04.2013 um 15:56 von Robin Gloster
0 Kommentare, 77 Views


What had been hurting PHP-FPM

We had big difficulties on our server with PHP-FPM. It went away after a few hours for no apparent reason after moving to another server. There were no error messages in any logs and we started looking for something that could be the cause.

nginx only reported a 502 Bad Gateway since the PHP Backend had died. I did some googling and found reports on long running scripts which caused difficulties and wrong file/folder permissions but it turned out that that wasn't our problem.

Then I compared the servers' configurations and noticed that I had installed APC on the new server which wasn't installed on the old machine. Since having disabled that it is now working without any problems.

Dieser Beitrag wurde 1 Mal editiert, zuletzt am 02.04.2013 um 13:51 von Robin Gloster
0 Kommentare, 55 Views


Writing a Feed Reader with Go and Backbone.js

I have started writing a feed reader with Go and Backbone.js.

Code is open source at github.com.

Currently you can only add feeds and read them, but don't get updated, yet, and it is only possible to have a single user. These features will be added first.

I'm planning t explain most of the code here.

Here's a Screenshot:

Bildschirmfoto vom 2013-01-03 15:39:38.png

Updates will follow soon.

Dieser Beitrag wurde 1 Mal editiert, zuletzt am 03.01.2013 um 15:58 von Robin Gloster
1 Kommentare, 171 Views


jQuery/HTML5 Audio Benachrichtigungen (de)

(english post: http://www.loc-blog.de/index.php?site=blog_post&post_id=51)

Mit diesem Code können ganz einfach Audio-Benachrichtigungen mit wenig Aufwand und ohne Plugins erstellt werden. Eine praktische Anwendung sind Benachrichtigungen über neue Chat-Nachrichten oder möglicherweise um Aufmerksamkeit bei Fehlern o.Ä. zu erregen. Dabei sollte aber aufgepasst werden, dass dies nicht mehr stört. Wenn es nicht gewollt ist, dass die Audiosteuerung des Browsers benutzt wird, kann dies mit eigenen Buttons möglich gemacht werden, nachdem die Überprüfung des Fokus des Fensters entfernt worden ist.

HTML-Code:

<audio id="chatton">
    <source src="sound/chatton.ogg" type="audio/ogg" />
    <source src="sound/chatton.mp3" type="audio/mpeg" />
</audio>
  • preload="auto" um die Audiodatei zu laden bevor sie benötigt wird. Sonst entsteht eine kleine Verzögerung vor der ersten Benachrichtigung.
  • 2 verschiedene Audiodateien für Browserkompatibilität

JavaScript-Code, um zu erkennen, ob der Tab angezeigt wird:

$(window).on("blur", function() {
    hasfocus = false;
});

$(window).on("focus", function() {
    hasfocus = true;
});

Und um den Ton abzuspielen, bspw. bei Nachrichteneingang:

if (!hasfocus) {
    $("#chatton").get(0).play();
}

(Im LocCom-Chat benutzt)

0 Kommentare, 204 Views


Error installing MySQL on Debian

I had to install a new server for an internal web application at work today.

Quite routine work by now, install apache, PHP and MySQL. But then I got an error when apt-get tried to start MySQL. The biggest problem was there was no explanation what had gone wrong. So I purged mysql-server and tried again, again MySQL wouldn't start. Then I tried starting it by hand and finally got an error message: port 3306 was already in use. Ok, maybe it hat started earlier but didn't work correctly, so I tried some other port, but got the same error message.

That started me googling for the error message and found a forum thread naming many different causes and solutions. One short post then got me on the right track. The virtual machine I was on didn't have a loopback network device configured.

That meant adding this to /etc/network/interfaces:

auto lo
iface lo inet loopback

Then on the shell:

# ifup lo
# apt-get purge mysql-server
# apt-get install mysql-server

You simply always learn some new things installing things.

Dieser Beitrag wurde 1 Mal editiert, zuletzt am 15.11.2012 um 22:31 von Robin Gloster
0 Kommentare, 160 Views


CSS3 Animations: Shake

I'm currently refactoring the LocCom login system. This includes checking user login via AJAX and displaying an unsuccessful authorization by a shake animation on the login form. This works on IE 10+, FF 14+, Chrome 21+, Safari 5.1+ and Opera 12+.

At first the animation needs keyframes in CSS:

@keyframes shake{
    0% { transform: translate(15px, 0); }
    50% { transform: translate(-15px, 0); }
    100% { transform: translate(0, 0); }
}

@-o-keyframes shake{
    0% { -o-transform: translate(15px, 0); }
    50% { -o-transform: translate(-15px, 0); }
    100% { -o-transform: translate(0, 0); }
}

@-moz-keyframes shake{
    0% { -moz-transform: translate(15px, 0); }
    50% { -moz-transform: translate(-15px, 0); }
    100% { -moz-transform: translate(0, 0); }
}

@-webkit-keyframes shake {
    0% { -webkit-transform: translate(15px, 0); }
    50% { -webkit-transform: translate(-15px, 0); }
    100% { -webkit-transform: translate(0, 0); }
}

Then I define a css class witch I can add to an element via JS/jQuery to trigger the shake:

.shake {
    animation-name: shake;
    animation-duration: 200ms;
    animation-iteration-count: 2;

    -o-animation-name: shake;
    -o-animation-duration: 200ms;
    -o-animation-iteration-count: 2;

    -moz-animation-name: shake;
    -moz-animation-duration: 200ms;
    -moz-animation-iteration-count: 2;

    -webkit-animation-name: shake;
    -webkit-animation-duration: 200ms;
    -webkit-animation-iteration-count: 2;
}

Then to trigger the animation in jQuery:

$("#elem").on('click', function () {
    if (!$(this).hasClass("shake")) {
        $(this).addClass("shake");
    } else {
        var that=this;
        $(this).removeClass("shake");
        setTimeout(function () {
            $(that).addClass("shake")
        }, 0);
    }
});

You need the timeout for the event to trigger multiple times. I will give ab update when you can see this feature live. It won't take long!

 

Update: This feature is now live on www.loc-com.de! Just try logging in without correct credentials!

Dieser Beitrag wurde 1 Mal editiert, zuletzt am 29.10.2012 um 18:05 von Robin Gloster
0 Kommentare, 239 Views


jQuery/HTML5 Audio Notifications

(deutscher Post)

You can use this code to easily create sound notifications with little code and without any plugins. Use cases are notifications for new chat messages or possibly alerting your visitor to an error, although you should watch out that it does not become annoying. If you don't want to use the default audio controls, you can use this connected with your own button to control the audio after removing the check for window focus.

HTML-Code:

<audio id="chatton">
    <source src="sound/chatton.ogg" type="audio/ogg" />
    <source src="sound/chatton.mp3" type="audio/mpeg" />
</audio>
  • preload="auto" to load the audio before it being needed. Otherwise you get a delay on first notification.
  • 2 different sound files for browser compatibility

JavaScript-Code to recognize if tab is focused:

$(window).on("blur", function() {
    hasfocus = false;
});

$(window).on("focus", function() {
    hasfocus = true;
});

Code to play notification, e.g. when receiving a chat message:

if (!hasfocus) {
    $("#chatton").get(0).play();
}

(Used in LocCom-Chat)

Dieser Beitrag wurde 3 Mal editiert, zuletzt am 08.12.2012 um 01:06 von Robin Gloster
0 Kommentare, 75562 Views



Seite:   1