Bananas Development Blog: share your thoughts

Linksammlung 04.03.2013

Peek and poke in the age of Linux
In good old times when software size was measured in kilobytes and each byte was quite expensive dynamic allocation was very rare. Whatever could be static, was static. Whatever couldn’t be, was most likely pooled in a specific region and there was a preset number of “things” the program could handle. That means your lives counter or some other important value was most likely always at the exact same address every time. That’s not the case anymore unfortunately. Almost everything needs to handle an arbitrary number of “things” these days and that means dynamic allocation.


My First 5 Minutes On A Server; Or, Essential Security for Linux Servers
Server security doesn’t need to be complicated. My security philosophy is simple: adopt principles that will protect you from the most frequent attack vectors, while keeping administration efficient enough that you won’t develop “security cruft”. If you use your first 5 minutes on a server wisely, I believe you can do that.


Git is a purely functional data structure
I think we should instead talk about Git in terms of what it really
is: A purely functional data structure. Learning to expertly use Git
means learning how to manipulate that data structure.


Prozessprotokoll unter GNU/Linux

Dieser Beitrag soll es ermöglichen ohne zusätzliche Installation von Dingen wie audit oder DTrace.

Es passiert etwas auf einem System und man weis nicht was und warum. Es entstehen Fehler aber man kommt einfach nicht dahinter warum das so ist.
Man hat eventuell schon einen Verdacht aber man kann ihn nicht fassen.

Irgendwas muss auf dem System schief laufen. Blos wie kommt man an diese Information ?

Der Befehl top liefert eine aktuelle Liste der Prozesse. Es wird aber nicht angezeigt was genau ausgeführt wird und wie die Prozesse zusammenhängen und welche Parameter diese verwenden.

ps liefert da schon mehr Informationen. Ohne weitere Parameter aber auch nutzlos.
ps efaux

Dies zeigt schon eher das was wir brauchen.

Wie bekommen wir es aber nun hin, dass wir ein Protokoll bekommen ?
Denn eine kurze Momentaufnahme reicht nicht. Denn woher sollen wir wissen wann und wie lange der Prozess läuft ?

Wir basteln uns einfach was:
( while [ 1 ] ; do ps efaux ; sleep 1; done ) | tee /path/to/protokoll


Und schon haben wir ein Protokoll mit dem wir den Prozess einfangen können. Wer es schneller und noch aktueller haben möchte als nur jede Sekunde, der nimmt einfach sleep 1 raus. Dabei aber darauf achten, dass das file schnell sehr groß werden kann !

Na endlich ! Back to the roots

Endlich.
Nach dem man den Hashbang eingeführt hat und meinte es wäre toll.

Client-side rendering ist bullshit und bremst nur aus. Twitter hat das nun endlich kapiert. Danke.

Man, oh, man....

Die Sicherheit...

Tja, so kann es gehen mit der Sicherheit, oder was auch immer die Verantwortlichen sich dabei gedacht haben.

Safari:
CVE-2011-3230 - Launch any file path from web page

DigiTask:
DigiTask - unfähig die eigene Webseite zu schützen !

Na dann, happy hacking !

Warum kompliziert wenn es auch einfach geht

Nobody Understands REST or HTTP

Dieser Beitrag spricht mir aus der Seele. Warum alles kompliziert machen wenn es doch im Grunde recht einfach ist ?

The core idea of REST is right there in the name: "Representational State Transfer" It's about transferring representations of the state... of resources


Representational State Transfer
Hypertext Transfer Protocol

URL Rewrite mit Apache

Ist eigentlich ein bekannter Hut, aber alles kann man sich nicht merken.

Hier nur ein paar Seiten die einem helfen damit klar zu kommen.

Apache Module mod_rewrite
Apache Rewrite Cheatsheet
more .htaccess tips and tricks..
URL Rewriting for Beginners
match 'article' in url RewriteRule


Subversion Backup, aber richtig

Tja, Backups sind ja so eine Sache. Wenn man sie mal braucht, dann hat man sie nicht.

Aber ein Backup alleine reicht ja noch nicht.
Denn was bringt es einem wenn das Backup erstellt ist, aber das Backup selber kaputt ist ?
Im Grunde kann man da nichts machen. Das ist ein Griff ins Klo.

