Archive for the ‘Linux’ Category

Migrating Ubuntu to Linux Mint 10

Here are some random notes for the migration from ubuntu to linux mint 10 (julia) ! /etc/apt/sources.list deb http://packages.linuxmint.com/ julia main upstream import deb http://archive.ubuntu.com/ubuntu/ maverick main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu/ maverick-updates main restricted universe multiverse deb http://security.ubuntu.com/ubuntu/ maverick-security main restricted universe multiverse deb http://archive.canonical.com/ubuntu/ maverick partner deb http://packages.medibuntu.org/ maverick free non-free #deb http://archive.getdeb.net/ubuntu [...]

Linux Virtual Tape Library

to save for later… mhvtl – A Linux Virtual Tape Library http://sites.google.com/site/linuxvtl2/ That could be a really nice backup solution.

ARD (Video)-Podcast Downloader

#!/usr/bin/perl -w # # ARD tagesschau podcast url $url = "http://www.tagesschau.de/export/video-podcast/webl/tagesschau/"; # # wget parameter $wgetopts = "–quiet"; $targetpath = "/tmp"; # # Enable verbose output $verbose = 0; # ############################# use XML::Simple; use LWP::Simple; sub output{ my $msg = shift; if ($verbose) { printf STDERR "$msg\n"; } } $xmlcontent = get($url); my $xml = [...]

Nagios plugin for JBoss monitoring – check_ajp

Released check_ajp v1 – see here

jstat – jvm memory stats

/usr/java/jdk1.5.0_22/bin/jstat -gcutil 18703 1s 10 gcutil = Summary of Garbage Collection Statistics (mandatory) 18703 = process id (mandatory) 1s = refresh interval (optional) 10 = counter (optional) $ /usr/java/jdk1.5.0_22/bin/jstat -gcutil 25532 1s 10 S0 S1 E O P YGC YGCT FGC FGCT GCT 0.00 0.00 71.36 35.59 72.25 39 6.195 1 0.440 6.635 0.00 0.00 [...]

Create a shared disk for VMware ESX guests

To create a shared disk between two or more VMs, login into one of your ESX hosts and create a disk image. cd /vmfs/volumes/#volume-name#/#vm-name#/; vmkfstools -d thick -a lsilogic -c 50G shareddisk.vmdk; Add the new hardrive to the guest(s) and select a new SCSI bus (like SCSI 2:0). VMware create a new SCSI controller. Set [...]

Apache Tomcat & logrotate

Some linux distribution are shiped without a config for the catalina.out (Tomcat application server) $ cat /etc/logrotate.d/tomcat /var/log/tomcat/base/catalina.out { compress copytruncate create 644 tomcat tomcat rotate 30 size 4M } The catalina.out will be rotated after 4 mb and stored for 30 days (/var/log/tomcat/base/catalina.out.1; /var/log/tomcat/base/catalina.out.2.gz and so on)

Linux routing basics

You getting from your ISP a subnet like this 172.30.26.16/28, and your router has the ip 172.30.26.17 ! You need to enable the ip forwarding in the kernel sysctl -w net.ipv4.ip_forward=1 And we need to enable proxy arp! This is necessary because your router must answer all arp request for hosts other than itself sysctl [...]

Ubuntu PHP hardening with Suhosin

Ubuntu includes the php suhosin patches…. Install suhosin extension aptitude install php5-suhosin /etc/php5/{apache2,cli,cgi}/php.ini ; suhosin parameters suhosin.executor.include.max_traversal = 4 suhosin.executor.disable_eval = On suhosin.executor.disable_emodifier = On suhosin.mail.protect = 2 suhosin.sql.bailout_on_error = On Restart apache service apache2 restart Sometimes it could be necessary to set suhosin.session.encrypt to off for some login scripts.

Postfix as relayhost with SASL auth

Client configuration (notebook, workstation what ever) Edit your /etc/postfix/main.cf # TLS client parameter smtp_use_tls = yes smtp_enforce_tls = yes # for postfix < 2.3 # smtp_tls_security_level = secure smtp_sasl_tls_security_options = $smtp_sasl_security_options smtp_tls_CAfile = /etc/ssl/certs/cacert.org.pem smtp_tls_loglevel = 0 [...] relayhost = [mx1.example.com]:587 mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 inet_interfaces = loopback-only [...] smtp_sasl_auth_enable = yes smtp_sasl_password_maps = [...]