Archive for the ‘linux’ Category

Install script to CollectiveAccess on a debian Wheezy server

Friday, August 9th, 2013

I’ve been looking at using CollectiveAccess, a very nice GPL’ed cataloguing tool and web-based application for museums, archives and digital collections, to use for a local historical society and surname genealogy group. If you know me IRL, I can set you up with a test account on a CA instance.

The installation is pretty straight forward, but I took the time to automate the installation progress to install it on a stock Debian Wheezy 7.1 image running in hpcloud.com (standard.xsmall)

Download it to the server, and then as root: sh ca-install.sh

ca-install.sh


#!/bin/bash
########################################################################
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
#
########################################################################
#
# This script will install Collectiveaccess Providence & Pawtucket
# v1.3 on a stock Debian Wheezy server.
#
# Scan down for CHANGEME and replace it with whatever you want the
# Collectiveaccess (ca) account's mysql password to be.
#
# I tested this using the "209316 – Debian Wheezy 7.1 Server 64-bit
# 20130701 (b)" base image on http://hpcloud.com
#
# -marc nozell
# marc@nozell.com
# 2013-08-08
#
apt-get update
echo "get more packages"
apt-get install apache2 mysql-server php5 php5-imagick libtiff5 libgd-tools php5-ffmpeg libav-tools ghostscript dcraw poppler-utils abiword mediainfo php-getid3 php5-mysql

echo "update php.ini"
perl -pi -e "s/post_max_size = 8M/post_max_size = 32M/" /etc/php5/apache2/php.ini
perl -pi -e "s/upload_max_filesize = 2M/upload_max_filesize = 2M/" /etc/php5/apache2/php.ini
perl -pi -e "s/memory_limit = 128M/memory_limit = 256M/" /etc/php5/apache2/php.ini
perl -pi -e "s/display_errors = Off/display_errors = On/" /etc/php5/apache2/php.ini

echo "restart apache"
service apache2 restart

echo "configure mysql -- enter the mysql root password:"
mysql -p < < EOF
create database ca;
create user 'ca'@'localhost' identified by 'CHANGEME';
grant all on ca.* to 'ca'@'localhost';
EOF

echo "get providence 1.3 kit"
cd /usr/src/
wget -c http://collectiveaccess.org/downloads/collectiveaccess-providence-1.3.tgz

echo "unpack providence"
cd /var/www/
tar zxvf /usr/src/collectiveaccess-providence-1.3.tgz
mv collectiveaccess-providence-1.3 providence

cd providence

echo "edit providence setup.php"
cp setup.php-dist setup.php

perl -pi -e "s/my_database_user/ca/" setup.php
perl -pi -e "s/my_database_password/CHANGEME/" setup.php
perl -pi -e "s/name_of_my_database/ca/" setup.php
perl -pi -e "s/my_database_user/ca/" setup.php

echo "set some providence directory protections"
cd ..
chmod a+w providence/app/tmp
chmod a+w providence
chmod a+w providence/app/lib/core/Parsers/htmlpurifier/standalone/HTMLPurifier/DefinitionCache

echo "get the pawtucket kit"
cd /usr/src/
wget -c http://collectiveaccess.org/downloads/collectiveaccess-pawtucket-1.3.tgz

echo "unpack pawtucket"
cd /var/www/providence
tar zxvf /usr/src/collectiveaccess-pawtucket-1.3.tgz
mv collectiveaccess-pawtucket-1.3 pawtucket

cd pawtucket

echo "edit pawtucket setup.php"
cp setup.php-dist setup.php

perl -pi -e "s/my_database_user/ca/" setup.php
perl -pi -e "s/my_database_password/CHANGEME/" setup.php
perl -pi -e "s/name_of_my_database/ca/" setup.php
perl -pi -e "s/my_database_user/ca/" setup.php

cd /var/www/providence/pawtucket

echo "create media softlink"
ln -s ../media ./

echo "fix pawtucket directory protections"
chmod a+w /var/www/providence/pawtucket/app/tmp /var/www/providence/pawtucket/app/lib/core/Parsers/htmlpurifier/standalone/HTMLPurifier/DefinitionCache
chmod 777 /var/www/providence/pawtucket/app/lib/core/Parsers/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer

echo "Now go open http://THIS-SERVER/providence/install and complete the setup"

