sabato 31 maggio 2014

Android device with no touch screen access solution.

I had a smartphone with a broken touch screen, I wanted to backup images and contacts but had no way to access phone because I could not interact with the smartphone.
Could not unlock, could not mount it as a drive on my computer.

So I bought an adapter like this:

It converts your micro usb port on your phone to a common usb port.
Connect a mouse to it and you will be able to control your phone with the mouse.
Imagine the arrow as if it was you finger.
Now connect to wifi, on you computer share a folder with guest permissions and copy all you need on it.

giovedì 29 maggio 2014

NFS setup and Mount as Vmware datastorage

NFSv4 quick start

Providing you understand what you are doing, use this brief walk-through to set up an NFSv4 server on Ubuntu (with no authentication security). Then mount the share on an Ubuntu client. It has been tested on Ubuntu 10.04 Lucid Lynx.

NFSv4 server

Install the required packages...
  • # apt-get install nfs-kernel-server 
NFSv4 exports exist in a single pseudo filesystem, where the real directories are mounted with the --bind option.
  • Let's say we want to export our users' home directories in /home/users. First we create the export filesystem: 
    # mkdir -p /export/users 
  • It's important that /export and /export/users have 777 permissions as we will be accessing the NFS share from the client without LDAP/NIS authentication. This will not apply if using authentication (see below). Now mount the real users directory with:
    # mount --bind /home/users /export/users
  • To save us from retyping this after every reboot we add the following
    line to /etc/fstab
    /home/users    /export/users   none    bind  0  0
There are three configuration files that relate to an NFSv4 server: /etc/default/nfs-kernel-server, /etc/default/nfs-common and /etc/exports.
  • Those config files in our example would look like this:
    In /etc/default/nfs-kernel-server we set:
    NEED_SVCGSSD=no # no is default
  • because we are not activating NFSv4 security this time.

    For Ubuntu 11.10 and earlier, we set the following in /etc/default/nfs-common to get UID/GID mappings from names:
    NEED_IDMAPD=yes # only needed for Ubuntu 11.10 and earlier
In order for the ID names to be automatically mapped, both the client and server require the /etc/idmapd.conf file to have the same contents with the correct domain names. Furthermore, this file should have the following lines in the Mapping section:
  • [Mapping]
    Nobody-User = nobody
    Nobody-Group = nogroup

    However, the client may have different requirements for the Nobody-User and Nobody-Group. For example on RedHat variants, it's nfsnobody for both. cat /etc/passwd and cat /etc/group should show the "nobody" accounts.
This way, server and client do not need the users to share same UID/GUID.

For those who use LDAP-based authentication, add the following lines to your client's idmapd.conf:

Method = nsswitch
This will cause idmapd to know to look at nsswitch.conf to determine where it should look for credential information (and if you have LDAP authentication already working, nsswitch shouldn't require further explanation).
To export our directories to a local network we add the following two lines to /etc/exports
Last part launch:
exportfs -a
Now connecto to with the vsphere client. Click on host and then on configuration.
Click on staorage (left side) and then click on Add storage.

now select network File system and then click on next:

insert NFS server IP address. The shared folder name (/export/users) and give the
datastorage a name. Click next.
Click on finish.
New datastorage appears.

That's it.