Autor Archiv

Hilfreiches HowTo zum Thema IPv6, OpenVPN, FritzBox, Synology

18. März 2018 Keine Kommentare
Categories: Allgemein Tags: , , ,

How to run Squid proxy with ClamAV virus scanner

2. Juli 2011 Keine Kommentare

First you have to compile and install the latest version of Squid, ClaimAV and HAVP

./configure –prefix=/usr/local/squid_3/
make install

vi /usr/local/squid.conf

cache_peer parent 8080 0 no-query no-digest no-netdb-exchange default
cache_peer_access allow all
#Only HTTP traffic should go through HAVP
acl Scan_HTTP proto HTTP
never_direct allow Scan_HTTP

acl none_HAVP  proto HTTPS FTP
always_direct allow none_HAVP

./configure –prefix=/usr/local/clamav/
make install

./configure –prefix=/usr/local/HAVP/
make install

Now it should work!
/usr/local/squid_3/squid start

Categories: Linux, Squid Tags: , , , , ,

How to activate a swap partition?

7. September 2009 Keine Kommentare

vi /etc/fstab
/dev/sda                 swap       defaults                   0 0

swapon /dev/sda

Categories: Linux, RedHat, SuSE Tags: , ,

How to find out Linux kernel and distribution version

18. Juni 2009 Keine Kommentare

Distribution version
less /etc/issue

Kernel version
less /proc/version

Categories: Linux, RedHat, SuSE Tags: , , ,

How to limit squid bandwidth for YouTube & Co

15. Juni 2009 Keine Kommentare

vi /etc/squid/squid.conf

#Stream & Download Limit

#URL based
acl stream_1 url_regex -i .googlevideo .myvideo .youtube
acl stream_2 urlpath_regex -i .flv$ .swf$ .mp3$ .mpg$ .wmv$ .rm$ .asf$

#Mime-Type based
acl stream_3 req_mime_type -i video/x-flv$ video/flv$ video/x-swf$ video/x-swf$ application/x-fcs$

#Header based
acl stream_4 req_header -i video/x-flv$ application/x-fcs$ video/flv$ video/x-swf$ video/x-swf$

delay_pools 1
delay_class 1 1

#Up-Down limit
delay_parameters 1 99999/99999

delay_access 1 allow stream_1
delay_access 1 allow stream_2
delay_access 1 allow stream_3
delay_access 1 allow stream_4
delay_access 1 deny all

Categories: Linux, Squid Tags: , ,

How to create a .csv which is Datev compatible

12. Juni 2009 Keine Kommentare

require_once ‚Spreadsheet/Excel/Writer.php‘;

// Variable festlegen
$odbc = ’sy_xvol‘;
$user = ‚bla‘;
$pass =    ‚bla‘;
$umsatz = ‚Umsatz‘;
$datum = ‚Datum‘;
$date = date(„d.m.y“);

// mape generieren
$workbook = new Spreadsheet_Excel_Writer();

// header senden

// tabelle generieren
$worksheet =& $workbook->addWorksheet(„Datev_AdHoc_($date)“);

// individuelles format 1
$format_tableueberschrift =& $workbook->addFormat();

// individuelles format 1
$format_ueberschrift =& $workbook->addFormat();

// Datumsformat-Formatieren
$date_format =& $workbook->addFormat();

// Tabellendaten (kopfzeile)
$worksheet->write(0, 0, ‚WKZ‘,$format_ueberschrift);
$worksheet->write(0, 1, ‚Soll/Haben‘,$format_ueberschrift);
$worksheet->write(0, 2, ‚Umsatz‘,$format_ueberschrift);
$worksheet->write(0, 3, ‚BU‘,$format_ueberschrift);
$worksheet->write(0, 4, ‚Gegenkonto‘,$format_ueberschrift);
$worksheet->write(0, 5, ‚Belegfeld1‘,$format_ueberschrift);
$worksheet->write(0, 6, ‚Belegfeld2‘,$format_ueberschrift);
$worksheet->write(0, 7, ‚Datum‘,$format_ueberschrift);
$worksheet->write(0, 8, ‚Konto‘,$format_ueberschrift);

// Datenbankverbindung
$conn = odbc_connect („$odbc“,“$user“,“$pass“);

// Tabelle einlesen und zeile für zeile in Tabelle

$qry = „select ‚Eur’as WKZ, ‚S‘ as ‚Soll/Haben‘, convert (char,co.invoice_net+co.vat,101)as ‚$umsatz‘,“ as BU, ‚4400‘ as Gegenkonto, co.order_ref as Belegfeld1,“ as Belegfeld2, convert (char, co.order_date,5)as ‚$datum‘, a.accounts_sys_ref as Konto from customer_order co, address a, organisation o

where co.order_date between convert(datetime,’$_POST[von_ah]‘)
and convert(datetime,’$_POST[bis_ah]‘)
and co.status_ref = 6
and co.customer_ref = o.organisation_ref
and co.invoice_status_ref = 9
and co.invoice_address_ref = a.address_ref
and co.order_type_ref in (1,3,7,11)
and co.vat not like ‚0.00‘
order by Belegfeld1″;

// Zurückgabe Query Result
$result = odbc_exec($conn,$qry);

$anz = 1;
while($row = odbc_fetch_array($result))
$worksheet->write($anz, 0, $row[‚WKZ‘]);
$worksheet->write($anz, 1, $row[‚Soll/Haben‘]);
$worksheet->write($anz, 2, number_format($row[$umsatz], 2, ‚,‘, “));
$worksheet->write($anz, 3, $row[‚BU‘]);
$worksheet->write($anz, 4, $row[‚Gegenkonto‘]);
$worksheet->write($anz, 5, $row[‚Belegfeld1‘]);
$worksheet->write($anz, 6, $row[‚Belegfeld2‘]);
$worksheet->write($anz, 7, preg_replace(‚/(d+)-(w+)-(d+)/i‘,’${1}${2}‘, $row[$datum]));
$worksheet->write($anz, 8, $row[‚Konto‘]);

$anz ++;

//Mappe senden

// Daten aus dem Speicher löschen

// Close Connection

Categories: PHP Tags: , ,

How to ensure raw devices loaded automatically at startup

11. Juni 2009 Keine Kommentare

vi /etc/udev/rules.d/60-raw.rules

ACTION==“add“, KERNEL==“sdb1″, RUN+=“/bin/raw /dev/raw/raw1 %N“
ACTION==“add“, KERNEL==“sdb2″, RUN+=“/bin/raw /dev/raw/raw2 %N“
ACTION==“add“, KERNEL==“sdb3″, RUN+=“/bin/raw /dev/raw/raw3 %N“
ACTION==“add“, KERNEL==“sdb5″, RUN+=“/bin/raw /dev/raw/raw10 %N“
ACTION==“add“, KERNEL==“sdb6″, RUN+=“/bin/raw /dev/raw/raw11 %N“
ACTION==“add“, KERNEL==“sdb7″, RUN+=“/bin/raw /dev/raw/raw12 %N“
ACTION==“add“, KERNEL==“sdb8″, RUN+=“/bin/raw /dev/raw/raw20 %N“
ACTION==“add“, KERNEL==“raw*“, OWNER==“sybase“, GROUP==“sybase“, MODE==“0640″

Categories: RedHat Tags: , , ,

How to extract multiple images from a single image file

11. Juni 2009 Keine Kommentare

That is the question…

Categories: PHP Tags: , ,