HOWTO get your Raspberry Pi running owncloud, tt-rss and thinkup

Thursday, March 21st, 2013

Today a case for my Raspberry Pi arrived from Adafruit arrived and it is time for some spring cleaning.

I was running the XBMC distro on the pi, but found it cumbersome to listen to music in the home office that way. So time to start with a fresh Raspbian install.

Here are my notes:

  • Get the current Raspbian release from Raspbian.org and install it on a
    4GB flash disk.
  • Boot the new disk and make the following configurations using
    raspi-config which is run the first time it starts up.

    – Use only 16M for GPU since I’m not running an X desktop
    – set appropriate timezone
    – set appropriate locale
    – expand fs to use entire 4GB disk
    – change pi passwd
    – enable ssh access
    – update
    – reboot

  • Now some miscellaneous setup to make life easier later on. Both tt-rss and thinkup require MySQL, but I’ll also want to use it for
    owncloud too. So install MySQL server:

    sudo apt-get install mysql-server

    Avahi (aka bonjour) is a very nice network tool that is a DNS-less way
    to announcing your hostname on the local network. Most (all) linux
    tools support it, but you’ll need Apple’s Bonjour kit for Windows.
    That means you can just ‘ssh raspberrypi.local‘ or browse to
    http://raspberrypi.local/

    sudo apt-get install avahi-utils

    I like emacs and screen is useful.

    sudo apt-get install emacs23-nox screen

    At this point I stop using the keyboard/monitor connected to the Raspberry Pi and use an ssh session from my laptop to do the rest.

  • First install ownCloud by taking a look here: http://software.opensuse.org/download/package?project=isv:ownCloud:community&package=owncloud. Then connect to your Raspberry Pi:

    ssh pi@raspberrypi.local
    sudo -i

    Now run this script which I slightly modified from their page:

    wget http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/Release.key
    apt-key add - < Release.key

    echo 'deb http://download.opensuse.org/repositories/isv:ownCloud:community/Debian_6.0/ /' >> /etc/apt/sources.list.d/owncloud.list
    apt-get update
    apt-get install owncloud

    At this point you’ll have all the required packages are installed. Now point a browser to http://raspberrypi.local/owncloud

    You will need to create an owncloud admin account and will want to then expand the Advanced tab and to use a MySQL server instead of SQLite. Fill in root, mysql root password (I didn’t bother to set an mysql admin password, so null in my case). For the database, use owncloud and database host localhost. It may take a couple minutes to be complete, so be patient.

  • Now install tt-rss doing the following steps:

    cd /var/www/

    wget -c https://github.com/gothfox/Tiny-Tiny-RSS/archive/1.7.4.tar.gz

    And follow the instructions here http://tt-rss.org/redmine/projects/tt-rss/wiki/InstallationNotes which are essentially:

    tar zxvf 1.7.4.tar.gz
    mv Tiny-Tiny-RSS-1.7.4 tt-rss

    chown -R www-data:www-data tt-rss

    You will have to manually create a mysql database and import the schema

    mysql -u root
    mysql> create database ttrss;
    mysql> quit

    Now import the database schema (a fancy way to say the database tables and some initial data)

    cd tt-rss/schema
    mysql -u root ttrss < ttrss_schema_mysql.sql

    And a little editing the configuration file...

    cd /var/www/tt-rss

    cp config.php-dist config.php

    emacs config.php (or use vi, nano, etc)

    I made the following edits:

    define('DB_TYPE', "mysql");
    define('DB_HOST', "localhost");
    define('DB_USER', "root");
    define('DB_NAME', "ttrss");
    define('DB_PASS', "");

    define('SELF_URL_PATH', 'http://raspberrypi.local/tt-rss/');
    define('SINGLE_USER_MODE', true);

    Point a browser to http://raspberrypi.local/tt-rss

    From there login with default login/password of admin/password and you are done.

  • Finally install http://www.thinkupapp.com/docs/install/quickstart.html

    The one package you’ll need that isn’t already installed at this point is php5-curl.

    apt-get install php5-curl

    Now get the kit. I used wget and the site provided the kit, but with an unusual name.


    cd /var/www
    wget -c http://thinkupapp.com/download/
    mv index.html thinkup-1.3.1.zip
    unzip thinkup-1.3.1
    chown -R www-data:www-data thinkup

    Almost done. Point a browser to http://raspberrypi.local/thinkup and complete the configuration.

    database host: localhost

    database name: thinkup

    user: root

    password: blank, in my case or whatever you set the mysql root password to.

    I (and probably you) don’t have a smtp server configured, so in order to activate your account, you’ll need to do this: http://www.thinkupapp.com/docs/troubleshoot/common/advanced/directdb.html

    # mysql -u root thinkup

    mysql> select id,full_name,is_activated from tu_owners;
    +—-+————-+————–+
    | id | full_name | is_activated |
    +—-+————-+————–+
    | 1 | Marc Nozell | 0 |
    +—-+————-+————–+
    1 row in set (0.00 sec)

    mysql> update tu_owners set is_activated=1 where id=1;
    mysql> quit

    Done! Now go back to http://raspberrypi.local/thinkup and configure the plugins to your favorite social media sites.

