Archive for Linux

Linux (Centos) Adding password by updating /etc/passwd

Probably better to use the admin tools or adduser, however

Process, backup 2 files: /etc/passwd and /etc/shadow
(Shadowing has been enabled by default since last century)
Add user to /etc/passwd
rm /etc/shadow
mkdir home for new user (and set owner/group)
execute /usr/sbin/pwconv
passwd newuser
do same for groups

Leave a Comment

Compiling Python problem and solution, Centos 5, Python 2.5.1

Trying to install an alternate copy of python than that which ships with Centos5 (Why do these package installers not rpm or yum the latest version?? Please can someone tell me!).

The first is to run ./configure

Then if you run make it will break with make: *** [libinstall] Error 1
The solution then is to edit ./Modules/Setup.dist and comment out line 180
rerun with make altinstall to not make it the default.

Leave a Comment

Launching kde remotely

Normally I install and use cygwin-x. From the shell I “startx” and in the shell that opens I enter xhost +
If DISPLAY is properly exported with the correct IP of the client then this generally works for most systems (connecting to Solaris and AIX) but I could not get the Centos remote desktop up via startkde & to finish loading properly so I installed vncviewer on my desktop instead. I would like to know why the desktop hangs, if you are passing and you know then please share! The VNC works in both the browser and via the client app, providing a password is set in the vnc server “Remote Desktop” and a vnc server is started. Lots of info on the web and no point in rewriting.

It’s all pretty grotty stuff really.

Leave a Comment

Port opening in firewall (Linux\Centos). Helps to allow vnc to work

If you need to allow vnc or something through your linux firewall then consider either using the tool provided in the interface or edit

“/etc/sysconfig/system-config-securitylevel”

# Configuration file for system-config-securitylevel

–enabled
–port=22:tcp
–port=137:udp
–port=138:udp
–port=139:tcp
–port=445:tcp
–port=443:tcp
–port=23:tcp
–port=5800:tcp
–port=5801:tcp
–port=5900:tcp
–port=5901:tcp
–port=5902:tcp
–port=5903:tcp
–port=5904:tcp

Other ports to consider

8080 for generic tomcat

4848 for Sun Admin port

Comments (1)

Missing libraries, fixing with yum and rpm, trying to make Blender work.

Blender runs pretty well in a cygwin x-windows shell (so far anyway). Getting Blender to actually work on my generic Centos 5 install was excruciating.

To find out what is missing from a system that will prevent an application from running use ldd as in the following example for the blender executable
[root@styx blender-2.45-linux-glibc236-py24-i386]# ldd blender | grep “not found”
libopenal.so.0 => not found
libalut.so.0 => not found
libSDL-1.2.so.0 => not found

Then to install packages:

[root@styx blender-2.45-linux-glibc236-py24-i386]# yum install libSDL-1.2.so.0
Loading “installonlyn” plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for SDL to pack into transaction set.
SDL-1.2.10-8.el5.i386.rpm 100% |=========================| 12 kB 00:00
—> Package SDL.i386 0:1.2.10-8.el5 set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
SDL i386 1.2.10-8.el5 base 233 k

Transaction Summary
=============================================================================
Install 1 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 233 k
Is this ok [y/N]: y
Downloading Packages:
(1/1): SDL-1.2.10-8.el5.i 100% |=========================| 233 kB 00:00
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: SDL ######################### [1/1]

Installed: SDL.i386 0:1.2.10-8.el5
Complete!

Getting Blender working
The above mentioned package via, yum install libSDL-1.2.so.0
rpm -i /mnt/dante/everyone/openal-0.0.8-1.i586.rpm
rpm -i /mnt/dante/everyone/libalut-1.1.0-alt1.2.i586.rpm

Leave a Comment

Mounting Windows volumes in Linux (In this case Centos 5)

Assuming that samba is running
Assuming that Windows has no firewall blocking
Assuming that the folder on the Windows machine is already shared for all
Assuming the hostname of the windows server is served by a DNS or in /etc/hosts then the name can be used. (If not then use the ip)

So, where dante is the Windows host and styx is a Linux server.

[root@styx /]# mkdir /mnt/everyone
[root@styx /]# chmod -R 777 /mnt/everyone
[root@styx /]# mount //dante/everyone /mnt/everyone

To automatically mount the volume then it would be a good idea to add a line to /etc/fstab
At the end of the file (which I first made a temporary copy of)

//dante/everyone /mnt/dante/everyone cifs password=

Once saved then at the prompt, mount -a to reload the table and be able to access the mount.

Leave a Comment

Installing java 5 on centos5

This is java_ee_sdk-5_04-linux.bin

And the problem is

/root/Desktop/java_ee_sdk-5_04-linux.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory

The binary is not on the machine.

The solution is

[root@localhost ~]# yum install compat-libstdc++*

And Bobs your Auntie

