Friday, August 30, 2019

Create RHEL 7.6 vms in azure

az vm image list --all -p RedHat -f RHEL -s 7.6 -l westeurope --query [].urn -o tsv

az group create --location westeurope --name DXCRD-1657

for i in {01..05}

do

az vm create --resource-group DXCRD-1657 --name rhel${i} --location westeurope --image "RedHat:RHEL:7.6:7.6.2019062116" --os-disk-size-gb 256 --admin-username dxc --ssh-key-value ~/.ssh/id_rsa-azure.pub --size Standard_D4s_v3 --tags 'JIRA=DXCRD-1657'

az network public-ip update --dns-name rhel${i}dxc --name rhel${i}PublicIP --resource-group DXCRD-1657

ssh dxc@rhel${i}dxc.westeurope.cloudapp.azure.com -oStrictHostKeyChecking=no "sudo yum -y update"

az vm deallocate --resource-group DXCRD-1657 --name rhel${i}

done

Saturday, September 08, 2018

Some azure commands with PowerShell: Open all ports from a certain IP /OpenVPN

PS C:\Users\Lucas> az login
PS C:\Users\Lucas> $ip=Invoke-RestMethod -Uri http://ifconfig.co -UserAgent "curl"PS C:\Users\Lucas> $RESOURCE_GROUP="map61" # se creará si no existe
PS C:\Users\Lucas> az network nsg rule create --resource-group $RESOURCE_GROUP --nsg-name $RESOURCE_GROUP --name AllowAll-from_me --priority 100 --source-address-prefix $ip/32 --destination-port-range 0-65535 # deja toodos los puertos abiertos desde la ip que se crea, se puede cambiar por la ip de la vpn
PS C:\Users\Lucas>

Monday, August 27, 2018

Allow VirtualBox Machine to have different date and time

vboxmanage setextradata  cloudera-quickstart-vm-5.13.0-0-virtualbox   "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1

date  -s '2018-10-28 02:59:55'

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

Thursday, December 29, 2011

error: relocation truncated to fit, additional relocation overflows omitted from the output


The recommended flags to use when you have >2GB of static data are:
-mcmodel medium -shared-intel
or

-mcmodel large -shared-intel
(>>2GB)

Wednesday, December 21, 2011

Sunday, December 04, 2011

job for Antares3


#!/bin/bash
#
#$ -cwd
#$ -j y
#$ -S /bin/bash
#$ -pe orte 24


. /share/apps/intel/bin/ifortvars.sh intel64
. /share/apps/intel/impi/4.0.3.008/bin64/mpivars.sh


/share/apps/intel/impi/4.0.3.008/bin64/mpiexec.hydra -bootstrap sge /share/apps/SIESTA/3.1/siesta  < Au411.fdf

Friday, December 02, 2011

/etc/exports


/export 10.1.1.1(rw,async,no_root_squash) 10.1.0.0/255.255.0.0(rw,async)
/state/partition1 10.1.1.1(rw,async,no_root_squash) 10.1.0.0/255.255.0.0(rw,async)
/export/home 10.1.1.1(rw,async,no_root_squash) 10.1.0.0/255.255.0.0(rw,async)
/share  10.1.1.1(rw,async,no_root_squash) 10.1.0.0/255.255.0.0(rw,async)

Thursday, November 10, 2011

Send files from command line


mandar un archivo:



uuencode surfing.jpeg surfing.jpeg | mail sylvia@home.com


Un directorio
tar cvf - panda | uuencode panda.tar | mail whoever@whatever.com 
tar zcvf - *psf MoS2-wire.out ds5b_30atms.DM ds5b_30atms.XV 
ds5b_30atms.STRUCT_NEXT_ITER  ds5b_30atms.STRUCT_OUT | uuencode MoS2.pseudo.tgz 
| mail quevedin@gmail.com 



Job Ranger


#!/bin/bash
#$ -V # Inherit the submission environment
#$ -cwd # Start job in submission directory
#$ -N MoS2-crushed # Job Name
#$ -j y # Combine stderr and stdout
#$ -o $JOB_NAME.o$JOB_ID # Name of the output file (eg. myMPI.oJobID)
#$ -pe 16way 16 # Requests 16 tasks/node, 32 cores total
#$ -q normal # Queue name "normal"
#$ -A MoS2_Nanocatalysts
#$ -l h_rt=24:00:00 # Run time (hh:mm:ss) - 1.5 hours
#$ -M quevedin+ranger@gmail.com # Use email notification address
#$ -m be # Email at Begin and End of job
#module swap pgi intel/9.1
module load pgi/8.0-6
#/8.0-6pintel/9.1
#module swap mvapich openmpi
#module load openmpi/1.2.4
export GFORTRAN_UNBUFFERED_ALL=1
set -x # Echo commands, use "set echo" with csh
if [ -f MoS2-wire.out ]; then refecha MoS2-wire.out; fi
if [ -f *.ANI ]; then for i in *.ANI ; do refechacp  $i; done; fi
ibrun ~/SIESTA/siesta-3.1/Obj-pgi/siesta < MoS2-wire.final.crushed.fdf | tee MoS2-wire.final.crushed.out # Run the MPI executable named "a.out"

