SVN+SSH Howto: Subversion Quick and Simple

Posted on the March 11th, 2009 under HOWTOs,Sys Admin by jglemza

Here’s a quick and simple way to create a Subversion repository while maintaining security by using SSH and the filesystem permissions.

  1. Create users and add them to a group. There are a bunch of different ways to do this. I am only showing you how to create a group.
    groupadd svn-users
  2. Make a directory to house the repository.
    mkdir /var/lib/project
  3. Create the repository.
    svnadmin create /var/lib/project
  4. Change permissions to allow the group read/write access.
    cd /var/lib/project
    chgrp svn-users db db/transactions db/write-lock db/revs db/revprops hooks locks
    chmod 2770 db db/transactions db/revs db/revprops
    chmod 660 db/write-lock
    chmod 750 hooks
    chmod 770 locks

You can now have your users access the repository over SSH.

svn+ssh://username@server.example.com/var/lib/project

If your clients are on Windows, I recommend using TortoiseSVN.

Credit goes to the Carnival of Technology.

Bookmark and Share

Installing Fedora 10 on the Acer Aspire One

Posted on the January 26th, 2009 under HOWTOs,Personal,Technology / Computing by jglemza

Fedora Logo

After many hours of playing with my Aspire One I have settled on Fedora 10 for my distro of choice. A lot of this guide have been adopted from, The road to Elysium blog. However, I prefer to use GNOME and the Ext4 filesystem. I have not noticed performance hit from using Ext4.

These steps are intended to be performed from top to bottom and in order.

My Hardware

  • Acer Aspire One (A150)
    • 1.5GB RAM
    • 60GB OCZ SSD
    • 6-Cell Battery
  • USB Flash Drive

Live CD Creation

  1. Download the Fedora 10 Live CD. (681MB)
  2. Download UNetbootin. Linux (3.6MB)  Windows (3.8MB)
    1. If you’re using the Linux version, remember to do the following. Be sure to run the program as root.
      chmod 755 unetbootin-linux-307
      sudo ./unetbootin-linux-307
  3. Open UNetbootin and load the Fedora ISO on it. Look at the configuration below.
    Select your flash drive in the drop down box.

    Select your flash drive in the drop down box.

Live CD Installation

  1. Insert your USB flash drive into the Aspire One.
  2. Press F12 at the BIOS prompt.
  3. Select your USB KEY as the location to boot.
  4. Once you are on the Live desktop, double-click on “Install to Hard Drive.”
  5. Continue through the installation process. When presented with the partition choices, choose “Custom Partition Layout.”
  6. Delete all partitions on the drive.
  7. Create the boot partition. (This will most likely become /dev/sda1)
    1. Mount Point: /boot
    2. Filesystem: Ext2
    3. Size: 200MB
  8. Create the root partition. (This will become /dev/sda2)
    1. Mount Point: /
    2. Filesystem: Ext3
      *It doesn’t matter which filesystem you choose. It will be Ext3 no matter what. This is due to the way the Live CD installs itself. It does a dd of the live image to the hard drive.
    3. Size: Remaining free space
  9. Continue with the installation. Once the image is transferred you will need to reboot.
  10. Once the system boots the installer will ask you a few more questions.

Disable SELinux

  1. After the installation is completed you need to disable SELinux. Edit /etc/sysconfig/selinux to look like the following.
    SELINUX=disabled

Converting the Ext3 Filesystem to Ext4

  1. Reboot the machine and load the Live CD once again.
  2. Open a terminal. (Applications -> System Tools -> Terminal)
  3. Mount the local disk.
    su -
    mkdir /mnt/disk
    mount /dev/sda2 /mnt/disk
    mount /dev/sda1 /mnt/disk/boot
    mount -o bind /sys /mnt/disk/sys
    mount -o bind /proc /mnt/disk/proc
  4. Change the root filesystem.
    chroot /mnt/disk /bin/bash
  5. Edit the /etc/fstab file. Change the root filesystem from ext3 to ext4. Example below.
    /dev/sda2     /     ext4   defaults     0 0
  6. Run a filesystem check.
    fsck -pf /dev/sda2
  7. Convert to ext4.
    tune2fs -O extents,uninit_bg,dir_index /dev/sda2
  8. Run another filesystem check.
    fsck -pf /dev/sda2

Creating the New Initial Ramdisk Image

  1. Change the current working directory.
    cd /boot
  2. Move the old image.
    mv initrd-2.6.27.5-117.fc10.i686.img initrd-2.6.27.5-117.fc10.i686.img.ext3
  3. Create the new initial ramdisk.
    mkinitrd initrd-`uname -r`.img `uname -r`
  4. Exit the chroot environment.
    exit
  5. Unmount filesystems.
    cd
    umount /mnt/disk/boot/
    umount /mnt/disk/sys/
    umount /mnt/disk/proc/
    umount /mnt/disk/
  6. Reboot the system.
    reboot

SSD Optimization

Perform the following if you’re using an SSD. If you’re using a hard drive you can skip this section.

Create Ramdisks to Store Frequently Written Areas

  1. Edit your /etc/fstab file. Add the following lines.
    tmpfs      /var/log        tmpfs        defaults           0    0
    tmpfs      /tmp            tmpfs        defaults           0    0
    tmpfs      /var/tmp        tmpfs        defaults           0    0