Installing owncloud on a Raspberry Pi

Thursday, January 17th, 2013

Spoiler: Just follow the official installation guide and you’ll be fine. Although you’ll probably want to put owncloud data on external storage. Surprised? It is just another linux server!

Below are the commands I used. Those in bold are where I did something slightly different in order to change the location where files are stored. In my case I have a powered USB disk mounted on /mnt.


$ sudo -i
[sudo] password for marc:
# apt-get install apache2 php5 php5-gd php-xml-parser \
php5-intl php5-sqlite php5-mysql smbclient curl \
libcurl3 php5-curl
...a bunch of packages installed...
# cd /var/www/
# tar jxf ~marc/owncloud-4.5.5.tar.bz2
# chown -R www-data:www-data owncloud/apps
# chown -R www-data:www-data owncloud/config
# mkdir /mnt/owncloud-data
# chown www-data:www-data /mnt/owncloud-data
# ln -s /mnt/owncloud-data/ /var/www/owncloud/data

Then point a browser to http://raspberrypi.local/owncloud and take all the defaults. That is leave the file location as /var/www/owncloud/data

Finally go download the sync clients from http://owncloud.org/sync-clients/ and drag-n-drop files in your ~/owncloud.

For testing I had ~180M of files in my ~/owncloud directory and the apache2 process hammered the RPi cpu for a while for the first sync from my desktop.

Working powered hub for the Raspberry Pi

Thursday, September 6th, 2012

A cheap 7 port Staples-branded powered hub gives my RPi problems, but a new 4 port Staples-branded powered hub works just fine.


root@raspberrypi:~# lsusb|grep -i Port
Bus 001 Device 005: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
root@raspberrypi:~#

Just a random data point for people to find via google ;-)

Raspberry Pi Show-n-Tell @ManchLUG

Tuesday, June 19th, 2012

Tonight I brought my Raspberry Pi to the Manchester (NH) Linux Users Group for a show & tell session.

Here are my slides:

For the record, some of us were drinking Lindemans Framboise Lambic Beer in honor of the topic.

ThinkUp on Raspberry Pi

Monday, June 11th, 2012

Tonight I installed the cool social networking monitoring tool ThikUp on my new Raspberry Pi with the lastest debian code drop.

  1. Downloaded the new (11-Jun-2012) test Debian/Wheezy image as announced on http://www.raspberrypi.org/phpBB3/viewtopic.php?f=50&t=8071
  2. Since I’m using a new 4GB MMC card and the image was built for 2GB, ran “sudo rasp_config” to resize the disk and bias memory toward SoC instead of the video card. Rebooted. Realized it didn’t reboot, pull power and boot
  3. 3) I run a a local apt-proxy to save bandwidth, so created /etc/apt/apt.conf that contains:

    Acquire::http::Proxy "http://192.168.2.109:3142";

  4. 4) Update the apt-cache:

    sudo apt-get update

  5. Install useful bits:

    sudo apt-get install emacs screen mysql-server php5 php5-curl php5-gd php5-mysql

    This installs ~61M of new packages and pulls in a suitable apache server.

  6. Now time to install thinkup:

    sudo -i
    cd /var/www/
    unzip ~pi/thinkup_1.0.7.zip
    chown -R www-data /var/www/thinkup/data/
    sudo touch /var/www/thinkup/config.inc.php
    sudo chown www-data /var/www/thinkup/config.inc.php
  7. point a browser to http://192.168.2.120/thinkup/install
  8. Since I didn’t bother to setup outbound email, need to manually
    update the thinkup table. See
    http://thinkupapp.com/docs/troubleshoot/common/advanced/directdb.html

    mysql -u root -p
    mysql> use thinkup;
    mysql> select id,full_name, is_activated from tu_owners;
    +----+-------------+--------------+
    | id | full_name | is_activated |
    +----+-------------+--------------+
    | 1 | Marc Nozell | 0 |
    +----+-------------+--------------+

    1 row in set (0.00 sec)

    mysql> update tu_owners set is_activated=1 where id=1;
    mysql> commit;
    mysql> exit;

  9. Point a browser to http://192.168.2.120/thinkup and setup
    connections to your favorite social media sites.

