3/5/14

Ubuntu Stuff


I've got two ubuntu systems now, both very clean and straight forward setups. No hardware hassling, which is amazing IMHO, after coming from years of redhat. Here's some notes for setting up both systems, which some may find useful:




    Ubuntu 8.04 on an Intel Mac Mini

    I like using linux for my main workstation, and since Mac Mini's are quiet and small, I transitioned from an intel tower to the Mac Mini; was quite smooth. Installing was no problem; put the regular intel Ubuntu 8.04 DVD into the Mac Mini's drive, reboot and install.Here's some extra info bringing up the Mac Mini from a newly bought system.

    Ubuntu 8.04 Install Details

    First time setting up linux on an intel mac mini.. no problem. Never once booted OSX, or needed to. Turned on machine with regular Intel Ubuntu CD in drive, Hold down ALT key on mac keyboard to boot the CD.
    Easy install.. no tricks. Just normal intel install on the mac mini's internal drive.

    Ubuntu 8.04 Post-Install

    After reboot into OS:
      1) 'apt-get update' to update the apt-get database.2) Used 'network-admin' to:
                  * Setup static IP, hostname, removed '127.0.0.1 tahoe' entry from /etc/hosts
                  * Setup DNS and gigabit router
                  * Disable wireless et al.
              
      3) Installed NFS so that my local tools (like 'admlog') will work:
                 1a) apt-get install nfs-common
                 1b) Tweaked /etc/exports on file server to allow exports to new machine
                 1c) Added to /etc/fstab:
                     192.168.1.14:/net /meade/net nfs intr,hard,bg,rw,nolock,vers=3 0 0
                 1d) mount /meade/net
              
      4) Some aliases for root's login to use my local network tools (tweaked /root/.profile):
                  admlog() {
                      /net/bin/admlog $*
                  }
      
                  piss() {
                      /net/bin/piss $*
                  }
                  
      5) Started installing necessary stuff:
                      apt-get install tcsh
                      apt-get install gpm                 -- console copy/paste..!
                      apt-get install ssh                 -- sshd
                      apt-get install vim                 -- replaces 'vim-tiny'
                      apt-get install gawk                -- for 'piss'
                      apt-get install rdate
                  
      6) Installed necessary dev stuff:
                      apt-get install g++
                      apt-get install manpages-dev        -- don't forget the man pages!
                      apt-get install subversion          -- aka svn
                      apt-get install libx11-dev
                      apt-get install libxt-dev
                      apt-get install libxft-dev
                      apt-get install valgrind
                      apt-get install libglut3-dev        -- gets opengl, glut, etc
                      apt-get install doc-linux-html      -- /usr/share/doc/HOWTO
                  
      Optional dev stuff important for me:
                      apt-get install indent
                      apt-get install xxdiff
                      ln -s /usr/bin/xxdiff /usr/bin/xdiff
                  
      7) Disable X windows on boot
      Yeah, I like my own window manager, and like to start it manually, and not have X come up automatically.
      OK, init is completely different now, you can't just change run levels.
                 mv /etc/X11/default-display-manager /etc/X11/default-display-manager.bak
                 echo false > /etc/X11/default-display-manager
                 
      ..and then to stop it:
                 /etc/init.d/gdm stop
                 
      8) Installed chkconfig. Well, found 'rc-config' anyway on the web, which is close enough.
      9) Started making myself at home:
                  chsh /bin/tcsh          -- for erco and root
      
                  rcp -rp on:/usr/local/src/fltk-1.3.x-svn /usr/local/src/fltk-1.3.x-svn
                  rcp -rp on:/usr/local/src/flwm /usr/local/src/flwm
                  rcp on:/usr/local/bin/nixieclock /usr/local/bin/
                  
      10) Removed weird thai/malaysian/indian/arabic fonts that were crowding up my gimp font browser with too much noise:
                  apt-get remove ttf-arabeyes
                  apt-get remove ttf-lao 
                  apt-get remove ttf-malayalam-fonts 
                  apt-get remove ttf-thai-tlwg
                  apt-get remove ttf-indic-fonts-core
                  
      Got the list of installed fonts by running:
                  aptitude search '~i' | grep font
                  
      11) Various other stuff:
                  apt-get install mplayer
                  apt-get install xpdf
                  apt-get install mpage
                  apt-get install dict
                  apt-get install xvncviewer              -- 'vncviewer' (yes, unauth'ed)
                  apt-get install imagemagick
                  aptitude install desktop xfce-desktop   -- small desktop (I use FLWM, but tried this just for fun)
                  apt-get install kompozer
                  apt-get install lame                    -- mpg conversion
                  
      And after all that, I was pretty happy.

    Printing

    For linux tools like gimp and firefox 3 to recognize the laser printer on my Mac, had to configure linux printing with:
      1) Run: system-config-printer2) Click 'Server Settings' from browser
      3) Enable the 'Show printers shared by other systems'
      4) Then 'Apply'.
    Now 'gimp' and firefox3 will show the tower printers in the choosers.

    Firefox Tweaks

    firefox 3 -- middle clicking to 'paste' a link no longer works. Had to enable it:
            1) about:config
            2) Double click on "middlemouse.contentLoadURL" to change "false" to "true"
        

    Installed acrobat

    Downloaded latest, ran INSTALL program:

      1) At the "Enter installation directory for Adobe Reader 8.1.3 [/opt]" prompt, specified:
                 /usr/local
                 
      ..which creates "/usr/local/Adobe/..."2) ln -s /usr/sbin/acroread /usr/local/bin/acroread
      Note that acroread's shell script handles a lot of weird flags (-version, -display..).
      3) That's it -- firefox viewing PDF files will open WITHIN the browser.
      To change firefox to open acroread as a separate window:

        a) Run 'acroread'b) Click Edit > Preferences > Internet
        c) Deselect 'Display PDF In Browser Using [Acrobat application]
        d) Click OK
      Reference: http://kb.adobe.com/selfservice/viewContent.do?externalId=333563

    Flash Player Install

    Trouble installing flash playerAfter installing, it would not load up into firefox. Was getting errors about libnss3.so not being found.
    SOLUTION:

      Had to manually create several symlinks:
              ln -s /usr/lib/libnss3.so.1d /usr/lib/libnss3.so
              ln -s /usr/lib/libnspr4.so.0d /usr/lib/libnspr4.so
              ln -s /usr/lib/libplds4.so.0d /usr/lib/libplds4.so
              ln -s /usr/lib/libplc4.so.0d /usr/lib/libplc4.so
              

    Configured rdate to slam clock every 12 hours to network timekeeper

    Sorry, but after years of dicking with ntp, I've decided its more trouble than it's worth. Went back to good ol rdate which has worked reliably for many years, and I'm fine with it. Configured new machine with rdate:55 0,12 * * * root /usr/bin/rdate -s -l -p meade >> /var/log/rdate.log 2>&1

    Installing Maya 2009

    Found that Maya 2009 'setup' program needs to have:
            1) rpm
            2) bash
        
    So:
            apt-get install rpm
            apt-get install bash
        
    Then, regular maya install.

    RSH Setup


            1) Install inetd
    
                    apt-get install inetutils-inetd
    
            2) Install rsh server + client:
    
                    apt-get install rsh-server
                    apt-get install rsh-client
    
            3) echo + > /root/.rhosts
               chmod 600 /root/.rhosts
    
            4) Modify this line in /etc/pam.d/rsh to allow "+" to work:
    
        BEFORE: auth    required        pam_rhosts_auth.so
         AFTER: auth    required        pam_rhosts_auth.so promiscuous
    
            5) Restart inetd
              /etc/init.d/inetutils-inetd restart
    
            6) rsh localhost ls
        

    Installed doxygen

        1) Just ran:
    
               apt-get install doxygen
    
           This will at least generate html and latex docs.
    
           Downloaded the PDF docs from their website, and copied it into
           /usr/share/doc/doxygen (because it doesn't seem to come with..!)
    
        2) You may want 'pdflatex' to generate the latex docs into a pdf file.
           (You'll find the Makefile in the documentation/latex/ directory wants this)
    
           To install pdflatex:
    
               apt-get install texlive
        

    Installed sox for sound recording

            apt-get install sox
            apt-get install libsox-fmt-oss      -- needed for oss + /dev/dsp to work
    
        Test recording from audio input:
    
            sox -w -c 2 -r 44100 -t oss -s /dev/dsp /var/tmp/foo.wav
        



Ubuntu 7.04 on HP Pavilion dv2000 Notebook

A few months ago (Fall 2007), got an "HP Pavilion dv2000" notebook computer, and installed Ubuntu 7.04 on it. Nice light machine, and pretty cost effective.Install was smooth/default. Only odd things I noticed:

  • Apparently the csh/tcsh is not preinstalled on Ubuntu. Had to apt-get it, since I prefer the csh for my login shell, instead of bash. Kinda weird, since every Unix release I've ever encountered since the early 90's always included a csh.. sun, freebsd, sgi/irix, linux distros. Ubuntu's the first that didn't include a csh!
  • The dv2000's onboard ethernet apparently is not gigabit.I then made the mistake of thinking "I'll just get a gigabit PCMCIA card", but when I tried to install it, found the HP dv2000 does not have a PCMCIA slot..! That thing that *looks* like a PCMCIA slot is actually an ExpressCard slot. So no go for PCMCIA on this thing.
    So I bought a "TRENDnet TU2-ETG" USB gigabit ethernet dongle (very cheap), which Ubuntu 7.04 automatically recognized as eth2, and was able to easily enable by just running "network-admin" from the command line, assigning it an IP address, and un-checking the onboard eth0 to disable that. After rebooting, the USB gigabit was up and running happily.
  • There are continuous complaints on the console and /var/log/messages about:bcm43xx: Error: Microcode "bcm43xx_microcode5.fw" not available or load failed.
    Apparently the easy solution for this is to blacklist the module from trying to load, but I haven't bothered. (Update: it is now December 2009, and these messages are still happening, but I've been ignoring them)
  • Disappearing mouse.Possibly caused by switching virtual consoles (ctrl-alt-f1, etc), the X server's mouse would sometimes disappear.
    When booting into our custom runlevel 3 (x windowless), starting flwm would have no mouse. Sometimes even ubuntu's defaults would do the same. This page seemed to have the fix:
    https://bugs.freedesktop.org/show_bug.cgi?id=3009
    ..explaining it as a driver bug caused by the hardware mouse cusor default. By setting the cursor to software, it works around the problem.
    Made following ("HWCursor" "off") change to /etc/X11/xorg.conf:
             Section "Device"
                    Identifier  "nVidia Corporation C51 [Geforce 6150 Go]"
                    Driver              "nv"
                    BusID               "PCI:0:5:0"
                    #ERCO: DISABLE HARDWARE CURSOR -- sometimes disappears!
                    Option              "HWCursor"              "off"
             EndSection
             
  • X11 enable TCP portTo allow remote X11 access, modified /etc/X11/gdm/gdm.conf
             before: DisallowTCP=true 
              after: DisallowTCP=false
             
  • I happened to read this article on slashdot:
    Ubuntu May Be Killing Your Laptop's Hard Drive http://hardware.slashdot.org/article.pl?sid=07/10/30/1742258Indeed, my system had this problem of an 'over agressive power saving feature", as shown by the HD's "Load_Cycle_Count" increasing at a steady rate:
    smartctl -d ata -a /dev/sda | grep Load_Cycle_Count
    ..so I took those steps to fix it, but forgot to document it properly, but I think it just involved adding 'hdparm -B 255' or some such. Grepping the /etc/ directory, looks like I created these:
              --- /etc/acpi/resume.d/99-hdd-spin-fix.sh
                  #!/bin/sh
                  hdparm -B 255 /dev/sda
    
              --- /etc/acpi/start.d/99-hdd-spin-fix.sh
                  #!/bin/sh
                  hdparm -B 255 /dev/sda
    
              --- /etc/acpi/suspend.d/99-hdd-spin-fix.sh
                  #!/bin/sh
                  hdparm -B 255 /dev/sda
    
              
    See also: http://halojetter.blogspot.com/2007/10/ubuntu-not-killing-your-laptops-hard.htmlAlso, I may have disabled laptop power saving mode:
              # grep LAPTOP /etc/default/acpi-support
              ENABLE_LAPTOP_MODE=false              <-- off
              
    All else seems well with Ubuntu 7.04 on the HP Pavilion dv2000 so far. It's been getting heavy use the last month or so.



