With ImageMagick package (image manipulation library) installed on a Linux machine, it is possible to split a huge image file into smaller tiles with such kind of command:
convert -crop $WIDTHx$HEIGHT@ huge_file.png tile_%d.png

With the following parameters.

  • $WIDTH, the width of each tile splitted
  • $HEIGHT, the height of each tile splitted

Here is an example to split a file into tiles of size 16×32 pixels:
convert -crop 16x32@ huge_file.png tile_%d.png

Modifying the format name of dump file in a Linux system can be made with sysctl like this.
sysctl -w kernel.core_pattern=core.%e.%p
However, making this modification command-based will not make it effective at next reboot.

In order to make the modification permanent, you need to edit the file /etc/sysctl.conf. Here the core file has the executable name %e and the process ID %p.
kernel.core_pattern = core.%e.%p

Here is a list of the possible keywords usable:

  • %p, PID of dumped process
  • %u, (numeric) real UID of dumped process
  • %g, (numeric) real GID of dumped process
  • %s, number of signal causing dump
  • %t time of dump, expressed as seconds since the Epoch, 1970-01-01 00:00:00 +0000 (UTC)
  • %h, hostname (same as nodename returned by uname(2))
  • %e, executable filename (without path prefix)
  • %c, core file size soft resource limit of crashing process (since Linux 2.6.24)

This is a short memo to install Hadoop and sqoop (Hadoop interface with db backend) in Ubuntu Lucid.

First it is necessary to add the following debian repository from Cloudera, the host of Hadoop and sqoop.
This can be added from System -> Update manager -> Settings (bottom-left) -> Other sources (tab) -> add.
deb http://archive.cloudera.com/debian -cdh3 contrib
On Lucid, has to be replaced by lucid, giving:
deb http://archive.cloudera.com/debian -cdh3 contrib

A Java environment is necessary, you should have at least default-jdk 1.6.
Then install the software itself:
sudo apt-get install hadoop
sudo apt-get install sqoop
sudo apt-get install hadoop-hbase

Once trying to launch sqoop on certain tables through PostgreSQL, you may find the following error:
sqoop import --table test --connect jdbc:postgresql://localhost/postgres --verbose
...
ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class: org.postgresql.Driver

This means that JDBC driver of PostgreSQL is not installed correctly.
You have to download it from here.
Then copy it in /usr/lib/sqoop/.

More details about the installation can be found here.

After a couple of hours fighting, I finally went through a way to compile documentation of postgres under Ubuntu Lucid.

For man pages and html, you need the following packages.
docbook-xsl
docbook
docbook2x
docbook-dsssl
jade

Then, before running configure, the following setup is necessary:
export DOCBOOKSTYLE=/usr/share/sgml/docbook/stylesheet/dsssl/modular

Compilation of html pages need the following command in doc/src/sgml:
make html
Result is then found in doc/src/sgml/html.

Compilation of man pages need the following command in doc/src/sgml:
make man
Result is then found in doc/src/sgml/manX. X being 1, 3 or 7.

Then when compiling the code for pdf documentation, the following package is required.
pdfjadetex
Be aware that this had dependencies with tex, and several packages.

Compilation of pdf is done with the following command:
make postgres-A4.pdf

However, pdf compilation still shows issues due to incorrect parameters in /etc/texmf/texmf.cnf.
hash_extra = 50000
hash_size.mpost = 120000

When tuning a PostgreSQL server, one the major setting parameters is the one controlling the amount of shared memory allowed with shared_buffers.
PostgreSQL has a default shared_buffers value at 32MB, what is enough for small configurations but it is said that this parameter should be set at 25% of the system’s RAM. This allows your system to keep a good performance in parallel with the database server.
So in the case of a machine with 4GB of RAM, you should set shared_buffers at 1GB.

In the case of ubuntu servers, you may find the following error when starting a PostgreSQL instance.
FATAL: could not create shared memory segment: 無効な引数です
DETAIL: Failed system call was shmget(key=5432001, size=1122263040, 03600).
HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 1122263040 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers or max_connections.
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.

This means that Linux kernel cannot allow more shared memory than the kernel can.
In order to prevent that, customize the memory parameters of your machine kernel.
(for 1GB)
sysctl -w kernel.shmmax=1073741824
sysctl -w kernel.shmall=262144
(for 2GB)
sysctl -w kernel.shmmax=2147483648
sysctl -w kernel.shmall=524288

You need root rights to modify those parameters.

Using sysctl will not reinitialize those parameters at reboot. For a more permanent solution, add the following lines to /etc/sysctl.conf.
(for 1GB)
kernel.shmall = 262144
kernel.shmmax = 1073741824
(for 2GB)
kernel.shmall = 524288
kernel.shmmax = 2147483648

©2010-2013 Michael Paquier All content is ©Copyright of Otacoo.com 2010-2013. Privacy Policy - Terms of Use