how to jail break with git
Certainly quite a few people suffer from too restrictive networks where you need to use proxy servers to reach outside world. Often applications support using HTTP or FTP proxies. But only few applications do also support SOCKS proxy for arbitrary protocols.
Guess what.. there are tricks to circumvent that
Ingredients
- existing SOCKS proxy reachable on the network
- netcat
As an example I'll describe how to connect with git to a remote repository via netcat through a SOCKS proxy. Git command line client itself doesn't support SOCKS proxies directly. But it does support a proxy command. So we abuse netcat to do the conversion for git.
1.) Step - create a shell script
As git can only handle a proxy command without any parameter we create a small shell script to act as that command:
#!/bin/bash
nc -xproxy.mydomain.com:1080 -X5 $*
Save this as proxy_command.sh and give it execution rights.
Now export an environment variable for GIT to make use of this proxy command:
export GIT_PROXY_COMMAND=/Volumes/Repositories/explain-it-tools/proxy_command.sh
And now you can use git as you would without network restrictions:
git clone git://github.com/altercation/solarized.git
Update der GPG Signatur bei Ubuntu Hardy Heron
Seit einigen Wochen bekomme ich beim System-Update auf meinem Server immer eine Fehlermeldung wegen eines fehlenden GPG-Schüssels:
aptitude update .... .... Reading package lists... Done W: GPG error: http://ppa.launchpad.net hardy Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 35CC62D2200CBE07
W: You may want to run apt-get update to correct these problems
Die angebotene Lösung mit apt-get update funktioniert leider nicht.
Nach einigen Recherchen habe ich jetzt folgenden Weg gefunden um den fehlenden Schlüssel für aptitude verfügbar zu machen:
Zuerst muss der Schlüssel geholt werden. Das geht mit gpg:
gpg --recv-keys 35CC62D2200CBE07
Dann diesen Schlüssel in eine Datei exportieren:
gpg -a --export 200CBE07 > newsite.key.gpg
Und letztlich aptitude den neuen Schlüssel mitteilen:
apt-key add newsite.key.gpg
Schon funktioniert aptitude update wieder ohne Fehlermeldungen.
World Builder
Hab von einer Freundin den Link zu einem sehr schönen Kurzfilm bekommen:
World Builder from Bruce Branit on Vimeo.
Sehr cool Idee und unglaublich gut gemacht.
Good bye Macoholic
Ein über die Jahre liebgewonnener Blog-Freund hat beschlossen seine digitalen Aktivitäten erstmal einzustellen. Hat seine Blogs geschlossen, seinen Twitter-Account stillgelegt und auch seinen Flickr-Account gesperrt.
Dramatischer Schritt und wirklich schade, da ich ich ihm immer gerne durchs Netz gefolgt bin. Ich hoffe er kommt bald wieder.
"So long and thanks for all the fish."
Douglas Adams
Ipernity now offers Slideshow Badge
Finally Ipernity has a Flash Badge for mini slide show too.
This is very cool:
monitoring the real user experience
The Problem
You may know a lot of site monitoring tools like Nagios, BigBrother, Cacti etc. But none of them can measure a near real user experience. We often have the case that someone is complaining about slow page loading. But all of your monitorings and measurement tools show normal performance of the site. Most of the tools are capable of fetching urls. But none of the tools I know behaves like a real browser. Thus doing the real loading of the page, all it's elements and includes and rendering the page in fact.
But with a little scripting and a Linux system you can do just that.
The Solution Idea
So we like to have a site monitored as realistic as possible from a users point of view. Why not use a real browser to monitor the site performance? The trick is, to use Firefox to render a page and simply measure the time it needs to complete.
Why Firefox you ask? Because Firefox is free. You can control it via the command line (scriptable) and it got some usefull add-ons we'll need. And - it's very popular.
The solution itself
To run firefox you need a graphical user interface e.q. the X11/X86org environment. But this is not what we want for automatic continous measures. So we need a way to run Firefox in headless mode. Unfortunatly Firefox itself has no option to run it without a valid DISPLAY. This is where Xvfb comes in handy. This is a virtual frame buffer daemon for Linux. It simulates a X-Window server but doesn't need a real/physical graphical output system. So you can run this on your server without a video card and tell Firefox this is your X-Server.
You can even run your normal X-Server and the Xvfb in parallel on your system. Just start Xvfb on a different Port:
/usr/bin/Xvfb :2
Then tell Firefox where the DISPLAY is:
firefox --display=127.0.0.1:2.0
But first we have to pimp Firefox a little bit. When you open Firefox via the command line and give it a URL this Page will be opened and rendered. But to measure the time for that in a script we need Firefox to close itself after successfull rendering. Then we can measure the whole time with the systems "time" command. OK, this will also count the startup and shutdown time of Firefox. But these times should be almost constant on your system. So if you like, you can measure these times in more detail and substract them from the page render times.
To have Firefox close after rendering the page and to have a proof that the page was rendered correct we use the PageSaver Add-On to Firefox. This add-on enhances Firefox to take screenshots of the whole page and save it to a jpeg file. Even more, you can control this add-on from the command line as well.
Put all this together and you have a browser which can be startet on a headless system (with Xvfb), given an url to render, renders the page, saves the rendered page as an image and closes. Perfect!
Now put a little shell scripting around and put the measured times into an RRD file, generate graphics with rrdool and you get a nice near real site performance monitoring.
This is my dirty script: make_screenshot_new.sh
The script to create the RRD files: create_screenshot_rrd.sh
The script to generate the graphs: make_graphs.sh
After creating the RRD file your can call the make_screenshot_new.sh periodically via Cron to measure the render times. But make sure the interval correspond with the interval you set in the RRD file
my first rails project – chunky downloads
I just released my first ruby on rails project. It's called "chunky" and handles download links of chunky files. Here is a little screencast about how to use it:
As a system administrator I often get calls from colleagues who have to send a bigger file to our clients or partners. Usually these files are too big for email transfer or wont pass mail filters on servers. Of course we have an FTP-Server for such purposes but believe me... explaining the use of FTP everytime and fiddling around with FTP download problems on the client/partner side as well is pain in the ... you name it. Sometimes there are also some special requirements to the download as an expire date or max download count.
A solution to these requirements is chunky the download manager in RoR (Ruby on Rails). You can upload a file in the admin section or choose an already uploaded file. Then your create a personalized, unique download link for this files. You can specifiy an expire date and a maximum download count. You will be notified by email about the new link and you can even notify your client about the new link.
I realesed this project under GPLv3 on the Google Code Project: http://code.google.com/p/chunky/
when phones go mad
I recently saw the latest Batman movie "The Dark Knight". Somewhen in the plot it was introduced that Wayne Enterprises (the company of Batmans alter ego Bruce Wayne) is cooperating with the government in building mobile phones. And then later on Batman turns every phone in the city (obviously the ones his company equipped) into his eyes and ears by accessing them remotely. Sounds like science fiction? I don't think so.
Look at the latest news about the major bug in the Google Android mobile. A hidden console can be accidentally started and this takes every text input and interprets this a system command executed by the super user. So if you type "reboot" your Android will reboot. How nasty is this? This doesn't seem to be a simple software bug to me. Why can a hidden process receive copies of the input from everywhere in the system? This was surely not implemented by chance.
It's also well known that both, Google and Apple, are able to delete applications remotely from their smartphones. So you can be sure they can also install new applications without your knowledge. And you can be sure it's technically absolutely possible to silently turn on your mobiles microphone and camera without your knowledge. This is not science fiction this is technical reality. It's just a matter of time until this will be used. Either intended or hacked by some third party or hijacked by the goverment for sake of security.
when RPM can save your ass
There are very rare times I like the RPM package management or a redhat system. But today this save my ass. Someone or something did a "chmod 777 /" on one our machines...
This normaly leads to immediate excution of this person. But anyhow I had to deal with this and recover the machine. Almost none of the system daemons startet and even a console login wasn't possible due to wrong permissions of vital files.
The solution was a very simple shell script. The RPM database contains information about the permission of all packages. These permission can be re-applied:
#!/bin/sh -x for package in `/bin/rpm -qa`; do/bin/rpm -qv --setperms $packagedone
So simply boot in single user mode and create this little script an run it. This should repair all the necessary permissioins.
30km Lauf – letzte Marathon Vorbereitung
Heute bin ich in Templin zur Vorbereitung auf den Marathon in zwei Wochen die 30km gelaufen. Zuerst um den schönen Lübbesee rum und dann noch um den Templiner Stadtsee.
Nach den ersten 10km die ich auf dem asphaltierten Radweg am Lübbesee zurückgelegt habe bog ich auf einen Waldweg direkt am See ab. Da merkte ich sofort, daß das Laufen auf Waldwegen entgegen der landläufigen Meinung doch anstrengender ist als Asphalt. Man muss ständig aufpassen das man sich nicht die Hacken an irgendwelchen Wurzeln bricht.
In Ahrensdorf, ca. bei Kilometer 16, musste ich mich dann auf Trampelpfaden durchs Unterholz kämpfen. Das war natürlich der Geschwindigkeit etwas abträglich. Hat aber auch Spaß gemacht.
Nach 20km merkte ich dann erstmals Erschöpfungserscheinungen. Die Beine wurden schwerer. Aber trotzdem ging der Rest der Strecke noch relativ gut von der Socke. Ich bin guter Dinge, daß ich beim Marathon durchhalte und beim Pace dort dann so bei 6:10 min/km im Gesamtschnitt ankomme. Das wären dann so ca. 4:20h für die gesamte Strecke...