Wednesday, March 16, 2011

compute-0-3

falla de nuevo, probablemente hay que hacer una melange de piezas

Extract version from RCS

co -r1 /etc/gmond.conf
see diffs:
rcsdiff /etc/gmond.conf
or
diff -r1.2 /etc/gmond.conf

Thursday, October 28, 2010

convertir posiciones

for i in `seq 562 1000`; do j=$((i-1)); tail -n $i $i.TXT > $i.tmp; echo "$i.tmp $j" |./convierte.x > $j.xyz; rm $i.tmp ; done


for i in 75 76 77 78; do for j in A B C; do if [ -f $i$j ]; then echo "$i$j $i" | ./convierte.x > $i$j.xyz; fi; done; done

Thursday, February 25, 2010

Limpiar el .bash_history a lo burro

history | sort +1 | uniq -f 1 | sort -n| cut -c 8- > .bash_history.nodups

echar un vistazo que todo esté bien y luego mover a .bash_history

Wednesday, September 23, 2009

Qué quiere decir ZP en Newsweek


The awful truth: la gráfica que nadie te pintará (porque hay que saber hacer un sumatorio, ni siquiera integrar)

Sunday, December 21, 2008

Faster dd

dd if=/dev/sdc1 conv=noerror,sync bs=64k | dd of=/dev/sdi1 bs=64k
9856+0 registros de entrada
9855+0 registros de salida
645857280 bytes (646 MB) copiados, 17,871 s, 36,1 MB/s

frente a

dd if=/dev/sdc1 of=/dev/sdi1
3801513+0 registros de entrada
3801513+0 registros de salida
1946374656 bytes (1,9 GB) copiados, 1055,21 s, 1,8 MB/s

Wednesday, July 23, 2008

Quitar archivos sobrantes de SIESTA

rm $(find . -name "CHLOCAL.*" -or -name "KB.L*" -or -name "ORB.S*" -or -name "*.ion*" -or -name "*.POT.CONF" -or -name "VNA.*" -or -name "RED_VLOCAL.*" -or -name "INPUT_TMP.*" | head -2000)

Friday, June 06, 2008

No Kylie, No

PWSCF

$PW_COMMAND < si.scf.in > si.scf.out

$PW_COMMAND < si.band.in > si.band.out

$PLOTBAND_COMMAND < si.plotband.in > si.plotband.out
(plotband.x)

Wednesday, April 16, 2008

momentos magneticos

grep -A170 "mulliken: Atomic and Orbital Populations:" parallel.output | grep -v '^$' | grep -v Atom | grep -v 4pz> spins.dat
awk 'NR % 3 == 1' spins.dat

Tuesday, April 15, 2008

scp alias

in .bashrc:

function mn1 { scp $1 user@machine.dom: ;}

($1, $2... argumentos en linea de comando)
o

function mn1 { scp $* user@machine.dom: ;}

(pa que meta todo)
# mn1 cosa1
Password:

Wednesday, April 09, 2008

Friday, November 16, 2007

check-swap.sh

#!/bin/bash
if grep -q "/swap" /etc/fstab
then
echo "Encontrado"
else
echo "Añadiendo"
echo '/swap swap swap defaults 0 0' >> /etc/fstab
mount -a
fi

Añadir Swap

for i in `qhost | grep -v -- \-\ | grep 996.2M | awk '{print $1}'`; do ssh -x $i " dd if=/dev/zero of=/swapfile count=2M ; mkswap /swapfile; swapon /swapfile"; done

Monday, July 23, 2007

Make a random 10 MB file

dd if=/dev/urandom of=test.jpg bs=1k count=10k
total size= bs * count

Saturday, June 23, 2007

3er vídeo de los Yasuda Dai Circus

Los Yasuda Dai Circus en el Turf

Kuro-Chan, mi alter ego Japonés

De mis andanzas por Berkeley los amigos conoceréis que los Nihongos se partían el ojal con mi imitación de Kuro-Chan, con más mérito cuando no tenía ni zorra de la pinta del elemento. Podéis admirar al susodicho cómico preparándose para el 'Mira quien Baila' japonés:

Friday, May 18, 2007

Modificar numero cpus

http://blogs.sun.com/hstsao/
qconf -mattr queue slots 1 all.q@local

Monday, February 19, 2007

Varios SGE

Para requerir una cantidad de memoria en SGE

#pedir 5GB de ram
#$ -l vf=5G

Wednesday, November 22, 2006

Mare Nostrum (I): arch.make de siesta

He logrado que SIESTA y GULP corran en MareNostrum!!! Aparte del subidón de adrenalina, pondré por aquí y enviaré a la lista el arch.make y el de gulp

saludos

LUCAS

Tuesday, November 21, 2006

Back in Town!!!

Voy a tratar de volver a postear de vez en cuando, ya que el myspace es como el 20six... peta más que una escopeta de feria

Monday, March 14, 2005

ifort buggy

Bug del día: el ifort última versión peta en mulliken.F !

Thursday, March 10, 2005

Siestero

Siestero
He empezado a jugar con un código muy potente, PWSCF