Disable Access Time Attributes

  1. Edit your /etc/fstab. Modify the root partitions settings. Add noatime and nodiratime to defaults.
    /dev/sda2     /     ext4   defaults,noatime,nodiratime     0 0

Optimizing the Kernel

  1. Add the following to your /etc/rc.local file.
    # Economize the SSD
    sysctl -w vm.swappiness=1               # Strongly discourage swapping
    sysctl -w vm.vfs_cache_pressure=50      # Don't shrink the inode cache aggressively

    # As in the rc.last.ctrl of Linpus
    echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
    echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
    cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate

    echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
    echo 20 > /proc/sys/vm/dirty_ratio
    echo 10 > /proc/sys/vm/dirty_background_ratio

    echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
    echo 10 > /sys/module/snd_hda_intel/parameters/power_save
    echo 5 > /proc/sys/vm/laptop_mode

    #Decrease power usage of USB while idle
    [ -w /sys/bus/usb/devices/1-5/power/level ] && echo auto > /sys/bus/usb/devices/1-5/power/level
    [ -w /sys/bus/usb/devices/5-5/power/level ] && echo auto > /sys/bus/usb/devices/5-5/power/level

    /sbin/setpci -d 197b:2381 AE=47
    /sbin/modprobe pciehp
    /sbin/modprobe sdhci

Change the I/O Scheduler

  1. Edit the /etc/grub.conf file. Add “elevator=noop” to the kernel line.
    kernel /vmlinuz-2.6.27.5-117.fc10.i686 ro root=/dev/sda2 rhgb quiet elevator=noop

General Optimizations and Improvements

These are some tips and tricks that should help improve the Fedora experience for everyone.

Fix SD Card Reader Issues

  1. Create a file in /etc/modprobe.d to blacklist a module.
    echo "blacklist jmb38x_ms" > /etc/modprobe.d/blacklist-msreader

Disable Unnecessary Services

  1. Run the following to disable numerous services that are irrelevant to most netbook situations.
    for s in atd auditd avahi-daemon bluetooth cups cpuspeed gpm ip6tables kerneloops mdmonitor netfs nfslock portreserve rpcbind rpcgssd rpcidmapd sendmail setroubleshoot livesys livesys-late microcode_ctl; do echo "chkconfig $s off"; chkconfig $s off; done
    I have disabled the CPU throttle service. I prefer to have the full performance. I’m not sure how much more power is used.

Use the Madwifi Kernel Module

This is optional. By using this module instead you can get the wifi led lights to blink while there is network activity.

  1. Install the RPM Fusion repository.
    rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
  2. Install the madwifi kernel module.
    yum install madwifi
  3. Add the following to your /etc/sysctl.conf file.
    dev.wifi0.ledpin = 3
    dev.wifi0.softled = 1

Using a Better Sound Module

  1. Create a file in /etc/modprobe.d to load the correct sound module.
    echo "options snd-hda-intel model=acer-aspire" > /etc/modprobe.d/sound

New Startup Graphics

  1. Edit the /etc/grub.conf file. Add vga=0×315 to the kernel line.
    kernel /vmlinuz-2.6.27.5-117.fc10.i686 ro root=/dev/sda2 rhgb quiet elevator=noop vga=0x315

Enable gsynaptics

  1. Create /etc/hal/fdi/policy/10-synaptics.fdi with the following contents.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <deviceinfo version="0.2">
      <device>
        <match key="info.capabilities" contains="input.touchpad">
          <match key="info.product" contains="Synaptics TouchPad">
        <merge key="input.x11_driver" type="string">synaptics</merge>
            <merge key="input.x11_options.SHMConfig" type="string">On</merge>
          </match>
          <match key="info.product" contains="AlpsPS/2 ALPS">
        <merge key="input.x11_driver" type="string">synaptics</merge>
          </match>
          <match key="info.product" contains="appletouch">
              <merge key="input.x11_driver" type="string">synaptics</merge>
          </match>
          <match key="info.product" contains="bcm5974">
              <merge key="input.x11_driver" type="string">synaptics</merge>
          </match>
        </match>
      </device>
    </deviceinfo>
  2. Install gsynaptics.
    yum install gsynaptics

Silence the CPU Fan

  1. Download the following two scripts. acerfand (4.4K) acer_ec.pl (8.3K)
  2. As root move the files to /usr/local/bin
    su -
    mv acerfand /usr/local/bin/
    mv acer_ec.pl /usr/local/bin/
  3. Change the permissions on the scripts.
    chmod 755 /usr/local/bin/acerfand
    chmod 755 /usr/local/bin/acer_ec.pl
  4. Add a line to your /etc/rc.local file to start at boot.
    echo "/usr/local/bin/acerfand" >> /etc/rc.local

Reboot

After you have performed the optimizations must reboot. Many of the customizations require a reboot before they will work.

Bookmark and Share

Photo-a-Day 2009

Posted on the January 3rd, 2009 under Personal by jglemza

So I got this idea from Photojojo to take one new picture a day for the entire year. Please feel free to critique anything I’ve taken. I’m mostly trying to learn how to use my camera and explore different techniques. Hopefully during this process I’ll also be able to come up with some good compositions and end up with some cool shots.

Below you can see the latest photos taken. You can also view the entire set.

www.flickr.com
Bookmark and Share