linux poison RSS
linux poison Email
0

HowTo Convert CHM files to PDF in Linux

1. Download chm2pdf by clicking [Here].

3. Now extract the downloaded file.

4. Open your Terminal and browse to the folder you extracted and run:

5. sudo python setup.py install

Now to use it is very simple:

In Terminal, type: chm2pdf filename.chm

Dependencies

You need these packages installed and working:

* chmlib
* pychm
* htmldoc

Read more
3

HowTo do Transparent proxy with Squid

Modify or add following to squid configuration file (/etc/squid/squid.conf):

httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
acl lan src 192.168.1.1 192.168.2.0/24
http_access allow localhost
http_access allow lan


Added following rules to forward all http requests (coming to port 80) to the Squid server port 3128 :

[eth0 connected to internet and eth1 connected to local lan]

iptables -t nat -A PREROUTING -i eth1 -p tcp –-dport 80 -j DNAT –to 192.168.1.1:3128
iptables -t nat -A PREROUTING -i eth0 -p tcp –-dport 80 -j REDIRECT –-to-port 3128

Read more
2

How To Apply Patch to Kernel Source

Go to directory which holds the kernel source code

# cd /usr/src/linux
# bzip2 -dc /usr/src/patch-x.y.z.bz2 patch -p1 –dry-run

–dry-run option to check that the patch applies cleanly. It can be a real pain to pull out a partially-applied patch. The -p1 option strips off part of the diff file’s pathnames for each changed file (see the patch(1) manpage for more details).

Now you’ve checked that it should apply cleanly, run the following to actually apply it. Then you’re done!

# bzip2 -dc /usr/src/patch-x.y.z.bz2 patch -p1
Read more
0

Make fetchmail deliver via procmail

Just add the following line:

mda “/usr/bin/procmail -d %T”

to your “options” in ~/.fetchmailrc For instance .fetchmailrc may look something like:

poll mail.domain.com protocol pop3 username myusername password mysecretpassword options ssl mda “/usr/bin/procmail -d %T”
Read more
0

Filter attachments (.bat, .exe, etc..) in postfix

Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different. Postfix has several hundred configuration parameters that are controlled via the main.cf file. Fortunately, all parameters have sensible default values

Simple, In /etc/postfix/main.cf enable the body checks with this line:
body_checks = pcre:/etc/postfix/body_checks
Now put something in this file (/etc/postfix/body_checks):
/^(.*)name=\”(.*).(hta|vb[esx]|ws[fh]|js[e]|bat|cmd)\”$/ REJECT
This will filter attachments of various types.
Remove from the above line, whatever you want to allow.Of course you can add some more lines to make postfix a simple spam filter:

/special offer email/ REJECT
/mortgage rates/ REJECT
/other spam mail subjects/ REJECT


Read more
Related Posts with Thumbnails