I use math in bash scripts a lot, from simple crontab reports to Nagios monitoring plugins… Here is few small examples on how to do some maths in Bash with integers or float.
Using losetup and dd to secure sensitive data (encrypted block device)
Bash - GNU Shell, Case Study View CommentsMy 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 :
- Create an image with dd
- Build a new device using the image with an encrypt algorythm by using losetup
- Format the device using mkfs.ext3
- 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.
You probably already ask you : “which filesystem can I use on my web servers or database server ?” Usually you will use the well know Ext3-fs but what about the others ?
I will just try to give you some clue about some other common filesystems. The filesystem aspect of your server is really important and your choice will vary with your running application. As exemple, a mail server will have more performances with a Reiserfs filesystem than with Ext3-fs.















Recent Comments