Joaquin Peralta

My Personal weblog.

Using dd

dd

dd is a very util command for transfer and copy of files from a device/file to a device/file

Ex :

diskette to image

dd if=/dev/fd0 of=~/image.img

image to diskette

dd if=~/image.img of=/dev/fd0

iso9660 image with dd

dd if=/dev/cdrom of=~/cdimage.iso

Convert a nero CD-image (nrg) to ISO image with dd

The .nrg (Nero Image) are files .iso with 300K extra header, so for transformation, only type :

dd if=Image.nrg of=Image.iso bs=1024 skip=300

etc…

For more detail, yo can see the man page : man dd.

JP.

June 30, 2006 Posted by jperalta | GNU/Linux | | No Comments Yet

Para cerrar definitivamente mi antiguo Blog.

Sip, el blog peronal que hice con sphpblog, y que tenia en mi pagina web lo cambio definitivamente por este.

Si bien el otro me funciono sin problemas, no pude poner fotografias en los posteos, al menos no de una forma facil, sin embargo agradesco mucho a sphpblog ;) .

Bueno, coloco a continuacion los viejos posteos que tenia y que no he transferido aun. Principalmente para no dejarlos en el olvido, por eso solo hice un copy-paste inclusive indicando las fechas en que fueron posteados.

Read more »

June 29, 2006 Posted by jperalta | Life in general, My Interests/hobies | | No Comments Yet

Little 2 tips

Chmod

Changing file permissions. The chmod command is a utiliti for change the permission of a file.

Each file have three propierties : own/group/others.

and them can be have three types of authorizations, read-write-execution.

the chmod command can change the permission of this file, using many forms, the more old form is using binary code for the permission, see the next table :

rwx – dec
000 – 0
001 – 1
010 – 2
011 – 3
100 – 4
101 – 5
110 – 6
111 – 7

ie, if you want change the permission of your file for ‘rw’ to ‘user’, ‘r’ to group and nothing for others, you need type :

chmod 640 file.any

the first number is the permission asigned to the user, the second to the group an the third to others.

Read more »

June 29, 2006 Posted by jperalta | GNU/Linux | | No Comments Yet

xmakemol

xmakemol

This is a program for visualizing atomic and molecular systems, is design for X, and have a version for openGL. It reads XYZ input and renders atoms, bonds and hydrogen bonds.

For install xmakemol in Linux/Debian, you only need type, as root, the command apt-get install xmakemol, and apt-get install xmakemol-gl if you prefeer the openGL version.

The official home-page of xmakemol is here, and some specifications about the XYZ file type here.

A simple example :

file : tet.xyz


4
Ag 0.912605 -0.884956 1.004240
Ag 0.688991 -0.045417 -1.469333
Ag -1.499457 -0.594411 -0.081237
Ag -0.102140 1.524784 0.546330
This file is a tetrahedron, you can visualize this file using xmakemol, with the command :

xmakemol -f tet.xyz

So, with this you can manipulate the image.

tetraedro

The home page of xmakemol its here

June 28, 2006 Posted by jperalta | GNU/Linux, Physics and Fun | | No Comments Yet

Openbabel

openabel

The openbabel program “Convert and manipulate chemical data files”, is used principally for the convertions betwen diferent chemical files.

For an easy installation in Linux system based in Debian, as root type : apt-get install openbabel.

The use of the program :


babel [-i<input-type>] <name> [-o<output-type>] <name>

You can see the types of input and output in the man section of the program, man babel. A simple example of use, convert a xyz type of file in, for example a pdb data type. The solution to this problem is easy resolved with openbabel :


babel -ixyz input.xyz -opdb output.pdb

Ready!!!

Ahhh.. the web-page of openbabel

June 27, 2006 Posted by jperalta | GNU/Linux, Physics and Fun | | No Comments Yet

Units

units

This utility is for convert physical units in linux, this program is distributed with many distribution, for the instalation, you can see the homepage of units. However for Debian users its very easy installation, to enter like root, and type ‘apt-get install units‘.

for example is very easy with units see how much meeters is 1 feet, only type :

units 1ft m -v;

The output show both convertions :

jperalta@samael:~$ units 1ft m -v
1ft = 0.3048 m
1ft = (1 / 3.2808399) m
jperalta@samael:~$

units, support decimal and binary prefixes, for more detail yu can see a web page about this.

June 26, 2006 Posted by jperalta | GNU/Linux, Physics and Fun | | No Comments Yet

Compress a File using 7zip

In this oportunity i compress my directory "Proyectos" with 194 files and 28 Directories, so i put three classical forms of compression :

Proyectos

This directory have 194 files and 28 directories, and :


jperalta@samael:~$ du -sb Proyectos
31335991 Proyectos
jperalta@samael:~$

ie, 31335991 bytes ~ 31 [Mb]

Gunzip

tar -czf Proyectos.tgz Proyectos/

Bzip2

tar -cjf Proyectos.tbz Proyectos/

7zip

7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on Proyectos.7z Proyectos/

The results are evident :


jperalta@samael:~$ ls -hl Proyectos.*
-rw-r--r-- 1 jperalta jperalta 2.9M Jun 1 12:03 Proyectos.7z
-rw-r--r-- 1 jperalta jperalta 8.0M Jun 1 12:02 Proyectos.tbz
-rw-r--r-- 1 jperalta jperalta 10M Jun 1 12:01 Proyectos.tgz
jperalta@samael:~$

The winner is 7zip, evidently.

For installation of 7zip (linux,winodws,others) go to the principal web-page. In this page you can found benchmark and faq about 7zip.

June 26, 2006 Posted by jperalta | GNU/Linux | | 1 Comment

Juaco’s Blog is open

Yes, a new blog …

I will move my principal themes from my web page here.

http://zeth.ciencias.uchile.cl/~jperalta

This is all for the moment.

Thank you!!!!

June 25, 2006 Posted by jperalta | Life in general | | No Comments Yet

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

June 25, 2006 Posted by jperalta | Uncategorized | | 1 Comment

Protect your files with openssl

Protect your files :

A very secure form of protect your files is with openssl, but if you lost the password, maybe you lose all your data.
First Step :

Install openssl, if you are a Debian user, only type (as root) : apt-get install openssl;
note : SSL=Secure Sockets Layer

So, if you have installed openssl, i recomend that you use a script for encrypt or decrypt a file, and put this scripts in your favorite or personal scripts.
Encrypt Script

filename : crypt

content :

#/usr/bin/sh
#Version-0.1
openssl enc -aes-256-cbc -salt -in $1 -out $1.enc

use : Encrypting a File, use the command -> 'crypt filename.txt' After put the password (don't lose). The output file is a new file named : "filename.txt.enc" this is the file encrypted, now you can delete or move the old file "filename.txt" So, the new file "filename.txt.enc" is your new file encrypted. For decrypt File, see the next section.
Decrypt Script

filename : decrypt

content :

#/usr/bin/sh
#Version-0.1
openssl enc -d -aes-256-cbc -in $1

use : Decrypting a File, use the command -> 'decrypt filename.txt.enc' After validate your password, so the standard output is the original file. If you prefeer you can use the command 'decrypt filename.txt.enc > filename.txt', and redirect inmediatly the output to the original file.
Some Considerations

At the moment the script are work very good, with any type of file, text and binary, so if you have aproblem send me an e-mail (see this in my personal web page) the 'aes-256-cbc' flag correspond to the type of encryptation, if you are a paranoid people i recommend another encryptation method, but with this you are ok. ;)

This is all

JP

June 25, 2006 Posted by jperalta | GNU/Linux | | 2 Comments