QuicksearchCreative CommonsBlog Administration |
Block mail from certain countries with sendmailMonday, December 12. 2011If you have your own MTA running... you are probably known with the spam-problems... Once you've tuned the filters, you have to do it again... because a new spam-run comes in. I also blocked whole /8 subnets in different countries (India/China/...)... but that is not a "real" solution... aka I want to block the whole country... The "DNSBL" countries.nerd.dk allows you to do so... the map ip-adresses to countries based on whois-information... so on my MTAs I added the following lines to the mc sendmail file: FEATURE(dnsbl,`br.countries.nerd.dk', `554 - Rejected - SPAM from Brazil:$&{client_addr} rejected')dnl And within a few hours the first are already blocked... I hope this will reduce the amount of incomming spam at the "front door". Because simply... I don't know people in these countries... FreeBSD upgrade a prerelease to a releaseWednesday, November 30. 2011Some while ago I installed a FreeBSD server with 7.3-PRERELEASE, although now I wanted to have it properly upgraded to 7.3-RELEASE. I looked into it quite often... although run into the issue that it didn't work... # uname -r On the FreeBSD forum I found the following thread: Based on the information there I performed the following steps: # env UNAME_r=7.3-RELEASE freebsd-update -v debug fetch -r 7.3-RELEASE Then install the updates: # env UNAME_r=7.3-RELEASE freebsd-update -v debug install And as last step do a reboot, and the result is: # uname -r How to update Python bindings to subversion.Wednesday, July 13. 2011Recently I run into the problem that a team had a requirement for subversion 1.6.6 (while CentOS 5u3 was not supporting this... but the vendor didn't provide a newer release). This team also had a requirement to have TRAC... TRAC is depended on Python... but I was not allowed to update the subversion bindings for python by updating the it on the whole system... so... this is what I did:
Posted by Pieter de Rijk
in Linux/Unix/BSD, System Information Scanner, System Op stuff, Work
at
20:33
CentOS 5 enabling Two-factor SSH authentication via GoogleTuesday, June 21. 2011Today I noticed a very nice article about enabling Google's two-factor authentication for Linux SSH. After reading it... I found some time to play with it... so I enabled it within 10 minutes on my CentOS 5 64bit play-ground server... but there are some small 'caveats'. hg - Command To checkout the code, you must make install the mercurial RPM... this one is available via the EPEL repositories. So after having the EPEL repositories enabled, run as root: yum -y install mercurial Compiling the PAM module When you checked out the code. hg clone https://google-authenticator.googlecode.com/hg/ google-authenticator/ You cannot compile directly the module... therefor you must apply a small change to the Makefile. Change where /usr/lib/libdl.so is stated to /usr/lib64/libdl.so (3 occurrences) $ make Now you've to update the /etc/pam.d/sshd so it contains: #%PAM-1.0 Configure SSH You also have to make sure that in /etc/ssh/sshd_config the following settings are set on yes: ChallengeResponseAuthentication yes And restart the SSH-daemon Set up your smartphone/credentials on the system $ google-authenticator And you're done Give it a try to SSH to that box... TIP: Make sure you've an SSH session still open... or you might lock yourself out of the system...
Use maildrop to forward a mail to another mail boxThursday, November 11. 2010I recently had the need to forward e-mail based on the from field to another mailbox. I know, it's possible with a simple .forward in your $HOME, but that will forward all the mail. So after some further searching I end up with the following rule for your maildrop filter... it simply checks if the mail (in this example) is from linus@mail.example.com and will forward it to linuxbox@collector.example.com: if ( /^From: .*linus@mail\.example\.com.*/ ) And that's all you need to put add to your $HOME/.mailfilter Use Picasa RSS Feed to show album on my own websiteTuesday, October 19. 2010Recently I've moved the web albums of my kids from my own webserver to Google Picasa. But... I wanted to keep my nice javascript based carousel In the current code I already had some PHP-code that creates the content of the carousel using an array. Now I added two new features in the 'website'.
1. Config files One 'global' config:
Per album I've a config.php in that directory, so for example we've the following content: <?php 2. Download the RSS (XML) feed and cache it: <?php 3. Extract the URLs with the photos from the feed <?php That's all The Linux Kernel exploit - become root by running 32bit code on a 64bit machineWednesday, October 13. 2010A lot of discussion is about one of the last kernel exploits... the one that you can become root using 32bit code on a 64bit machine. So I wanted to know if I'm vulnerable as well... just wanted to know how it works So I simply did (as normal user) on a vulnerable version of the Linux kernel on CentOS 5.5: $ mkdir /tmp/expl Now run the binary: [pieter@testbox ~]$ whoami [pieter@testbox ~]$ whoami
Fixed LDAP after upgrading from CentOS 5.4 to 5.5Monday, October 4. 2010Some months ago I upgraded my CentOS servers from version 5.4 to 5.5. One of these servers were running LDAP Master and LDAP Slave as playground. Although after the upgrade to CentOS 5.5 it was broken, but due to other priorities I didn't had a change to fix it. On my systems I enabled TLS to communicate to LDAP-servers and also enabled kerberos. So this results in a modified /etc/sysconfig/ldap: # Enable Kerberos But I noticed that the RPM installed a new version of that, although with the extension .rpmnew. So after applying the changes that were in the .rpmnew file and when I set SLAPD_LDAPS and SLAPD_LDAPI to "yes" I end up with the following content: # Parameters to ulimit called right before starting slapd And guess what... It works again Creating Snapshots of a backup using LVM snapshotMonday, February 22. 2010Normally I used to have a backup-retention-script in place that will create a TAR-ball of the backup data (using Herakles). But this way I was not able to have a retention of longer then 3 days So I had to look into another solution, I could add a new harddrive in the server... but there should be something else possible. So I ended up by using LVM snapshots. So I created a Volume group of about 100GB. In that volume group I created a logical volume of about 30GB, which is enough (and if not, we can 'grow' the Filesystem thanks to LVM After having all that done, I've created a script located in /root/scripts/lvm-snapshot. This script runs every midnight and creates a snapshot. #!/bin/bash And the crontab entry is: # crontab -l RHEL 5 with puppet, mongrel and apacheFriday, December 11. 2009This week I had to set up puppet with mongrel and apache for the balancing. To be honest... I never heard aboutthe puppet tool at all before (sorry puppet-developers On how I set up all the stuff in the test environment/production environment. First I identified the right RPMs from EPEL, because I had no connection to the Internet:
You can install them with 'yum --nogpgcheck localinstall *.rpm'. You must als make sure that apache with mod_ssl is installed as well (yum install httpd mod_ssl). Configuring Apache for load-balancing As mentioned before, apache and puppet master must be installed. First I copied and modified the /etc/init.d/httpd script to use it for puppet loadbalancing. Find my copy of the script on: http://www.xs4all.nl/~paderijk/blog/puppet-balancer So you can do: # cd /etc/init.d/ Now we have to create the some additional directories: # mkdir -p /var/log/puppet-balancer I used the configuration file initially set up by from Jeff McCune and modified it for RHEL5. This file can be found on: http://www.xs4all.nl/~paderijk/blog/puppet-balancer.conf So you can put it into place like this: # cd /etc/puppet-balancer/conf And finally we need to create a symlink name /usr/sbin/puppet-balancer which links to /usr/sbin/httpd # ln -s /usr/sbin/httpd /usr/sbin/puppet-balancer I've done this, because somehow the init-scripts are having some inconstancy. And we also need a /etc/sysconfig/puppet-balancer file # cd /etc/sysconfig For so far the apache configuration, still we don't start the puppet-balancer 'service'. First we need to configure and start the puppet master. Configuration puppetmaster The configuration of the puppetmaster was actually very easy. *UPDATE* A colleague pointed me on the fact that the CA wasn't set up properly going into mongrel mode. So first start puppetmaster normally: # service puppetmaster start ; sleep 5 ; service puppetmaster stop Make sure the following line is 'enabled' to /etc/sysconfig/puppetmaster: PUPPETMASTER_PORTS=( 18140 18141 18142 18143 ) This will enable puppetmaster with mongrel and starts on the ports 18140 to 18143 I also noticed that the RPM for puppetmaster didn't set up all the required directories, so I need to add them manual: # mkdir -p /var/lib/puppet/yaml/{facts,nodes} Start the puppetmaster and Apache (puppet-balancer) Now we can start the puppetmaster: # service puppetmaster start But we want to survive reboots as well, so we do also: # chkconfig puppetmaster on Now the Puppet CA is also set up. So now we can start the puppet-balancer (apache) as well. But first we need to symlink the key-file and the certificate file: # ln -s /var/lib/puppet/ssl/private_keys/{$(hostname -f).pem,puppet-balancer.pem} And now we can start the puppet-balancer: # service puppet-balancer start And get it also up and running after a reboot: # chkconfig puppet-balancer on More details on how to do further configuration/setting up manifest files et cetera can be found on the Puppet wiki: Continue reading "RHEL 5 with puppet, mongrel and apache" Mozilla Labs WeaveSaturday, October 10. 2009
In one of the last Linux Magazine issues, there was an article with the title "Untangling the Web with Mozilla Weave". I really recognized the issue of having several Firefox instances with their own bookmarks/tabs/et cetera.
So I thought... let's give it a try, and so far... it works fine for me. I've now set up Weave on my Linux Laptop and Linux workstation at home. The upcoming week I will set up weave for my Linux workstation at work and on my Portable Apps Firefox on ahum Windows Vista workstation. Load Grid Engine accounting file into MySQLWednesday, September 30. 2009Recently I need to create a report about utilization of an HPC Cluster that uses Grid Engine, but we didn't had ARCO and so not running yet for that cluster So I digged into my brain on how to load data from a "RAW" format into a database... it's something I did when I worked for PricewaterhouseCoopers Advisory, but then I used financial data. Please press the continue reading link below... to read more Continue reading "Load Grid Engine accounting file into MySQL" Uptimal usage of resources, result in "overuse" of licensesThursday, July 16. 2009
A user group we support uses an application and they have the license to use 20 concurrent runs. For them we've implement very recently the Sun Grid Engine job scheduler. Although they recently start complaining that jobs didn't run.
Their cluster exists out of 8 nodes with each 2 cores, so they've 16 slots in the job scheduler. We've set up two queues, the suspendable.q and the unsuspendable.q. Jobs in the suspendable.q queue can get suspended by jobs in the unsuspendable.q queue. So we can have in total 32 concurrent jobs (where 16 will be suspended). Once their cluster is really busy, some jobs will not run... and after some investigation we found out why. The jobs that are suspended don't release their license to the license server. So we can have a total of 16 jobs in the suspendable.q and 4 in the unsuspendable.q. So we start limiting the number of unsuspendable jobs to 4, because the 21nd job that will start running will fail because it won't get a license. Bleeding edge, is indeed bleeding edgeThursday, July 16. 2009
Yesterday I thought let's play with FC12 (aka Rawhide, aka FC11.90). So I enabled the Rawhide-repositories on my FC11 laptop and entered "yum -y update". And after a while it was there... bleeding edge kernel and other packages.
The first issue I run into, was that Firefox 3.5 was not able to run, it caused a segfault. So my final decision was Go back to FC11. I was able to "downgrade" my system in about 60 minutes. At home I've a mirror repository with al the backups, so during installation I added these repositories, so I also had all the updates in one go. Lesson learned: "Bleeding edge... is indeed bleeding edge!" I need my work for my daily work... If I won't need it for my daily work I would have keep FC12 (aka Rawhide, aka FC11.90) on it to participate in developing FC12. Require client-SSL certificate for certain content.Wednesday, May 20. 2009On a kind of "intranet" website, which is secured with username/password combinations and HTTPS I've implemented the next feature: - Authorized users can read everything on the website - Files with in their filename "classified" requires a valid SSL-Client certificate... Here is the output of my apache config: <Directory /usr/sites/ssl-site/intranet/htdocs>Options Indexes MultiViews AllowOverride Authconfig Order allow,deny Allow from all AuthName "intranet" AuthType "Basic" AuthUserFile /usr/sites/ssl-site/intranet/etc/users.pwl require valid-user </Directory> <LocationMatch .*(c|C)(l|L)(a|A)(s|S)(s|S)(i|I)(f|F)(i|I)(e|E)(d|D).+> SSLVerifyClient require SSLVerifyDepth 1 SSLOptions +OptRenegotiate </LocationMatch>
I still have to sort out some issues, like directories having a directory with the name "classified" in them.
(Page 1 of 3, totaling 41 entries)
» next page
Competition entry by David Cummins powered by Serendipity v1.0 |
Some cool linksCategoriesgoogle Analytics |

