How to Secure Unsecure Connections With Ssh

Sometimes you need a way to make unsecure connections secure. For example, when you access to your to an apache webserver and don’t want to install ssl.
The easiest way is to open a ssh-connection and set up a local port forwarding so that the port on which apache is running mapped is to a localport on your machine. What did I say ? :)

Ok, let’s explain it in a few steps:
Old setting:
Client Server with Apache on port 80
New setting:
Client Server with Apache on port 80
and secure means mapping an remote port to a localport, so in fact there is one connection over ssh and another one over the ssh-connection (tunneling)
Client Server with Apache on 80

How can I make this ?
Consider your Webserver’s IP is: 1.2.3.4
To open a connection to your webserver you can use “ssh 1.2.3.4″ , but at this moment you haven’t access to the webserver on your localmachine. We have to modify the command like this
“ssh -L 80:1.2.3.4:80 1.2.3.4″ what does it mean ? The syntax of this command is sourceport:remoteaddress:remoteport. When you now go into your browser and type localhost:80, it should open your webservers page.
Your unsecure command of accessing the webserver is now tunneled via a secure ssh connection. You can use this method to tunnel whatever connection you want. It is even possible to tunnel ssh over ssh. Try it… :)

Facebook and my private Pictures

Today, I tested to create a secret album, which only I can see. And surprise…I wasn’t successful.
First I generated a new album and uploaded my picture. And you can see my picture here.

