Archive for the ‘Thoughts’ Category.

duplicating a postgresql DB

e.g. for testing purposes before touching valuable data…


  1. set the DB names

    ORIG_DB="orig_db_name"
    NEW_DB="new_db_name"


  2. create a dump (make sure to use a user having access rights to the db)

    TSTAMP=$(date +%F_%H-%M)
    FILE_ORIG="${ORIG_DB}_${TSTAMP}.sql"
    pg_dump -f ${FILE_ORIG} --blobs --create ${ORIG_DB}


  3. adjust the DB name in the dump and check everything went ok (the diff should be just in CREATE, ALTER and \connect statements)

    FILE_NEW="${NEW_DB}_based-on_${ORIG_DB}_${TSTAMP}.sql"
    sed "s/${ORIG_DB}/${NEW_DB}/g" ${FILE_ORIG} > ${FILE_NEW}
    vimdiff ${FILE_ORIG} ${FILE_NEW}


  4. adjust permissions for the new db (add the new DB name to the desired user(s)) and reload the postgres config

    sudo vim /etc/postgresql/8.4/main/pg_hba.conf
    sudo /etc/init.d/postgresql-8.4 reload


  5. load the new DB’s SQL-code into postgres

    psql -f ${FILE_NEW}


  6. to set identical permissions on the new DB, create a full dump using pg_dumpall, check the GRANT commands in the dump and apply them to the new DB as well…

nautic maps / navigation

wow: http://bodensee-navigationskarte.scbh.at/

building the Funambol extension for TB3 on Linux/x86-64

This posting describes the steps required to build the Funambol add-on for Mozilla Thunderbird 3 on Ubuntu 10.10 (Maverick Meerkat). It is mostly based on Bas’ Blog entry .

Part I: the prerequisites

  1. define the buildroot

    BASE="${HOME}/buildenvs/mozbuild.maverick_amd64"

  2. install required packages

    sudo aptitude install mercurial autoconf2.13 colormake libcurl4-gnutls-dev libtool git-svn

  3. I had problems using a freshly debootstrapped ubuntu maverick (10.10) chroot that was missing the “staff“ group, so if it’s missing, add it via “vigr“…
  4. install build-dependencies

    sudo apt-get build-dep thunderbird


Continue reading ‘building the Funambol extension for TB3 on Linux/x86-64’ »

using a proper “compose” key in gnome

  1. open “system” -> “preferences” -> “keyboard”
  2. switch to tab “layouts”
  3. click button “options”
  4. open section “compose key position”
  5. choose the desired key…

migrate from SVN to GIT

a short cheat sheet of commands I used several times to migrate SVN-repositories to GIT

  • preparation

    sudo aptitude install subversion git-svn
    svn co https://my.server.private/repos/my_repo
    cd my_repo
    svn log -q | grep -v '^--*$' | cut -d '|' -f 2 | sort | uniq > ../my_repo_authors.txt
    cd ..
    vim my_repo_authors.txt
    ### go ahead and edit the authors file
  • git-svn clone the subversion repository
    ### use "--no-metadata" only if you don't want the git-svn-id tags in the commit-messages
    git svn clone --no-metadata --stdlayout \
        --authors-file=my_repo_authors.txt \
        https://my.server.private/repos/my_repo \
        my_repo.git-svn
Continue reading ‘migrate from SVN to GIT’ »

my language & locale settings on a fresh ubuntu-install

the following steps are required to adjust a fresh ubuntu to my personal language-preferences, including the default character encoding for gnome-terminal set to UTF-8

# install the required packages to generate the appropriate locales:
sudo aptitude install language-pack-de-base language-pack-de
 
# set the default environment variables:
echo '
# locale stuff
LANG=
LC_ALL=
# Character classification and case conversion:
LC_CTYPE="de_DE.utf8"
# Date and time formats:
LC_TIME="de_DE.utf8"
# Non-monetary numeric formats:
LC_NUMERIC="de_DE.utf8"
# Collation order:
LC_COLLATE="POSIX"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="POSIX"
LC_PAPER="de_DE.utf8"
LC_NAME="de_DE.utf8"
LC_ADDRESS="de_DE.utf8"
LC_TELEPHONE="de_DE.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="de_DE.utf8"
' | sudo tee -a /etc/environment

IMPORTANT: you have to log out after these changes to make them work!!

remotely add remote desktop users (RDP) in windows (7)

  1. take a windows-machine of your choice
  2. click on “start”
  3. right-click “computer”
  4. choose “manage” (“verwalten” if locale=DE)
  5. authenticate if necessary
  6. right-click “computer management (local)”
  7. choose “connect to a different computer”
  8. enter the DNS-name of the target machine
  9. wait for connection
  10. go to “System Tools” -> “Local Users and Groups” -> “Groups”
  11. double-click “Remote Desktop Users”
  12. click “Add”
  13. add the desired user


done

hp-snmp-agents on debian 6.0 (squeeze)

hp-snmp-agents error: Service snmp has to be enabled to start service hp-snmp-agents

If you get an error like:

Setting up hp-snmp-agents (8.5.0.1.1-2) ...
insserv: Service snmp has to be enabled to start service hp-snmp-agents
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing hp-snmp-agents (--configure):
subprocess installed post-installation script returned error exit status 1

Edit the file:

/var/lib/dpkg/info/hp-snmp-agents.postinst

and change the “update-rc.d “ to “update-rc.d -f “, then
apt-get -f install
and you should be back in business.

(copied 1-on-1 from craighoffman)

worth a glimpse: ubuntu as time machine volume

might be interesting for the unfortunate minds that are stuck with one of those MacOS computers:

HowTo: Make Ubuntu A Perfect Mac File Server And Time Machine Volume

HDR with hugin