Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Dark blue on Linux terminal difficult to read


Change Blue into Cyan ... it is just a lot more readable.

How?
Very easy once you know it:

Open a shell and stay in your home directory.
Do the following:
$> dircolors | sed -e "s/34/36/" > setColors.bash

This will create the file setColors.bash containing the current color settings for the terminal with the value of 34 changed into 36.

To try the setting, do the following:
$> .  ./setColors.bash

Your current terminal session will now show directories in cyan instead of blue. Use ls -l to see the difference. Notice also the dot followed by a space in front of ./setColors.bash.

To make the change for all your future sessions, you need to modify the profile script which is run when you create the terminal session. In case you're using bash, look for the .profile_bash file.

You can then either copy the content of the setColors.bash file into the profile file or call the execution of it. Make sure to execute the script in the current shell  and not in a subshell by using the mentionned dot space notation.

Reference and solution found here

I needed to remove the screenshots ... thanks blogspot ... just doesn't work.

Example of how it looks before the change:

The output of dircolors: (notice the 34's)


Create the setColors.bash script:


The content of the setColors.bash file: (notice the changed values for 34 into 36)


The line appended in the .bash_profile file in the hone directory of the user:



Example of how it looks after the change:



bash - Substitution of variables

This link explains variable substitution in the Bash Shell.
For convenience a copy of some info in that post:
  • ${VAR-default}
    If VAR is set (to any value, even null, then return $VAR, otherwise return the default value provided. VAR is unchanged. If the - is preceded by a colon (':') then the default value will also be returned in case the value of VAR is null.
  • ${VAR=default}
    The same as '-' except that the value of VAR will be changed too. The use of the colon is the same in this case.
  • ${#VAR}
    This returns the number of characters in VAR. (Unicode ???)
  • ${VAR#pattern}
    Returns VAR with the shortest instance of pattern removed from the front.
    Pattern is not a regular expression but a glob. If ## is used instead of # the longest matching pattern is removed from the front.
  • ${VAR%pattern}
    Identical to # except the front will be the end of value of VAR

Linux - determine the block size of ext3 filesystem

Simple ... when you know it

Just use the command tune2fs with the -l option and followed by the name of the device.

$> tune2fs -l /dev/VolGroup00/LogVol00 | grep -i "block size'

nfs on enterprice linux - to be continued

This is just a resume from the things I read in some articles and things I experience while applying them.

0. Point Zero
Some considerations are in place.
NFS stands for Network File System, or ... you need a network and you need a filesystem to be shared. This latter is in a certain way a big limitation of the possibilities of NFS. it is not possible to share a subdirectory of a filesystem.

a. Use an nfs share

a.1. verify the portmapper is running
To do this run
rpcinfo -p
The portmapper should be in the list that is returned.

a.2. Mount the share
Just use the mount command telling the type of drive is nfs and the location where to find the share and how the share is called.
$> mount -t nfs :
example:
mount -t nfs mynfsserver:software /remoteshares/software
The location must exist upfront.

To unmount
$> umount

b. Create an nfs share

b.1. define the shares that may be exported
The shares are defined in the /etc/exports file.
Look to this location for information on the possible options.
A very simple example of the file
/Software *.hellings.be(ro)
/Share *.hellings.be(rw,all_squash,anonuid=100,anongid=100)

use exportfs to update the mountd tables.
$> exportfs -rav

b.2. (re)start the nfs server
This depends on how nfs has been installed.
If installed as a service use
service nfs restart

c. Mounting nfs shares at boot time

A line should be added to the fstab file in /etc.
Look in the referenced articles for further details.
It should look something like
: nfs rw 0 0
nfs is the type of filesystem
rw can be elaborated with a lot of other options
0 (this is the number zero) is the dump indicator
0 (again ... zero) is the fsckorder flag.

d. What about permissions on nfs share drives?

Not investigated yet .... sorry ...
The only thing is that you can set a 'replacement' user and group on the level of the nfs-share definition in the /etc/exports file, using the anonuid and anongid options. this in combination with all_in_squash option.

e. References
This is the original article

NFS reference pages
...

Ubuntu/Linux Server - Switch between tty's

Well for those not used to it and are always working on boring windows displays in stead of performant - back to basics and essentials - character based screens ...
There seem to be six of them.
At startup you are by default using the first.
By pressing ctrl-alt-Fx you can select any of the six tty's.
Ctrl-Alt-F2 will go to the second tty
Ctrl-Alt-F1 will go back to the first (the default in use)