wiki:SuperHome

Version 9 (modified by Thanatermesis, 15 years ago) ( diff )

--

Main Idea and Purpose

I have always tried to have the perfect home setup with important and needed features for any advanced linux user (normal users can found very interesting tips), actually I have a new and even better setup, everytime more near to the perfection (very possible never reachable), but this setup includes a thousand of nice features, there's a few examples:

  • Encryption of all my data
  • Everything on the home of my user, nothing on the system anymore
  • History (based on home-vcs) of the data that will be interesting to maintain an history
  • Branches, useful to switch to another mode, this can be an older version/release of something (Elive, there), or simply another different project
  • Lots of automatizations
  • Easy and automatized backups
  • Synchronized with other computers
  • Travel anywhere and have your full home, data, and configurations, just like automations, tools, scripts, etc...
  • Not need of your computer in order to work anywhere (everything always with you)
  • When the system shutdowns, all the things goes back to the original state, maintaining the system intact

If you found that these things will be interesting for you, then continue reading...

First Setup

Note that Im explaining it just like how I have setup it for me, you are of course free to use my ideas/features or not, but remember that my scripts/tools included on this article are setup to work on that way, you must hack them at your needs, if you think that you have do something interesting on your hack useful for me, you are welcome to send me an email with your modifications/ideas. At the same way, we use there everything for the user thana, you must change this for your own setup.

The first thing to do is to have everything on a own home, independent of the rest of the system, for that, we will use a special partition for that user home data and we will crypt it with luks mode encryption, you can found howto's in google about how to do that.

Im using right now a small external hard disk (2.5") plugged on my laptop via USB, while moving all my data to my new home structure im going to work only from the laptop for now, this is a very interesting because you can travel anywhere with your small hard disk and boot any computer and having all your work environment ready to use, just like in your house.

  • Create a partition of 1 gb where you will put a live mode of Elive (tool for create live usb's in the Administration's menu of applications)
  • Create a partition with the rest of the disk and crypt it with cryptsetup/luks (google howto's)

The home of the user contains basically only 2 directories, Git and Data, the first one contains everything that should be traced by git, in order to have features like history and branches (so, scripts, some configurations, patches, changelogs), and the other one (Data) contains simple data (music, videos, photos, files, isos, debootstraps, backups, repositories, tmp, www, ftp, etc). After to have this structure, we will use simple links for everything in order to have it humanly organized. More details in the next section:

Date Structure

For the Git directory:

  • Git/git : In this directory we will put everything that should be traced by GIT (vcs), which includes:
  • Git/git/home_linked : This is a special directory, used too in Data, everything there is meant to be linked to the real user-home root directory, like: bin, .elxstrt, .gtk*, .subversion, .vim*, .bash*, .gnupg, etc
  • Git/git/changelogs : Like previously explained, this directory for example is not needed to have it linked on the real home root dir, but we may want a changelog directory there traced by git.
  • Git/git/etc_root : Configurations for root, more specifically for the /etc directory, because we are going to disable entirely the usage of the root user, so the main idea is that root will not have any configuration, or not needed for us, at least.
  • Git/git/etc_thana : Configurations for the thana user, the purpose of this directory is not the configuration of the applications for the configurations for our SuperHome structured system, in other words, everything related to this nice way of work, instead of configurations for applications. I have for example there a file called settings which includes simple bash variables of everything, I source it from my main tools so I want a most dynamic way of work, if I change a variable there, all my tools should be adapted directly. I can have too other files on this directory for other similar purposes of more specific tools, like I say, this dir is for my way of work settings/configurations.
  • .git | .gitignore : This is of course the git stuff, just note that i have added the hook setgitperms.perl in order to maintain permissions of my files, the commits and management of this git system is fully automatized so you don't need to worry about remember to run git commands, just think on it like a nice feature that you have in the background and that you can manage it at any time like switching branches etc (remember to disable the automatization when you do this, maybe ill add a checker for that in the future). There's also the .gitignore file which ignores vim swap files (*.swp), .DS_Store and *~ files.
  • Git/git/home_linked : There is everything that should be on reality in the home of the user, it is very easy to run a massive ln command that links everything there to the home of the user, the links should be relative on the way foo -> Git/git/home_linked/foo, used for things like .bash*, bin, .crontab, .gnupg, .gtk*, .subversion, .vim*, etc...
  • Git/git/patches : This is an example of any other kind of data that should be traced by git.

And now for the Data directory:

  • Data/home_linked : All the data that should be linked on the home of the user, like: Videos, Images, Music, .mozilla*, .Virtualbox, .local, etc...
  • Data/* : All the rest of the data that we don't want to see it on the home of the user, like: backups, debootstraps, ISOs, packages, repositories, tmp, www, etc...

How it Works

So our personal partition for all our data contains basically a directory called thana (our user), and a script, when we mount this disk by a first time on our Elive system, we run (from root) this script which creates our special thana user if not exists yet, it set this user with a very specific UID (for example 1783) where the idea is to have a unique UID for our user in any computer where will use our disk, without conflict with an existing UID. This script also does a lot of other setups like check if we have a sudo configuration for this user with full privileges and without ask for the password (we want to remove entirely the usage of the root user), and finally also adds a init script on this computer for mount our home partition to the system if we have this parameter on our grub configuration, there's the encryption password that is loaded on the boot of the system, etc...

When we boot our computer in mode to use our special home partition, the configurations of Git/git/etc_root are linked to their respective /etc locations, and the original configurations are moved to a backup file, which is restored when you shutdown the computer, the idea is to have the system perfectly clean of all our activity when we have finished our work, this is nice if you are using a friend's computer

We have a set of configurations (bash variables) which controls dinamically our scripts and home work mode, we have also a set of cronjobs that controls that everything is working fine, automatically (like commits to our history/branches features), and will tell us if anything goes wrong on the automations.

NOTE: This howto/page is not finished

TODO PAGE: FIXME

  • Include a TGZ with all the required files/tools:
    • /home/home_thana_creator_environment.sh
Note: See TracWiki for help on using the wiki.