Tuesday, December 8, 2009

SUN SGD on Debian Lenny

Surprizingly enough SSGD installs fine on a debian lenny system.

Probably you have to
sudo aptitude install libmotif3
Then convert the rpm package to a debian one:
alien --scripts tta-4.50-907.i386.rpm
Make same necessary symbolic links:
ln -s /usr/lib/libXm.so.3.0.2 /usr/lib/libXm.so
ln -s /usr/lib/libexpat.so.1.5.2 /usr/lib/libexpat.so.0
Install the package:
dpkg -i tta_4.50-908_i386.deb
There is a minor error message that AFAICT does not cause any problems:
pythagoras:~# dpkg -i tta_4.50-908_i386.deb
Selecting previously deselected package tta.
(Reading database ... 24510 files and directories currently installed.)
Unpacking tta (from tta_4.50-908_i386.deb) ...
Setting up tta (4.50-908) ...
chown: cannot dereference `/opt/tarantella/lib/i3so/libXm.so': No such file or directory
chmod: cannot operate on dangling symlink `/opt/tarantella/lib/i3so/libXm.so'
/var/lib/dpkg/info/tta.postinst: line 17218: [: 0configure: integer expression expected
To complete the installation, please run /opt/tarantella/bin/tarantella start

Monday, December 7, 2009

Batch resize and convert images using ImageMagick

Enter the following command to resize all JPEG images in a directory to 750×500 pixels. Obviously, you can change the 750×500 to whatever dimensions you prefer:
convert -resize 750×500 *.jpg
Enter the following command to convert a JPEG into a GIF. You can convert any format image, it doesn’t have to just be JPEG to GIF:
convert image.jpg newImage.gif
Enter the following command to reduce the quality of every JPEG in a directory down to 80%. You can change the 80% to whatever percentage you prefer:
convert -quality 80% *.jpg
Please visit the ImageMagick homepage to learn about the thousands of other commands available.
Note: You can also combine commands. For example:
convert -resize 750×500 -quality 80% *.jpg

Friday, December 4, 2009

Google Docs multiple Headers And Footers

For multiple headers (i.e. different header on each page) use the following tags.:
<div class="google_header">your_content_goes here</div>
For multiple footers:
<div class="google_footer">your_content_goes here</div>
Note that when using multiple footer, do not insert a footer using the UI. It will add the following tag to the page:
<div id="google_footer">your_content_goes here</div>
Setting the id to google_footer makes this header move to the first page, which is not what you intend most of the time with multiple footers.
For page number:
<span class="google_pagenumber">1</span>
For page count:
<span class="google_pagecount">1</span>
Please note that if you are using the page number tags, it would be best not to choose page number option in the user interface as that might conflict with the page numbers you have already entered.

Thursday, December 3, 2009

how to setup OpenLDAP log file

how to setup OpenLDAP log file

[root@esker /etc]# man slapd.conf
...
loglevel
Specify the level at which debugging statements and
operation statistics should be syslogged (currently
logged to the syslogd(8) LOG_LOCAL4 facility). Log
levels are additive, and available levels are:
1 trace function calls
2 debug packet handling
4 heavy trace debugging
8 connection management
16 print out packets sent and received
32 search filter processing
64 configuration file processing
128 access control list processing
256 stats log
connections/operations/results
512 stats log entries sent
1024 print communication with shell
backends
2048 entry parsing

...


[root@esker /etc]# cat /etc/openldap/slapd.conf
...
loglevel 4095
...

[root@esker /etc]# cat /etc/syslog.conf
...
# save OpenLDAP log
local4.* /var/log/ldap.log

restart ldap server

Tuesday, December 1, 2009

Changing the hostname on CentOS

The file /etc/sysconfig/network contains the hostname and will look something like this:

NETWORKING="yes"
GATEWAY="10.1.1.1"
HOSTNAME="www.example.com"

Simply open up the file in your favourite text editor, either as root or using sudo, and change the HOSTNAME value to what you want it to. For example, if we wanted to change www.example.com from the above example to ftp.example.com then you'd end up with the following:

NETWORKING="yes"
GATEWAY="10.1.1.1"
HOSTNAME="ftp.example.com"

This change won't take affect until the next reboot, but you can make the change happen immediately using the hostname command like so:

$ hostname ftp.example.com

Simply issuing the command on its own will return the current hostname, eg

$ hostname
ftp.example.com

You may also need to add/change the hostname in the /etc/hosts file. By default this would look something like this, using our www.example.com example again:

127.0.0.1 www.example.com localhost localhost.localdomain

You would then change it to be like so:

127.0.0.1 ftp.example.com localhost localhost.localdomain