Static IP with DHCP-Assigned DNS on Ubuntu 9.10

Posted by Chief on Dec 3, 2009 in Reference, System Administration
No Comments

There is a ton of bug reports regarding the Network-Manager’s nm-applet not properly configuring static ips. There are, and always have been, bugs in the nm-applet, in each of its versions. In short, getting a static ip with dhcp assigned DNS parameters requires editing the /etc/dhcp3/dhclient.conf file. Here we go.

  1. sudo vi /etc/dhcp3/dhclient.conf
    >>
    alias {
      interface "eth0";
      fixed-address 192.168.1.101;
      option subnet-mask 255.255.255.255;
    }
    <<
  2. sudo dhclient -r
  3. sudo dhclient

Tags: , , , , , ,

Installing GDAL via FWTools

Posted by Chief on Dec 1, 2009 in System Administration
No Comments
wget http://home.gdal.org/fwtools/FWTools-linux-2.0.6.tar.gz
sudo tar xzf FWTools-linux-2.0.6.tar.gz -C /usr/local
sudo /usr/local/FWTools-2.0.6/install.sh
sudo vi /etc/profile
# Add /usr/local/FWTools-2.0.6/bin_safe to the global $PATH 
pathmunge /usr/local/FWTools-2.0.6/bin_safe
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
sudo cp /usr/local/FWTools-2.0.6/man/man1/* /usr/local/man/man1/
sudo cp /usr/local/FWTools-2.0.6/man/man3/* /usr/local/man/man3/
sudo cp /usr/local/FWTools-2.0.6/share/man/man1/* /usr/local/share/man/man1/
sudo cp /usr/local/FWTools-2.0.6/share/man/man3/* /usr/local/share/man/man3/
logout

Warning: You may break PHP!

The fwtools_env.* files could be copied to /etc/profile.d/, but if you’re running PHP, you’ll break the mechanism that loads php extensions. I don’t know why.

Reference:

FWTools: Open Source GIS Binary Kit for Windows and Linux

Tags: , , , , , ,

Configuring MySQL

Posted by Chief on Nov 12, 2009 in System Administration
No Comments

The following is how I set up MySQL on wharf.

  1. First, ensure mysql is installed: ls /etc/init.d/my*
  2. Now, make mysql start on boot: sudo /sbin/chkconfig --level 35 mysqld on
  3. Start the mysql server: sudo /etc/init.d/mysqld start
  4. Make MySQL more secure: sudo /usr/bin/mysql_secure_installation
  5. Log into mysql as root: mysql -u root -p [to be entered by prompt]
  6. Add another mysql user:
    mysql> CREATE USER 'newuser'@'%' IDENTIFIED BY 'newuserpass';
    mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON *.* TO 'newuser'@'%';
    mysql> FLUSH PRIVILEGES;
  7. Exit mysql: mysql> exit
  8. Test: mysql -u <newuser> -p <newuserpass>

Tags: , , , , ,

Git – Install and Configure

Posted by Chief on Nov 4, 2009 in System Administration
No Comments

Git is a code revision system not much unlike subversion and CVS.  One of the best features of git is that it is a distributed revision system, so you can check-in, check-out, commit, revert, etc without ever needing direct access to the central repository.  You can work with your repository as if it were a centralized system if need be found. Read more …

Tags: , , , , , , , ,

Installing JDK on RHEL5

Posted by Chief on Oct 3, 2009 in System Administration
No Comments

I needed to install the JDK as a prerequisite for GeoServer.

Steps

  1. Download latest JDK (jdk-6u16-linux-i586-rpm.bin) from Sun.
    Note: navigating Sun’s website and using their download accelerator is a PAIN.
  2. chmod a+x jdk-6u16-linux-i586-rpm.bin
  3. sudo ./jdk-6u16-linux-i586-rpm.bin
  4. ls -l /usr/java
  5. Create file /etc/profile.d/java-jdk.sh
    1. sudo vi /etc/profile.d/java-jdk.sh
    2. cat /etc/profile.d/java-jdk.sh
      #!/bin/bash
      export JAVA_HOME=/usr/java/latest
      export JRE_HOME=/usr/java/latest/jre
      export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$PATH

Tags: , , , ,

Setting Up SSH Keys

Posted by Chief on Sep 23, 2009 in System Administration
No Comments

Question How do I configure my machine to be able to ssh into another machine without having to enter a password every time?

Answer:
Let’s first define a few things.

  • localhost – Your regular, every-day machine. This machine will be making outbound calls to other machines, and is the originator of the ssh/scp requests.
  • server – The machine to which one would want to log into via ssh, or scp files to.

First, generate the localhost’s key:
localhost$ ssh-keygen -b 4096 -t rsa
localhost$ scp ~/.ssh/id_rsa.pub server:~/.ssh/localhost.pub

We’ll go the fail-safe way, ensuring that an authorized_keys file exists, then we’ll cat the old with the new and replace the existing authorized_keys file:
server$ touch ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ cp ~/.ssh/authorized_keys ~/.ssh/authorized_keys.bak
server$ cat ~/.ssh/authorized_keys.bak ~/.ssh/localhost.pub > ~/.ssh/authorized_keys

That’s all there is to it.

Question Why would you want to do that?

Answer:
Say you have a bash script that needs to copy files to another machine every time they are generated. The best way to do that is to scp them. Scp requires ssh authorization. By setting up these keys, you can allow your script to scp files securely without locking at the password prompt.

Tags: , , , ,

Copyright © 2010 cat brain.log | less All rights reserved.
Shades v1.2 theme from BuyNowShop.com.