sábado, abril 25, 2015

Replicação de aplicações entre maquinas linux


Aproveito para deixar um que e capaz de ser útil para fazer replicação de aplicações entre maquinas
 
SOURCE : tar -c <folder> | nc -l 9999
DESTIN : nc <IP da source> 9999 | tar –xv
 
Cria um tar file (e um agregador de ficheiros sem compressão) e faz um netcat ficar a escuta na port 9999
 
No destino executa a ligação ao servidor onde executamos o primeiro comando e faz descompressão do tar para o local, replicando a estrutura dentro do TAR que criamos previamente.
 
 
PS-> Com o grato contributo do BA :)

Comandos Linux vários

Ficam aqui alguns exemplos.

https://www.dropbox.com/s/spxaerwwarxhx6z/HelpComandos.txt?dl=0

High Efficiency Video Coding h.265



http://en.wikipedia.org/wiki/High_Efficiency_Video_Coding

How to calculate the number of working days
















http://www.techrepublic.com/blog/microsoft-office/use-excel-to-calculate-the-number-of-working-days-you-have-to-complete-your-projects/

quinta-feira, abril 23, 2015

A Groovy kind of trick for SoapUI free in eight steps

A Groovy kind of trick for SoapUI free in eight steps

Imagine you are testing a web service, and you want to run the same test with a different data set. In the pro version, you can simply use a DataSource step inside your test case to take data from an external source. Unfortunately, in the free version this kind of step is not available, and the simplest solution would be to create as many test cases as data sets you have… this could work out well if you have ten data sets, but imagine if you have a hundred or more!!


http://blog.belatrixsf.com/a-groovy-kind-of-trick-for-soapui-free-in-eight-steps/

terça-feira, abril 21, 2015

A collection of Unix/Linux find command examples

Linux/Unix FAQ: Can you share some find command examples?
Sure. The Linux find command is very powerful. It can search the entire filesystem to find files and directories according to the search criteria you specify. Besides using the find command to locate files, you can also use the command to execute other Linux commands (grep, mv, rm, etc.) on the files and directories you find, which makes find extremely powerful.
In this article we'll take a look at the most common uses of the find command.


http://alvinalexander.com/unix/edu/examples/find.shtml


basic 'find file' commands
--------------------------
find / -name foo.txt -type f -print             # full command
find / -name foo.txt -type f                    # -print isn't necessary
find / -name foo.txt                            # don't have to specify "type==file"
find . -name foo.txt                            # search under the current dir
find . -name "foo.*"                            # wildcard
find . -name "*.txt"                            # wildcard
find /users/al -name Cookbook -type d           # search '/users/al'

search multiple dirs
--------------------
find /opt /usr /var -name foo.scala -type f     # search multiple dirs

case-insensitive searching
--------------------------
find . -iname foo                               # find foo, Foo, FOo, FOO, etc.
find . -iname foo -type d                       # same thing, but only dirs
find . -iname foo -type f                       # same thing, but only files

find files with different extensions
------------------------------------
find . -type f \( -name "*.c" -o -name "*.sh" \)                       # *.c and *.sh files
find . -type f \( -name "*cache" -o -name "*xml" -o -name "*html" \)   # three patterns

find files that don't match a pattern (-not)
--------------------------------------------
find . -type f -not -name "*.html"                                # find all files not ending in ".html"

find files by text in the file (find + grep)
--------------------------------------------
find . -type f -name "*.java" -exec grep -l StringBuffer {} \;    # find StringBuffer in all *.java files
find . -type f -name "*.java" -exec grep -il string {} \;         # ignore case with -i option
find . -type f -name "*.gz" -exec zgrep 'GET /foo' {} \;          # search for a string in gzip'd files

5 lines before, 10 lines after grep matches
-------------------------------------------
find . -type f -name "*.scala" -exec grep -B5 -A10 'null' {} \;
     (see http://alvinalexander.com/linux-unix/find-grep-print-lines-before-after-...)

find files and act on them (find + exec)
----------------------------------------
find /usr/local -name "*.html" -type f -exec chmod 644 {} \;      # change html files to mode 644
find htdocs cgi-bin -name "*.cgi" -type f -exec chmod 755 {} \;   # change cgi files to mode 755
find . -name "*.pl" -exec ls -ld {} \;                            # run ls command on files found

find and copy
-------------
find . -type f -name "*.mp3" -exec cp {} /tmp/MusicFiles \;       # cp *.mp3 files to /tmp/MusicFiles

copy one file to many dirs
--------------------------
find dir1 dir2 dir3 dir4 -type d -exec cp header.shtml {} \;      # copy the file header.shtml to those dirs

find and delete
---------------
find . -type f -name "Foo*" -exec rm {} \;                        # remove all "Foo*" files under current dir
find . -type d -name CVS -exec rm -r {} \;                        # remove all subdirectories named "CVS" under current dir

find files by modification time
-------------------------------
find . -mtime 1               # 24 hours
find . -mtime -7              # last 7 days
find . -mtime -7 -type f      # just files
find . -mtime -7 -type d      # just dirs

find files by modification time using a temp file
-------------------------------------------------
touch 09301330 poop           # 1) create a temp file with a specific timestamp
find . -mnewer poop           # 2) returns a list of new files
rm poop                       # 3) rm the temp file

find with time: this works on mac os x
--------------------------------------
find / -newerct '1 minute ago' -print

find and tar
------------
find . -type f -name "*.java" | xargs tar cvf myfile.tar
find . -type f -name "*.java" | xargs tar rvf myfile.tar
     (see http://alvinalexander.com/blog/post/linux-unix/using-find-xargs-tar-crea...
     for more information)

find, tar, and xargs
--------------------
find . -name -type f '*.mp3' -mtime -180 -print0 | xargs -0 tar rvf music.tar
     (-print0 helps handle spaces in filenames)
     (see http://alvinalexander.com/mac-os-x/mac-backup-filename-directories-space...)

find and pax (instead of xargs and tar)
---------------------------------------
find . -type f -name "*html" | xargs tar cvf jw-htmlfiles.tar -
find . -type f -name "*html" | pax -w -f jw-htmlfiles.tar
     (see http://alvinalexander.com/blog/post/linux-unix/using-pax-instead-of-tar)

terça-feira, abril 07, 2015

Instalar o Cliente Telnet usando uma linha de comando

Instalar o Cliente Telnet usando uma linha de comando

No Windows Server 2008 ou no Windows Vista, é possível usar o seguinte procedimento de linha de comando para instalar o Cliente Telnet.

Para instalar o Cliente Telnet usando uma linha de comando

  1. Abra uma janela de prompt de comando. Clique em Iniciar, digite cmd na caixa Iniciar Pesquisa e pressione ENTER.
  2. Digite o seguinte comando:
    pkgmgr /iu:"TelnetClient"
    
  3. Caso a caixa de diálogo Controle de Conta de Usuário apareça, confirme se a ação exibida é a desejada e clique em Continuar.
  4. Quando o prompt de comando for exibido novamente, a instalação estará concluída.