Siestero
The pleasure of DFT, SIESTA, DFT, Solid State simulations... all out of my wicked mind
Friday, August 30, 2019
Create RHEL 7.6 vms in azure
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> $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
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/ANSIescape_code
Tuesday, January 31, 2012
Change a bunch of fdf files
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
Extract version from RCS
see diffs:
rcsdiff /etc/gmond.conf
or
diff -r1.2 /etc/gmond.conf
Thursday, October 28, 2010
convertir posiciones
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
Wednesday, October 20, 2010
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
Sunday, December 21, 2008
Faster dd
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
Friday, June 06, 2008
PWSCF
$PW_COMMAND < si.band.in > si.band.out
$PLOTBAND_COMMAND < si.plotband.in > si.plotband.out
(plotband.x)
Wednesday, April 16, 2008
momentos magneticos
awk 'NR % 3 == 1' spins.dat
Tuesday, April 15, 2008
scp alias
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
GFORTRAN buffer issues
(it kills the buffer)
Friday, November 16, 2007
check-swap.sh
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
Monday, July 23, 2007
Make a random 10 MB file
total size= bs * count
Saturday, June 23, 2007
Kuro-Chan, mi alter ego Japonés
Friday, May 18, 2007
Monday, February 19, 2007
Varios SGE
#pedir 5GB de ram
#$ -l vf=5G
Wednesday, November 22, 2006
Mare Nostrum (I): arch.make de siesta
saludos
LUCAS