Belated Blog Birthday

Monday, March 12th, 2012

I missed a couple of milestones.

This blog turned 10 years old on March 5th, 2012. It started life as a humble blosxom script and stayed like that for two years when I migrated to a self-hosted wordpress blog. Since I’ve been tracking late in 2007, there has been 180,000 page views — a good percentage is probably spammers.

Here are my move viewed blog entries:

  1. messing around with tiles (13-Aug-2004; 16,153 hits) — a silly little post about using the taprats java app to generate some interesting titles. It is also where I got the favicon for nozell.com.
  2. family pictures — including one of me naked! (4-May-2003; 7,560 hits) — Seems lots of people are searching for naked photos on the internet. Who knew? The entry has some bitrot, but I had scanned some old photos as part of a genealogy project. Here is the photo of me butt naked.
  3. Getting started with the SheevaPlug (12-May-2009; 7,158 hits) — finally a geek-related entry! I’m still somewhat happy with LordShiva.local, but it sometimes flakes out losing the root filesystem. Its backup function has been moved to a DreamPlug.
  4. flickr upload for gnome’s nautilus (4-Sep-2004; 6,077 hits) — Back in the Debian/Sarge days I wrote a little Nautilus script to upload flickr photos. It got some link-love from flickr. Sadly the script is lost to the ages.
  5. I’ve seen things, I’ve seen them with my eyes… (5-Mar-2004; 4,901 hits) — damn earworm by the excellent Weebl. Surprisingly the link is still good. Best part of the song? Kuala Lumpur!
  6. Some tips to (re)install grub on an HP ProLiant server (8-May-2004, 4762 hits) — Back in the day HP ProLiant with SmartArray controllers, Red Hat and grub didn’t love each other as much as they do today. My notes were popular for a while, less so over time.
  7. Logitech USB headset & Ubuntu/Linux (13-Sep-2006; 4,263 hits) — evidence that random devices work out of the box on Linux just like it usually does on Windows.
  8. hp 2133 update (4-Jun-2008; 3,799 hits) — described some problems installing various distros of Linux on my cute little hp2133 netbook. Since then Ubuntu has been running on the hp2133 just fine and has ubeen upgraded through Oneric. Now it is off at college with Son #2 who uses it for notetaking in class.
  9. SheevaPlug customizing pre-installed Ubuntu/Jaunty (17-May-2009; 3,392 hits) — misc notes on the SheevaPlug when it was running Ubuntu/Jaunty. Currently it is running Debian/Squeeze mainly because Ubuntu dropped support for the ARM CPU it uses.
  10. SheevaPlug is now my main home server (26-Jun-2009; 2,916 hits) — A write up on what the SheevaPlug was hosting in my home datacenter. All those functions have moved to the newer and more capable DreamPlug.

The other big milestone is I’ve had the nozell.com domain for 15 years — 6-Feb-1997. I have children that are younger than that domain!


Record last updated on 07-Feb-2012.
Record expires on 07-Feb-2013.
Record created on 06-Feb-1997.

Ubuntu 11.10 upgrade works great on hp2133 netbook

Monday, October 24th, 2011

My hp1233 netbook has been sitting around in my office for the last six months after the last Ubuntu upgrade. It was working fine, but the Natty Narwhal (11.04) upgrade caused it to hang when using wifi. See Bug #772859

So the end of last week I plugged it into my network switch and upgraded to Oneiric Ocelot. I was pleasantly surprised that the wifi now works and didn’t require any fiddling around with random drivers or configs. Nicely done Ubuntu Team!

