Slicin’n'dicin’

September 28, 2009

Splitting a big file into a set of files by the lines containing ‘end’:

csplit kk.out /end/+2 {*}

Delete all lines containing “end” from the set of files xx*
for i in xx*
do
ed -s $i <<< $'g/end/d\nw'
done


Business Logic

September 18, 2009

A new tendency emerging in software management for private companies to store, handle and backup/restore their data. The customer company keeps the hole computer system hosted in an external place managed by the IT company that administrated the SaaS  (Software as a Service)


Exadata v2

September 17, 2009


including 3D desings in latex documents

September 16, 2009

\documentclass[11pt,a4paper]{article}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[3D]{movie15}
\usepackage[countmax]{subfloat}

\begin{document}acr3D_latex

some text…..
It code fragment needs aditionally movie15 package and you must use .u3d 3D format to insert your drawings.
Take care because no defined view is set in this code so your 3D desing could not apear in a right way.

\begin{figure}
\centering

\includemovie[poster,toolbar,label=draw13D]{6cm}{6cm}{draw13D.u3d}
\includemovie[poster,toolbar,label=draw23D]{6cm}{6cm}{draw23D.u3d}

\centering
\caption{\label{drawings} some caption text.}

\end{figure}

\end{document}


including multiple panel figures in latex

September 16, 2009

\documentclass[11pt,a4paper]{article}
\usepackage{subfig}
\usepackage{graphicx}
\usepackage[countmax]{subfloat}

\begin{document}

some text…..

This code fragment below generates a 2×2 figure matrix labelling each image as (a), (b), (c), and (d) . You can refer to each individual image by inserting \ref{fig:image_n} into your text body or refer the hole figuare panel using \ref{fig:multi_panel}

\begin{figure}multi_panel
\centering
\subfloat[%optionally add here a short text as a label]
{\label{fig:image_1}
\includegraphics[width=0.3\textwidth]{image_1.jpg}}

\subfloat[]{
\label{fig:image_2}
\includegraphics[width=0.3\textwidth]{image_2.jpg}}

\subfloat[]{
\label{fig:image_3}
\includegraphics[width=0.3\textwidth]{image_3.jpg}}

\subfloat[]{
\label{fig:image_4}
\includegraphics[width=0.3\textwidth]{image_4.jpg}}

\centering
\caption{\label{fig:multi_panel} some caption text}
\end{figure}

\end{document}


scp alias functions

September 14, 2009

in .bashrc:

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

($1, $2… arguments in command line)or

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

(to add all arguments)

# mn1 file1
Password:

Faster dd

September 14, 2009
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
against

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

A better .bash_history

September 14, 2009

To clean. bash_history

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

have a look, then move to .bash_history. Even better:

awk '!x[$0]++' .bash_history > .bash.tmp && mv .bash.tmp .bash_history

also add this to .bashrc:

export HISTCONTROL=ignoredups:erasedups

Backups with .bat files in windows

September 11, 2009
@echo hola
net use Y: \\156.35.84.171\alija  /user:alija fismag08
XCOPY D:\TESIS\*.* Y:\TESIS\ /D/S/E/V/C/F/Y/H/K/EXCLUDE:D:\EXCLUDE_BACKUP.TXT
XCOPY D:\FICYT\*.* Y:\FICYT\ /D/S/E/V/C/F/Y/H/K/EXCLUDE:D:\EXCLUDE_BACKUP.TXT
XCOPY D:\RSEF\*.* Y:\RSEF\ /D/S/E/V/C/F/H/K/Y/EXCLUDE:D:\EXCLUDE_BACKUP.TXT
XCOPY G:\ANALISIS_DATOS_SIMULACIONES\*.* Y:\SIMULACIONES\ /D/S/E/V/C/F/H/Y/K/EXCLUDE:D:\EXCLUDE_BACKUP.TXT

net use Y: \\machine.domain\Resource /user:user_name password

XCOPY D:\THESIS\*.* Y:\THESIS\ /D/S/E/V/C/F/Y/H/K/EXCLUDE:D:\EXCLUDE_BACKUP.TXT

XCOPY D:\DIR1\*.* Y:\DIR1\ /D/S/E/V/C/F/Y/H/K/EXCLUDE:D:\EXCLUDE_BACKUP.TXT

—-

EXCLUDE_BACKUP.TXT:

.bak

.tmp

.bk1

(extensions to ignore)


Identify processes with qsub (cumbersome)

September 10, 2009

If you are inside a directory and want to check which job corresponds to it:

for i in $(qstat | awk '{print $1}'); do qstat -j $i | grep -q `pwd` && echo $i ; done