How to mount a file created using dd command

I created an exact copy of a bootable USB drive using the dd command (which is an extremely cool tool by the way) using the following command:

dd if=/dev/sdb of=myFile.img

After that, to mount it, you can simply use the kpartx command, as follows:

=================================================

mkdir hobba

sudo kpartx -a myFile.img
sudo mount /dev/mapper/loop0p1 hobba -o loop,ro

=================================================

where loop0p1 is the first partition, loop0p2 will be the second partition, and so on.

Enjoy!

Source: GrGr on http://superuser.com/questions/117136/how-can-i-mount-a-partition-from-dd-created-image-of-a-block-device-e-g-hdd-u

Posted in Linux, Ubuntu | Tagged , , , | Leave a comment

How to reset your administrative user password in ubuntu

It’s useful in case you forget your password and unable to access your system.

All you have to do is:

  1. startup your machine and select the kernel that you use at the grub menu
  2. press e to start editing
  3. Find the line that starts with linux and change ro to rw and add init=/bin/bash then press ctrl+x
  4. You will directly enter the console as root, just type passwd and write your new one

That’s it, Enjoy!

Source: https://help.ubuntu.com/community/LostPassword

Posted in Linux, Mint, Ubuntu | Tagged , , , | Leave a comment

How to rebuild the cache for ownCloud

This can be done using the ownCloud Console (occ).

All you need is to go where the web app is, which is usually /var/www/owncloud and then run:

sudo -u www-data php occ  files:scan –all

This will rebuild the whole files cache. This is the solution for data that sometimes appear as existing on the filesystem, but actually they don’t and are just orphan entries in the DB.

Source: https://doc.owncloud.org/server/8.0/admin_manual/configuration_server/occ_command.html

Posted in Uncategorized | Leave a comment

Monitor Linux CPU Frequency in RealTime

watch grep \"cpu MHz\" /proc/cpuinfo

Source
Posted in Linux | Tagged , , | 1 Comment

How to change the Linux prompt

Sometimes the Linux prompt doesn’t look really attractive and/or practical, like for example bash:/ or sh:/ which is really annoying.

To solve this, you need to use the PS1 environment variable and append to it what you need:

  1. Go to your home directory and create a .profile file
  2. edit the .profile file and add the following: “PS1=’$USER@$HOSTNAME $PWD \$ ‘”, this will give you something like: “john@myserver /home/john: “

Source

Posted in Linux | Tagged , , | Leave a comment