How to fix unavailable swap problem after fresh installation of Ubuntu 14.04 with Home Encryption

This is a bug which makes the UUID unreadable in the /etc/crypttab and accordingly no swap will be read and used by the system, which is unacceptable of course.

In order to solve this problem, all you have to do is the following:

  1. Determine which partition is your swap partition: “sudo fdisk -l”, check the line that looks like this:
    /dev/sda6       617330688   625141759     3905536   82  Linux swap / Solariswhich means that “/dev/sda6” is your swap partition
  2. Take a backup of your /etc/crypttab file: “sudo cp /etc/crypttab /etc/crypttab.orig”
  3. Modify the /etc/crypttab file to replace the UUID with the old-style partition way, for example change from this:
    cryptswap1 UUID=32504c50-3336-42fa-813f-f412050ce2f7 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
    to this:
    cryptswap1 /dev/sda6 /dev/urandom swap,cipher=aes-cbc-essiv:sha256
  4. Save the file and restart
  5. Enjoy! 🙂

Source: http://ubuntuforums.org/showthread.php?t=2221067

Posted in Uncategorized | Tagged , , , , , , | 2 Comments

How to encrypt your home folder in Ubuntu or Linux Mint After Installation using ecryptfs

In case you want forgot to encrypt your home folder while installing Linux Mint or Ubuntu, it’s very easy to do that afterwards, and I’ll KISS, i.e. Keep It Simple & Stupid 🙂

  1. login normally at the login screen, let’s say the user you want to encrypt its home folder is called “hobba”
  2. Create a new administrative user, let’s call it “olla” for instance
  3. Now logout from “hobba” and login as “olla”
  4. Make sure the /home partition (if any) has enough free space, as ecryptfs takes a backup copy of all your files
  5. Run this command “sudo ecryptfs-migrate-home -u hobba”
  6. Preferably just enter the same login password you currently use for the user “hobba”. If not, you’ll have to change your user’s login password again.
  7. Wait till the command finishes execution
  8. You will see this information displayed, it is VERY IMPORTANT to follow point number 1, you can execute the others if you wish:
    ========================================================================
    Some Important Notes!

    1. The file encryption appears to have completed successfully, however,
    test MUST LOGIN IMMEDIATELY, _BEFORE_THE_NEXT_REBOOT_,
    TO COMPLETE THE MIGRATION!!!

    2. If test can log in and read and write their files, then the migration is complete,
    and you should remove /home/user.7y3X0vjM.
    Otherwise, restore /home/user.7y3X0vjM back to /home/test.

    3. user should also run ‘ecryptfs-unwrap-passphrase’ and record
    their randomly generated mount passphrase as soon as possible.

    4. To ensure the integrity of all encrypted data on this system, you
    should also encrypted swap space with ‘ecryptfs-setup-swap’.
    ========================================================================
  9. You’re done!
  10. Enjoy 🙂

Source: http://bodhizazen.net/Tutorials/Ecryptfs/#Home

Posted in Uncategorized | Tagged , , , , | 2 Comments

How to Upgrade your Ubuntu Server Release, The Recommended Way

It’s done using a command line utility called “do-release-upgrade”, it’s part of the update-manager-core package, so all you have to do is the following:

“sudo apt-get install update-manager-core”

“sudo do-release-upgrade”

That’s it, simply!

Source: https://help.ubuntu.com/12.04/serverguide/installing-upgrading.html

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Getting List of Users and Roles on Oracle DB

This is a simple SQL statement to get you a list of all users and their roles in the Oracle DB:

“SELECT * FROM DBA_role_privs;”

And if you want to get the list of users related to a specific role, you can simply modify the SQL statement to be like this:

“SELECT * FROM DBA_role_privs where GRANTED_ROLE=’SSE_ROLE’;”

Source: http://www.dbforums.com/oracle/1650816-how-get-list-all-users-their-roles.html

Posted in Uncategorized | Tagged , , , , , , , , | Leave a comment

Knowing when you should be concerned about your Linux CPU Load Average

This is one of the most important things to learn by any System Admin.; the CPU Load Average.

You can get the value simply by running the command “top” to get you the average value in the last 1 min, 5 min and 15 min.

How can you know whether that load average is high or not? That depends on the number of cores you have on your server, so for example, if you have 1 core, then a max. of load average value of 1 would be ok, although you should be a little concerned when it reaches about 0.7 (70%), if you have 2 cores, then 1.4 would be the max. accepted value …etc.

You can get to know the number of cores you have by the following command: “cat /proc/cpuinfo | grep “model name” | wc -l“, so for example if you have 8 cores, then a value of 5.6 (70%) is the max. accepted value, where you should start getting worried afterwards.

As a rule: “The “100% utilization” mark is 1.00 on a single-core system, 2.00, on a dual-core, 4.00 on a quad-core, etc.”, and you can start worrying above the 70% utilization.

 

Source: http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages

Posted in Uncategorized | Tagged , , , , | Leave a comment