Kategoriarkiv: Old Base

replace with sed

Just a reminder for myself cat fil.gammel | sed -e ‘s/gammel/ny/g’ > fil.ny

Udgivet i Knowledge Base, Old Base, Shellscript | Skriv en kommentar

Using CVS

Opret CVS: $ export CVSROOT=/home/cvs/cvsroot $ cvs init Skal nu have noget source i vores cvs, vi laver noget fiktiv source: $ mkdir bigproject $ cd bigproject $ touch source1.c $ touch source2.c $ touch source3.c $ mkdir libs $ … Læs resten

Udgivet i Knowledge Base, Old Base, Windows, Workstation | Skriv en kommentar

Tilpas vindue efter indholds stoerese[IE]

<body leftmargin=”0″ topmargin=”0″ rightmargin=”0″ onblur=”self.close();”> <div id=’mydiv’> 1blablablalbalbalbalabababfgadZ 2blablablalbalbalbalabababfgadZ 3blablablalbalbalbalabababfgadZ 4blablablalbalbalbalabababfgadZ </div> <script> w=document.all[“mydiv”].clientWidth || document.getElementById(“mydiv”).offsetWidth; h=document.all[“mydiv”].clientHeight || document.getElementById(“mydiv”).offsetHeight; document.write(document.body.offsetWidth); document.write(document.getElementById(“mydiv”).offsetHeight); window.resizeTo((document.body.offsetWidth+6),(document.getElementById(“mydiv”).offsetHeight+30)); </script>

Udgivet i Knowledge Base, Old Base, Programmering | Skriv en kommentar

Størrelsen på en div i javascript [IE Only]

<div id=’mydiv’> Hvor hoej er den her crap div??<br><br><br>Saa hoej? </div> <script> height=document.all[“mydiv”].clientHeight || document.getElementById(“mydiv”).offsetHeight width=document.all[“mydiv”].clientWidth || document.getElementById(“mydiv”).offsetWidth alert(height+’ ‘+width) document.write(document.mytab.style.offsetHeight); </script>

Udgivet i Old Base, Programmering, Windows | Skriv en kommentar

Blaster removal

http://securityresponse.symantec.com/avcenter/venc/data/w32.blaster.worm.html

Udgivet i Old Base, Security | Skriv en kommentar

Easy way to make new passwords

On FreeBSD: jot -r -c 160 a { | rs -g 0 8 It will output something like this: whhmuqxn amajtohu ydtetwjw ysnctfcl svsiypsf cvalnoex dvoburbw fedkcmfx pikwqwiv umaxmqcq iqmtcnny vsunccxj owghvpgo lndrpswr flgtvyjz vphojoqc zofbcxto reaixjhj hmoeabtg fukuimvk //Vladimirr.dk

Udgivet i FreeBSD, Knowledge Base, Old Base | Skriv en kommentar

Register globals workaround

Be sure to think of the consequenses <? if (!empty($_REQUEST)) { extract($_REQUEST); } print $fisk; ?>

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

ProFTPD via MySQL

ProFTPD via MySQL With mod_sql you can handle your user authentication in ProFTPD via an MySQL table. Required is a fresh compiled actual ProFTPD with mod_sql enabled. Enable mod_sql ./configure –with-modules=mod_sql:mod_sql_mysql First you should create an new datebase named “proftpd” … Læs resten

Udgivet i Knowledge Base, Old Base, SQL | Skriv en kommentar

sql til mod_sql_log

smid mod_sql_log ind: http://www.outoforder.cc/projects/apache/mod_log_sql/’ guide: http://www.linux-mag.com/2002-10/lamp_01.html sæt flg i mod_sql_log.conf: LogSQLLoginInfo localhost apache KoDe LogSQLSocketFile /var/run/mysql/mysql.sock LogSQLDatabase apache LogSQLCreateTables On LogSQLMassVirtualHosting On LogSQLPreserveFile apache_queries.sql nice queries: # sidste 30 besøg med lidt relevant data SELECT remote_host, request_uri, bytes_sent, status, FROM_UNIXTIME(time_stamp) … Læs resten

Udgivet i Apache, Knowledge Base, Old Base, SQL | Skriv en kommentar

Apache (2.x) logfiler i MySQL

Flg, får apache til at formattere logen og parse den til stdin på mysqllog.pl CustomLog “| /usr/bin/mysqllog.pl” mysql LogFormat “%h#%v#%U#%{User-agent}i#%{Referer}i#%s#%b#%r” mysql Mysqllog parser så input til mysql: #!/usr/bin/perl # script: mysqllog use DBI; use constant DSN => ‘dbi:mysql:system’; use constant … Læs resten

Udgivet i Apache, Knowledge Base, Old Base | Skriv en kommentar