Search

Loading...

Tuesday, February 24, 2015

Recover text files with `strings`

Open a terminal in the target folder:

strings target.doc > recovered.doc
 
change <.doc> as needed.


Monday, February 23, 2015

Virtual Box

Hosting Windows

  • Guest addins and extension pack has to be installed.
  • To be able to get access to an attached USB device we need to be in the vboxusers group. This can be done from Users and Groups after having installed the gnome-system-tools Install gnome-system-tools or from the command line by
    sudo usermod -aG vboxusers <username> 
    
    Reboot or logout/login for group membership to take effect.
  • Share a folder between the host and the guest - here -

1. Open VirtualBox, and with the Windows 7 virtual machine selected in the left side, click the 'General' button on the "Details" tab.

Review image

2. In the settings window that appears, click the "Shared Folders" entry (last one) and then click on the little folder icon with a + on it (on the right) to add a new shared folder...

Review image
Review image

3. A new dialog appears, called Add Share. Click the arrow on the "Folder Path" field and select 'Other.' Search for the folder you want to share with the Windows 7 virtual machine and click OK...

Review image

4. You will now see the full path to the folder you want to share and you can give it a name or just leave it as it is. Click OK to close the "Add Share" dialog...

Review image

5. You will now see the folder in the "Shared Folders" section. Click OK to close the settings dialog...

Review image

6. Now, start the Windows 7 virtual machine. When the system is fully loaded, open My Computer and click on the "Map network drive" button...

Review image

7. In the new window that appears, select a driver letter on the "Drive" field (any letter you want from the list), and... here is the big secret... type \\vboxsrv\ followed by the name of your shared folder, in the "Folder" field!

Also, don't forget to check the "Connect using different credentials" option either.

Review image

After this, click the "Finish" button and you will be prompted to insert the username and password of your Linux machine. Check the "Remember my credentials" option and click the OK button...

Review image

You can see your shared folder in the My Computer window, under the Network Location section... and it also shows how much space is left on the drive...

Review image

Saturday, February 21, 2015

How to enable the new right-corner username menu in Chromium

In Google Chrome in Windows the old user avatar icon was replaced with a name-menu in the right corner.
How to get that in Linux Chromium?
enter image description here enter image description here

chrome://flags/#enable-new-avatar-menu
Set to 'enabled' and restart.
There is also another feature: setting that to 'disabled' will show the Google account user image instead of the avatar, or that image will become available among the avatar images.

Mount partition at startup

After trying unsuccessfully many well voted solutions, the one that worked is this

In terminal to see the UUID number of the partition:

sudo blkid


and get something like this:


/dev/sda1: LABEL="Windows 10" UUID="4ADE68FCDE68E1A5" TYPE="ntfs"
/dev/sda2: LABEL="Depo-ntfs" UUID="0F0CB2371E36F1DB" TYPE="ntfs"
/dev/sda5: LABEL="Ubuntu" UUID="03a03b26-176c-4004-baa6-c541367b5095" TYPE="ext4"
/dev/sda6: UUID="fc9a8598-aed9-42fa-aadc-e5f8a8cb4717" TYPE="ext4"
/dev/sda7: LABEL="Mint" UUID="738cefdf-c180-41cd-90b6-9f963c94aead" TYPE="ext4"
/dev/sda8: UUID="511de639-15bd-4a99-bcb0-074353e86b13" TYPE="ext4" 

use gparted or something to find which is which, or type 'mount' after having mounted it to see the dev/sdX details about it.

Now go

gksudo gedit /etc/fstab

and add at the end something like

UUID=0F0CB2371E36F1DB  /media/WHATER_PARTITION_NAME ntfs rw,nosuid,nodev,noatime,allow_other 0 0

Replacing the UUID with the proper number and your partition name (the one that you see it in File Manager or as Flag in Gparted) - also instead ntfs other type if the case.

Install Megasync monochrome icons

May be reset after updates.

You need `git` installed
sudo apt-get install git
Then download from here or here. Download, extract, open terminal in that folder and follow this instructions
cd
git clone https://github.com/cybre/megasync-elementary.git
cd megasync-elementary
./install.sh

How to make apt:// urls to open with apturl?

sudo apt-get install apturl
Latest version of chromium already uses xdg-open for any x-scheme-handler links.To configure xdg-open with apturl , go through following steps:
Make sure they are all set correctly:
  • Hit Alt+F2
  • Enter gconf-editor
  • Navigate to the /desktop/gnome/url-handlers/apt/command, it should be set to apturl "%s"
In terminal:

xdg-mime default apturl.desktop x-scheme-handler/apt

Deleting all partitions when Gparted is stuck

Possible problem, here.

A longer discussion, here.

I noticed that "Disks" (`gnome-disk-utility', available in sources, default in Unity) was not only able to see the correct situation of the partitions, but also to create (backup) and restore disk images.


sudo apt-get install gnome-disk-utility

The command

 sudo dd if=/dev/zero of=/dev/sda bs=1M

 wipes the entire disk, not only the partition table. (tested)

To only wipe the partition table and Master Boot Record do

sudo dd if=/dev/zero of=/dev/sda bs=512 count=1



to see the progress of this, I opened a separate terminal window and did
watch -n5 'sudo kill -USR1 `pgrep ^dd`'
which every 5 secs reports the progress in the initial terminal window (source)
245423407104 bytes (245 GB) copied, 3430.82 s, 71.5 MB/s
234354+0 records in
234354+0 records out
245737979904 bytes (246 GB) copied, 3435.84 s, 71.5 MB/s
234655+0 records in
234655+0 records out
246053601280 bytes (246 GB) copied, 3440.88 s, 71.5 MB/s
234956+0 records in
234956+0 records out
246369222656 bytes (246 GB) copied, 3445.91 s, 71.5 MB/s

... it took 2 hours and thirty minutes for a 500GB HDD on a 4-year average laptop with 4GB ram.

After that use Gparted and create a new partition table and partition(s).