Using losetup and dd to secure sensitive data (encrypted block device)

Bash - GNU Shell, Case Study Comments

My previous post was made a long time ago, so here is a draft that I finally decide to post. Let’s see how to secure some of your data with an encrypted block device using losetup and dd.

Steps will be :

  1. Create an image with dd
  2. Build a new device using the image with an encrypt algorythm by using losetup
  3. Format the device using mkfs.ext3
  4. Mount the device and start using it !

Of course, when you have mounted the device, your data are readable to anyone who have access to the mounted directory.

Read the rest of this entry »

Printing a sequence of letters or numbers

Bash - GNU Shell, Tips Comments

Some times, while scripting in your favorite shell (I mean Bash !! :) you need to print a sequence of letters or numbers. Don’t write it yourself ! Script it using seq or curly braces !

Print a sequence of number

nicolas@macvin:~$ seq 1 10
1 2 3 4 5 6 7 8 9 10
nicolas@macvin:~$ seq 0 2 10
0 2 4 6 8 10
nicolas@macvin:~$ echo {1..10}
1 2 3 4 5 6 7 8 9 10

Print a sequence of letters

nicolas@macvin:~$ echo {a..g}
a b c d e f g

Hope this will help you while doing a loop or building some hash directories :

nicolas@macvin:~$  mkdir -p test/{1..10}/{1..10}

Enjoy !

Cheap SAN and secure backup solution for small-sized platform

Bash - GNU Shell, Case Study Comments

Here is a quick post about a cheap SAN and secure backup architecture solution for small-sized platform (5/10 servers). In this study case we will see how to use Network Block Devices (nbd) and soft-raid with mdadm. I design it for my personal web platform which is a small one. Last day, I was missing of free space on my backup server and I was angry by the idea to rent a most expensive server to store my backup while I had lot of unused space on my other servers.

1. Initial platform
2. New platform
3. How to do it ?

Read the rest of this entry »

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in