Ubuntu/natty hangs when wifi enabled

Thursday, April 28th, 2011

This evening I upgraded my hp2133 notebook from Ubuntu/Maverick to the new Natty. The upgrade went smoothly but now the system hangs about 2 minutes after Broadcom 4311 802.11a/b/g wifi is enabled.

Here is the bug report: BCM4311 wifi hangs hp2133 notebook after 2 minutes

Some suggestions from IRC are to try the bcmwl-kernel-source or linux-backports-modules-net-natty-generic packages.

DreamPlug: misc info

Tuesday, April 19th, 2011

Someone asked for more info about the hw/sw as shipped with the DreamPlug:

root@morpheus:~# uname -a
Linux morpheus 2.6.33.6 #1 PREEMPT Tue Feb 8 03:18:41 EST 2011 armv5tel GNU/Linux
root@morpheus:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 9.04
Release:	9.04
Codename:	jaunty
root@morpheus:~# lshw
morpheus
    description: Computer
    width: 32 bits
  *-core
       description: Motherboard
       physical id: 0
     *-memory
          description: System memory
          physical id: 0
          size: 501MiB
     *-cpu
          physical id: 1
          bus info: cpu@0
     *-scsi
          physical id: 2
          bus info: usb@1:1.1
          logical name: scsi0
          capabilities: emulated
        *-disk:0
             description: SCSI Disk
             product: STORAGE DEVICE
             vendor: Generic
             physical id: 0.0.0
             bus info: scsi@0:0.0.0
             logical name: /dev/sda
             version: 9910
             size: 1886MiB (1977MB)
             capabilities: removable
           *-medium
                physical id: 0
                logical name: /dev/sda
                size: 1886MiB (1977MB)
                capabilities: partitioned partitioned:dos
              *-volume:0
                   description: Windows FAT volume
                   vendor: mkdosfs
                   physical id: 1
                   logical name: /dev/sda1
                   version: FAT16
                   serial: 020d-9082
                   size: 1885MiB
                   capabilities: primary fat initialized
                   configuration: FATs=2 filesystem=fat label=dream_kr
              *-volume:1
                   description: EXT3 volume
                   vendor: Linux
                   physical id: 2
                   logical name: /dev/sda2
                   version: 1.0
                   serial: cc90c161-81e2-4434-b39f-e61c8de21c6a
                   size: 1783MiB
                   capacity: 1783MiB
                   capabilities: primary journaled extended_attributes large_files recover ext3 ext2 initialized
                   configuration: created=2011-02-23 08:07:06 filesystem=ext3 label=dream_fs modified=2011-04-19 15:44:26 mounted=2011-04-19 15:44:26 state=clean
        *-disk:1
             description: SCSI Disk
             product: STORAGE DEVICE
             vendor: Generic
             physical id: 0.0.1
             bus info: scsi@0:0.0.1
             logical name: /dev/sdb
             version: 9910
             capabilities: removable
           *-medium
                physical id: 0
                logical name: /dev/sdb
  *-network:0
       description: Ethernet interface
       physical id: 1
       logical name: eth0
       serial: f0:ad:4e:00:71:ec
       size: 10MB/s
       capacity: 1GB/s
       capabilities: ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=mv643xx_eth driverversion=1.4 duplex=half firmware=N/A link=no multicast=yes port=MII speed=10MB/s
  *-network:1
       description: Ethernet interface
       physical id: 2
       logical name: eth1
       serial: f0:ad:4e:00:71:ed
       size: 100MB/s
       capacity: 1GB/s
       capabilities: ethernet physical tp aui bnc mii fibre 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=mv643xx_eth driverversion=1.4 duplex=full firmware=N/A ip=192.168.1.231 link=yes multicast=yes port=MII speed=100MB/s
  *-network:2
       description: Ethernet interface
       physical id: 3
       logical name: uap0
       serial: 00:24:23:33:eb:4c
       capabilities: ethernet physical
       configuration: broadcast=yes ip=192.168.3.1 multicast=yes
  *-network:3 DISABLED
       description: Ethernet interface
       physical id: 4
       logical name: pan0
       serial: 92:53:b4:db:b1:5b
       capabilities: ethernet physical
       configuration: broadcast=yes driver=bridge driverversion=2.3 firmware=N/A link=yes multicast=yes