Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Korrekte Uhrzeit auf kreative Weise
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation
View previous topic :: View next topic  
Author Message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Thu Jun 16, 2005 7:21 pm    Post subject: Korrekte Uhrzeit auf kreative Weise Reply with quote

Korrekte Uhrzeit trotz extrem restriktiver Firewall? Geht nicht?

Geht doch!

nötige Voraussetzungen:
Internetzugang mit oder ohne Proxy von Linux aus

Code:
date --set="`wget -S www.gentoo.org 2>&1 | sed -n -e '/Date/p' | cut -d' ' -f4-`"


Was tut das nun?
1) mittels wget holen wir uns eine beliebige Internetseite
(vorzugsweise eine kleine auf einem Server von dem wir annehmen können das sein Uhrzeit ntp-synchron ist)
der Parameter -S veranlaßt wget die HTTP-Header anzuzeigen, in diesen steckt das Geheimniss - die Uhrzeit
2) sed schnibbelt alles außer der Headerzeile mit dem aktuellen Datum des Webservers ab
3) das Datum wird zurechtge-cut-ed
4) Das Ergebnis aus 1-3 wird als ein String an date übergeben und die Uhrzeit des Systems darauf gestellt.

Andere Alternative - in Perl realisiert - (danke Anarcho für den Hinweis) :arrow: HTPdate

Viel Spaß beim Zeit stellen :wink:

mod-edit: +[TIP] --slick
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself


Last edited by think4urs11 on Thu Jun 16, 2005 8:07 pm; edited 1 time in total
Back to top
View user's profile Send private message
Anarcho
Advocate
Advocate


Joined: 06 Jun 2004
Posts: 2970
Location: Germany

PostPosted: Thu Jun 16, 2005 7:37 pm    Post subject: Reply with quote

Abo vom Linux-Magazin :?:
_________________
...it's only Rock'n'Roll, but I like it!
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Thu Jun 16, 2005 7:44 pm    Post subject: Reply with quote

äh nö, wieso?
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
think4urs11
Bodhisattva
Bodhisattva


Joined: 25 Jun 2003
Posts: 6659
Location: above the cloud

PostPosted: Thu Jun 16, 2005 8:04 pm    Post subject: Reply with quote

:oops: ich denke mal du meinst das da :arrow: HTPdate

abgesehen davon das es anscheinend (noch?) nicht in Portage ist besser als mein eigenes Gebastel!
_________________
Nothing is secure / Security is always a trade-off with usability / Do not assume anything / Trust no-one, nothing / Paranoia is your friend / Think for yourself
Back to top
View user's profile Send private message
ian!
Bodhisattva
Bodhisattva


Joined: 25 Feb 2003
Posts: 3829
Location: Essen, Germany

PostPosted: Fri Jun 17, 2005 11:13 am    Post subject: Reply with quote

Ebuild dazu:
http://download.iansview.com/gentoo/experimental/net-misc/htpdate/htpdate-0.8.2.ebuild
_________________
"To have a successful open source project, you need to be at least somewhat successful at getting along with people." -- Daniel Robbins
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) Deutsche Dokumentation All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum