Download DB2 Upgrade DB2

iptables firewall pitfall

March 11th, 2010 by Leons Petrazickis

An important thing to remember about rulesets in /etc/sysconfig/iptables is that they are chains. The first rule is applied, followed by the second, and so on. It’s the opposite of CSS that way. More specific rules should go first, while all-encompassing rules should go last.

I was trying to open the usual DB2 ports on RHEL. For some reason, nothing was working.

It turned out that this line was at fault:

-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited

This rejects all incoming traffic not otherwise allowed. The line has to go last in the file, after all the open port definitions.

Posted in unix | 1 Comment »

device br0 already exists; can’t create bridge with the same name

August 21st, 2009 by Leons Petrazickis

Here’s how you solve either of the following errors on Ubuntu (and possibly Debian):

device br0 already exists; can't create bridge with the same name
device eth0 is already a member of a bridge; can't enslave it to bridge br1.

Removing the device specs from /etc/network/interfaces and restarting the network doesn’t actually remove the device if already active. You need to do it manually.

List the active devices:

ifconfig | more
 

And then do this to any that you don’t want there, such as br0, eth0, eth1, etc:

ifconfig br0 down
# and so on
 

This deactivates the device. At this point you’ll need to restart the network layer twice:

sudo /etc/init.d/networking restart
sudo /etc/init.d/networking restart
 

And you should be sitting pretty. On some systems, networking is known as network, as in:

sudo /etc/init.d/network restart
sudo /etc/init.d/network restart
 

Posted in unix | No Comments »

An IDE for TeX

March 4th, 2008 by Leons Petrazickis

TeXnicCenter is an excellent IDE for developing TeX documents on Windows. It follows the usual interface conventions and is quite helpful in getting started and debugging. TeX is the standard page layout language for writing mathematical and scientific papers.

Here are some excellent tutorials for getting started with TeX.

The IDE requires MikTeX for actually compiling TeX files into PDF, PS, and so on.

Posted in unix, tex | No Comments »

Unknown root password in Suse Linux

March 3rd, 2008 by Leons Petrazickis

After I installed Suse Linux Enterprise Desktop 10, I tried to update it. It prompted me for a root password even though the install hadn’t asked for one — it had only created a regular user. Sudo didn’t help.

I tried booting in single-user mode, but that also prompted me for the root password.

Finally, I appended init=/bin/bash to the Linux boot command in GRUB. That booted me in a passwordless command line, letting me run passwd and fix things.

Posted in unix | No Comments »

Setting up SVN with Trac on a web server

June 21st, 2007 by Leons Petrazickis

Trac is an excellent web-based wrapper for SVN that adds bug tracking, a wiki, and several handy project management features. I keep setting up new repositories up for all the little projects we cook up in DB2 Technical Marketing, so I thought I’d write up a guide.

Installing Trac, SVN, and dav_svn for Apache2 is left as an exercise for the reader.

Create a new SVN repository:

svnadmin create /var/svn/Project
 

Create a new Trac environment:

trac-admin /var/trac/Project initenv
 

Change the owner to Apache so that it can read and write:

cd /var/svn
chown -R www-data Project
cd ../trac
chown -R www-data Project
 

Navigate to Apache site settings:

cd /etc/apache2/sites-enabled
 

If you want Trac to support multiple repositories, edit the trac file to look like this:

<VirtualHost *>
        ServerAdmin me@somewhere.com
        ServerName mysite.com
        DocumentRoot /usr/share/trac/cgi-bin/
        <Directory /usr/share/trac/cgi-bin/>
                Options Indexes FollowSymLinks MultiViews ExecCGI
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>
        Alias /var/trac/chrome/common /usr/share/trac/htdocs
        <Directory "/usr/share/trac/htdocs">
                Order allow,deny
                Allow from all
        </Directory>
        Alias /trac "/usr/share/trac/htdocs"

        <Location /trac.cgi>
                SetEnv TRAC_ENV_PARENT_DIR "/var/trac"
        </Location>
        <LocationMatch "/trac.cgi/[^/]+/login">
                AuthType Basic
                AuthName "Trac"
                AuthUserFile /etc/apache2/trac.passwd
                Require valid-user
        </LocationMatch>

        DirectoryIndex trac.cgi
        ErrorLog /var/log/apache2/error.trac.log
        CustomLog /var/log/apache2/access.trac.log combined
</VirtualHost>
 

The above assumes that all the repositories are in /var/trac

Navigate to Apache settings:

cd /etc/apache2/mods-enabled/
 

Append to dav_svn.conf:

<Location /svn/Project>
   DAV svn
   SVNPath /var/svn/Project

   AuthType Basic
   AuthName "Subversion Repository"
   AuthUserFile /etc/apache2/dav_svn.passwd

  AuthzSVNAccessFile /etc/apache2/dav_svn.authz

  <LimitExcept GET PROPFIND OPTIONS REPORT>
    Require valid-user
  </LimitExcept>

</Location>
 

The above lets you check out from http://yoursite/svn/Project

If you like, you can add a new user to dav_svn.psswd:

cd ..
htpasswd2 /etc/apache2/dav_svn.passwd NewUser
 

Users can then be granted permissions by editing the dav_svn.authz file. Sample file:

[groups]
developers = NewUser, OtherUser
others = ThirdUser

# Restrictions on the entire repository.
[/]
# Anyone can read.
* = r
# Developers can change anything.
@developers = rw

# Other can write here
[/trunk/public/images]
@others = rw

[/trunk/public/stylesheets]
@others = rw
 

Restart Apache:

killall apache2
apache2

You now have have an Trac/SVN install with SVN at http://yoursite/svn/Project and Trac at http://yoursite/trac.cgi

Posted in unix | No Comments »