Wie so etwas passieren kann und wie man so etwas vermeiden kann, wird an dem Beispiel eines Subversion Backup-plans erleutert:
Subversion Backup

Also merke: Das Backup selber sollte auch überprüft werden !


WTF des Tages: SQL Injection Vulnerability auf MySQL.com

Also so was sollte ja nicht vorkomen oder ?

MySQL.com Vulnerable To Blind SQL Injection Vulnerability
[+] MySQL.com Vulnerable To Blind SQL Injection vulnerability
[+] Author: Jackh4xor @ w4ck1ng
[+] Site: http://www.jackh4xor.com


Gut MySQL kann nicht direkt was dafür, denn die Anwendung die mit der DB arbeitet hat da was verkackt, aber es ist trotzdem FAIL.

Nützliches für die Debian Administration

Wer einen eigene Server ( sei es nun Root oder vServer ) hat, der sollte sich mit Sicherheit und Überwachung auskennen.

Hier zwei tolle Artikel die helfen den Überblick zu behalten.

Installation Debian Lenny Server bzw Debian vServer
Debian Monitoring per Konsole + Munin


Werbung ist interessanter als das Spiel. Super Bo-*

* tja so wie sich das liest, darf ich nicht Super Bo.. schreiben...

Nach dem Reddit traffic nach ist die Werbepause interessanter als das Spiel selber ?!

Charting the Super Bowl through our traffic graph



Wie man erkennen kann ist der Traffic in der Werbepause niedriger, also sind die Leute nicht am "reddit-tieren". Während des Spiels sind sie aber eifrieg dabei. Was auch immer die da machen.....

So bald das Spiel vorbei war, ging der Traffic durch die Decke. Ist ja klar nach dem Christina Aguilera den Patzer abgeliefert hat...

POST DoS auf die Schnelle

Das DoS möglich sind, ist ja bekannt. Dass diese auch sehr einfach zu erstellen sind auch.

Aber dass dies so "einfach" geht, wusste ich bisher nicht.

HTTP Post Denial Of Service: more dangerous than initially thought
An attacker establishes a number of connections with the web servers. Each one of these connections contains a Content-Length header with a large number (e.g. Content-Length: 10000000). Therefore, the web server will expect 10000000 bytes from each one of these connections. The trick is not to send all this data at once but to send it character by character over a long period of time (e.g. 1 character each 10-100 seconds). The web server will keep these connections open for a very long time, until it receives all the data. In this time, other clients will have a hard time connecting to the server, or even worse will not be able to connect at all because all the available connections are taken/busy.
(…)
Therefore, by default Apache 1.3 only allows 256 connections. Therefore, an attacker only needs to steal 256 connections before the web server stops responding. It’s the same situation even with Apache 2.0.


Boo.... So einfach wäre das.

Natürlich gibt es da Gegenmaßnahmen etc. aber somit ist es sehr einfach mal kurz den Webserver platt zu ziehen. Auch ohne eine Horde von Zombie PCs.

6 Tips zu SSH

Man lernt ja nie aus, daher hier eine schöne Liste über die Verwendung von SSH.

Six things I wish Mom told me (about ssh)
If you’ve ever seriously used a Linux system, you’re probably already familiar with at least the basics of ssh. But you’re hungry for more. In this post, we’ll show you six ssh tips that’ll help take you to the next level. (We’ve also found that they make for excellent cocktail party conversation talking points.)


Was macht denn dein Server ?

Viele haben einen aber die wenigsten wissen das der denn so macht.
Wirft irgendwas Fehler, oder ist der Server zu arg ausgelastet oder macht die Festplatte Fehler ?

Damit man nun über so was bescheid weis, gibt es hier tolle Programme:

When you have a website or a network, it’s helpful to be aware of any issues as soon as they occur. There are open source and freeware server/network monitoring tools that will supervise your infrastructure for any issues that may arise. These tools are meant to aid you in avoiding being taken offline and evaluating if your resource needs has outgrown your infrastructure.

In this article, we review our top 10 server/network monitoring tools. You will see a variety of server applications here so that you might find the tool (or tools) for your needs.


10 Free Server & Network Monitoring Tools that Kick Ass