Saturday, March 31, 2012

Add PDF support to xmgrace in Centos

 


1) install
sudo yum install pdflib-lite.x86_64 pdflib-lite.i386 pdflib-lite-devel.i386
pdflib-lite-devel.x86_64 netcdf-devel.x86_64 netcdf-devel.i386 netcdf-static.x86_64
netcdf.i386 netcdf.x86_64 libpng-devel.x86_64 fftw2-devel.x86_64 t1lib-devel.x86_64 xbae-devel.x86_64

2) yumdownloader --source grace

if you have a rpmbuild/ structure, it will get installed there; otherwise it will go in /usr/src

3) add --enable-pdfdrv to the
%build
cp %{SOURCE3} %{SOURCE4} .
%configure \
section

4) rpmbuild -bb /home/quevedin/rpmbuild/SPECS/grace.spec

5) sudo rpm -ihv rpmbuild/RPMS/x86_64/grace-5.1.22-2.RHL5.x86_64.rpm rpmbuild/RPMS/x86_64/grace-devel-5.1.22-2.RHL5.x86_64.rpm

Regards

Lucas

Friday, March 23, 2012

SU, SUDO, TTY

 

sudo: Sorry, you must have a tty to run sudo: Error and Solution

I'm trying to run the following command:
ssh user@box.example.com sudo command 1 /path/to/file
But It give me an error which read as follows:
sudo: sorry, you must have a tty to run sudo
How do I fix this problem?
This is done in Fedora, RHEL, CentOS and many other Linux distribution for security concern as it will show the password in clear text format. You have to run your ssh command as follows to avoid this error:
ssh -t hostname sudo command ssh -t user@hostname sudo commandssh -t user@box.example.com sudo command1 /path/to/file
The -t option force pseudo-tty allocation. This can be used to execute arbitrary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.

How Do I Run Command Without Using the -t Option?
You can use the su command instead of the sudo command as follows:
su --session-command="/path/to/command1 arg1 arg2"

OR

ssh user@server1.nixcraft.

in

su --session-command="/path/to/command1 arg1 arg2"
You can run /scripts/job5143 as vivek user using the same syntax:
ssh user@server1.nixcraft.in su --session-command="/scripts/job1 /nas" vivek

Wednesday, February 01, 2012

Improving colors in ls - putty

 

Better Putty settings summary

Category: SessionConnection type: SSHClose window on exit: Never
Category: Terminal > BellAction to happen when a bell occurs: Visual bell (flash window)Taskbar/caption indication: Flashing
Category: WindowLines of scrollback: 20000Reset scrollback on keypress: CheckedReset scrollback on display activity: Unchecked
Category: Window > AppearanceFont: Lucida Console, 9-pointFont quality: ClearTypeGap between text and window edge: 3
Category: Window > TranslationCharacter set: UTF-8Handling of line drawing characters: Unicode
Category: Window > SelectionAction of mouse buttons: xterm (Right extends, Middle pastes)Paste to clipboard in RTF as well as plain text: enabled
Category: Window > ColoursANSI Blue: Red:74 Green:74 Blue:255ANSI Blue Bold: Red:140: Green:140 Blue:255
Category: ConnectionSeconds between keepalives (0 to turn off): 25
Category: Connection > SSH > X11Enable X11 forwarding: enabled
More Info:
http://linux-sxs.org/housekeeping/lscolors.htmlhttp://linux.die.net/man/5/dircolors
http://dag.wieers.com/blog/content/improving-putty-settings-on-windows
http://en.wikipedia.org/wiki/ANSI
escape_code

Tuesday, January 31, 2012

Change a bunch of fdf files

First do a backup
LANG= perl -p -i.bak -e ’s///g’ */*.fdf
Change the fdfs
LANG= perl -p -i -e 's/SpinPolarized\t\tT/SpinPolarized           F/g' */*.fdf