[root@localhost ~]# yum install compat-libstdc++*

Loading “installonlyn” plugin
Setting up Install Process
Setting up repositories
Reading repository metadata in from local files
Parsing package install arguments
Resolving Dependencies
–> Populating transaction set with selected packages. Please wait.
—> Downloading header for compat-libstdc++-33 to pack into transaction set.
compat-libstdc++-33-3.2.3 100% |=========================| 7.2 kB 00:00
—> Package compat-libstdc++-33.i386 0:3.2.3-61 set to be updated
—> Downloading header for compat-libstdc++-296 to pack into transaction set.
compat-libstdc++-296-2.96 100% |=========================| 3.4 kB 00:00
—> Package compat-libstdc++-296.i386 0:2.96-138 set to be updated
—> Downloading header for compat-libstdc++-33 to pack into transaction set.
compat-libstdc++-33-3.2.3 100% |=========================| 7.2 kB 00:00
—> Package compat-libstdc++-33.x86_64 0:3.2.3-61 set to be updated
–> Running transaction check

Dependencies Resolved

=============================================================================
Package Arch Version Repository Size
=============================================================================
Installing:
compat-libstdc++-296 i386 2.96-138 base 90 k
compat-libstdc++-33 i386 3.2.3-61 base 232 k
compat-libstdc++-33 x86_64 3.2.3-61 base 227 k

Transaction Summary
=============================================================================
Install 3 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 549 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): compat-libstdc++-3 100% |=========================| 232 kB 00:01
(2/3): compat-libstdc++-2 100% |=========================| 90 kB 00:00
(3/3): compat-libstdc++-3 100% |=========================| 227 kB 00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing: compat-libstdc++-33 ######################### [1/3]
Installing: compat-libstdc++-33 ######################### [2/3]
Installing: compat-libstdc++-296 ######################### [3/3]

Installed: compat-libstdc++-296.i386 0:2.96-138 compat-libstdc++-33.i386 0:3.2.3-61 compat-libstdc++-33.x86_64 0:3.2.3-61
Complete!

And then it will install.

Comments (1)

shared memory semaphores and amount of memory

Often pre installation checklist items for installing packages include semaphores and shared memory. Documentum requires semaphores to be enabled and at least 2GB RAM.

1. Check semaphores are enabled. This is a preinstall requirement.
In AIX: $ipcs -s

will return rows, if enabled.

2. Check base amount of RAM is available

In AIX: lsattr -El sys0 | grep realmem

Will provide the amount of memory in KB. I believe a min of 2 GB is required for Documentum on Unix (at least true for 5.3).

Leave a Comment

64 Bit Oracle on 64 Bit linux

Getting Oracle to install on many of the distro’s can be a headache.
I was surprised that Oracle’s own ‘Unbreakable Linux’ (64 bit) was an ‘unsupported platform’ of their database product.

Frigging the installer to believe the OS is supported when clearly it is not (as can be seen from the error message) is one of the first obstacles. Many will tell you to run the installer with -IgnoreSysPrereqs and fewer will tell you this is not a good idea.

I’m with the smaller crowd that says do this during the install:

echo 'Red Hat Linux release 4.1' > /etc/redhat-release

While SuSe Enterprise, RedHat and Asian Linux are supported, the closest distro’s I got to the defacto RedHat standard was ‘Centos’ and ‘Oracle Unbreakable Linux’ (which I broke instantaneously by trying to install it on an Asus mb with 4GB Ram – there is a bug in the dma and it needs to be installed with mem=3095 or remove 2GB of Ram during the install of the OS, once installed, drop the memory back in).

Oracle Unbreakable Linux didn’t seem to offer more compatibility with Oracle 10 which was a surprise and disappointment.

Leave a Comment

Unix Shell – History, searching files, so on.

Be able to hunt through the history using up/down keys (or J,K)

in the shell:

set -o vi

Search files for a given word:

find ./ -type f | xargs grep -l “ac.jpg”

where ac.jpg is the string being searched for.

or

find ./ -type f | xargs grep -l “\.co\.uk”
to find .co.uk in all pl files:

find ./*.pl -type f| xargs grep -l “\.co\.uk”

VI – line numbers and deletion:

:set nu

delete lines

:17,40d

Will delete lines 17 thru 40 in vi

Search and replace, for example, lines with ^M at the end -

:%s/<ctrl+v><ctrl+m>//

Move to the end of a line

$

Setting up the shell to handle the backspace key:

stty erase <bksp>

Better to configure putty to do this for you. While in putty, configure X11 forwarding as it makes life easier working with Exceed and other X-Windowing products!

Uncompressing a bz2 file
If it is a tar then use the tar command as in the following:
tar -xvjf blender-2.45-linux-glibc236-py24-i386.tar.bz2

Leave a Comment

« Newer Posts · Older Posts »