Useful apt-get commands

A collection of useful apt-get commands..
                                     UBUNTU: APT-GET/DPKG              REDHAT: SIMILAR RPM COMMAND
                                     -------------------------------   -------------------------------------------
             Searching for packages: apt-cache search some_string      http://rpmfind.com/, etc
                  Show Package Info: apt-cache showpkg xxx             rpm -qpi /tmp/foo.rpm
          Show Package Dependencies: apt-cache depends xxx             
                            Install: apt-get install xxx               rpm -ivh /tmp/foo.rpm
                         Re-Install: apt-get --reinstall install xxx   rpm -ivh -force /tmp/foo.rpm
                             Remove: apt-get remove xxx                rpm -e pkgname
    Remove everything (configs too): apt-get --purge remove xxx
                            Upgrade: apt-get -u upgrade
                      Show upgrades: apt-show-versions -u
        Show All Installed Packages: dpkg --list                       rpm -qa

        Find package given filename: apt-file search /bin/ping         rpm -qf /bin/ping
        Find filenames in a package: apt-file list xxx                 rpm -ql pkgname, rpm -qpl /tmp/foo.rpm
        Updating the apt-file cache: apt-file update

                *** SOURCE PACKAGES ***
        Getting source packages: apt-get source xxx
                  Build package: apt-get -b source packagename         rpm -ba, rpm-build -ba /tmp/foo.rpm
  Building Package Dependencies: apt-get build-dep xxx

Bài đăng phổ biến