Wait…why can you see my picture ? It is only for me :( Ok, maybe you can only see it, when it is directly linked. But check this. Now you can even enter the whole album. Can anybody tell me, why I should upload it with this private settings ?


Let’s see why this is that way. I think the pictures are delivered without checking the privacy, because the load on the servers may be significantly higher if you check every request. But in the end this option is not like it seems to be. The privacy is weak. Even you can enter the album via private link what shouldn’t be possible when the album is set to “Only me”

Anyway…if you like to check the permissions before sending pictures in the world, check my post about Dynamisch Bilder ausliefern.

Facebook and SSL

Facebook tries hard to introduce SSL to all users, but I cannot see this option on my facebook profile site. Where is it ?

Many bloggers are saying that in this moment it’s only available in the U.S., but I’m there. The problem might be that I registered on facebook in Germany.
Well, anyway… people who can activate the SSL option are lucky. But as you can read on heise.de — I don’t want to repeat it here — there is a huge problem with third party applications that don’t use the SSL connection and even more the option is automatically disabled in your facebook settings when you use one of these applications. So make sure to enable it after using such an application or even avoid third party applications. There is no explanation why facebook deactivate it completely. Facebook may get a big problem with high load when everyone changes to SSL. SSL generates much more traffic on the webservers than an unsecured facebook. Maybe a reason ?

But a interesting question is: Why should I use SSL for all activities on facebook ?
This question is not easy to answer but for login pages it is common to transmit your password and username secure. It’s logical.
On the other hand, People who publish all their private life on facebook want to secure the connection ? Why ? If the provider can read it or not is not the big deal at all. They already share their life with thousands of people and why not another thousand ? Are they afraid of eavesdropping ? You see the point ? The data on facebook should not be hush-hush. If the data on facebook were secret, facebook wouldn’t work as it does. Therefore, don’t publish things that are nothing for everyone on facebook. This is the way to go….think about it…

#django-5 Querysets zufällig sortieren

Ich habe lange gesucht, aber nun doch eine Lösung gefunden, die sehr elegant ist. Seht selbst:

Database.objects.order_by('?')

Das Fragezeichen in der Sortierung sagt aus, dass es zufällig sein soll. Man kann jetzt natürlich noch sagen, dass man 4 Zufällige Datensätz haben möchte:

Database.objects.order_by('?')[:4]

#django-4 Dynamisch Bilder ausliefern

Um Bilder dynamisch auszuliefern ist der Prozess eigentlich recht einfach. Die URL wird aufgerufen und dann muss das entsprechende Bild eingelesen werden und als Response zurück gegeben werden.

Hier ist der Source-Code für Django.


# coding: utf-8
from django.http import HttpResponse
import settings

### Overview-Views ###

def show(request,idcode):
image_data = open(settings.MEDIA_ROOT + 'test1.png',"r").read()
return HttpResponse(image_data, mimetype="image/png")

Einen Fehler, den ich gemacht hatte war es, nicht open, sondern Image.open zu verwenden. Da wir aber kein Image Objekt brauchen, reicht ein einfaches binäres einlesen. Eine Verbesserung wäre sicherlich noch den mimetype ensprechend dem eingelesenen Bild anzupassen.

Mit dem Codeschnipsel kann man nun einfach Bilder mit Userlogin ausliefern.

Wo sind alle Berichte ?

Alle Berichte sind auf den Travel Blog umgezogen.
travel.ghiglieri.de

Zugfahrt

Hallo zusammen,
das ist mehr oder weniger eine Premiere auf dem Blog. Ich poste gerade per mobile.

Ja, zum eigentlichen Thema. Meine Zugfahrt ist schwer gewöhnungsbedürftig, da neben mir ein sehr mittelungsbedürftiges Wesen sitzt und den ganzen Wagon unterhält. Sowas um diese Uhrzeite sollte strafbar sein. Zum Glück gibt es Funklöcher, die meinen Ohren etwas Entspannung verschaffen.

Cheers,
Marco

Wissenschaftlicher Kreisel

Hallo,

habe mal für euch ein kleines Video gemacht:

Bewerbungsphase

…wollte heute mal kurz meine Erfahrungen bei Bewerbungen und deren Feedback hier zusammenfassen.

Was eigentlich immer aufgefallen ist, ist, dass man kaum Feedback bekommen hat, sondern immer eine Standardmail. In dieser Standardmail steht immer, dass man zwar gut qualifiziert ist, aber man keine Stelle anbieten kann.
Andere sind noch einfallsloser und sagen nach mehreren Monaten, dass die Stelle bereits vergeben ist. Was man sich bei der Sache fragt, ist, warum die Bewerber so lange hingehalten werden, wenn das Profil eh schon nicht passt und keine Einladung folgt. Eigentlich kann man sagen, dass Bewerbungen, die länger als ein Monat dauern im Sande verlaufen und eine Absage folgt.

Eine andere E-Mail wollte mich mal locker ein Jahr später in den Bewerbungsprozess reinnnehmen. Und was bis dahin ? Hartz IV ? Also war das auch eine indirekte Absage und von mir gabs keine weitere Reaktion.

Ich hätte zu gerne hier Originalnachrichten mit verdeckten Namen veröffentlicht, aber da bin ich mir nicht sicher, was es rechtlich mit sich bringt.

Mein Fazit ist: Viele Unternehmen interessiert es nicht, was mit den Bewerbern ist. So werden sie auch behandelt. Von total inkompetenten Gesprächspartnern bis hin zu sehr gut vorbereiteten Gesprächspartnern habe ich alles erlebt.

#django-3 Python und Unit-Testing

Hallo,

im Laufe meines Projektes areSocial sind einige Dinge dabei, die regelmäßig getestet werden müssen.
Hier eine kurze Anleitung, wie man Unit-Testing machen kann:

import unittest
from eventcal.TimeRecognizion import TimeRecognizion
from datetime import datetime,timedelta

class DateTestCase(unittest.TestCase):
    def testToday(self):
        time=TimeRecognizion("heute")
        self.assertEqual(time.getDate(), datetime.today(), 'heute-Erkennung fehlerhaft')

    def testTomorrow(self):
        time=TimeRecognizion("morgen")
        self.assertEqual(time.getDate(), datetime.today()+timedelta(days=1), 'heute-Erkennung fehlerhaft')

if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(DateTestCase)
    unittest.TextTestRunner(verbosity=2).run(suite)

Nächste Einträge →