Thursday, March 22, 2012

Android: Prevent Media Scanning of Specific Folders.

After years of owning an Android based phone, my media collection has grown significantly. But something that has always bothered me is ALL visual media is displayed in the gallery, and generally they are items I don't care to see cluttering up my gallery view. Such as album artwork from my mp3 collection, or other graphic images used by other apps on the phone. After doing some research on the Android OS I've found two fix's that work nicely depending on your needs.

Option 1: ".nomedia" file
I like this option for basic stuff like hiding the graphics used by my Battlefield Bad Company Stats app. The downloaded graphics will be hidden from the media scanner but the folders are still visible from the file browser.
  1. Create a nomedia.txt file on a local computer. ( The file does not need to be created on a local computer and could be created within the Android system itself using a file editor, this is just the method I used.)
  2. Copy the newly created file to the directory you would like to "hide" from the media scanner.
  3. On the android system, browse to the directory where you copied your nomedia.txt file.
  4. Long press the nomedia.txt file until you get the context menu.
  5. Select rename
  6. Change the name of the file to ".nomedia"
  7. The directory is now exempt from media scans and will not show in the gallery.
Option 2: Prefixing a directory.
This option is adds a bit more security, by marking the directory as hidden. to achieve this follow the directions below.
  1. Use the My Files or any other file browser and go to the root location of the directory you wish to mark as hidden.
  2. Long press the desired folder until you get the context menu.
  3. Select rename
  4. add a '.' to the beginning of the folder name.
  5. The folder will now be hidden and is exempt from the media scans, therefor not seen by the Gallery.
Quick Note About Security.
Although Option 2 will hide the directory from the media scanner and any non-root file manager, with "Show Hidden Directories" turned off. the data is still accessible by any user of your phone and will be visible and there for browse-able by graphical means.

Or keep it REALLY simple with F-Stop Media Gallery

https://play.google.com/store/apps/details?id=com.fstop.photo

Friday, April 30, 2010

Please vote for Frederick, MD @ http://www.googlefiber.com/fiber-optics/

Friday, April 23, 2010

Untangle PXE forwarding

By: Jason Bird

Untangle Website: http://www.untangle.com/

If your using Untangle multi-function firewall and want to also have a pxe boot follow the instructions below.

  1. Login to your Untangle server.
  2. Click the Config tab to the top left.
  3. Click the Networking button on the left side of the screen.
  4. Click down caret next to the advanced button on the top right of your screen.
  5. From the menu select dhcp & dns.
  6. Make sure the enable check box is checked.
  7. Enter the code below and replace x.x.x.x with your PXE server's IP address.
dhcp-boot=pxelinux.0,,x.x.x.x

Hope this helps.

Thursday, April 22, 2010

NFS Media Center Sharing

By: Jason Bird

http://jasonbirdstech.blogspot.com/


Before we begin:


I am assuming a few things about your system/network in this how-to that I personal feel offers a cleaner more stable network setup that will eliminate possible performance and connectivity issues down the road.


  1. This guide is write for a Ubuntu server/desktop setup. The same concepts apply to other distributions but your package manager may be different.

  2. I'm assuming your file server has a static IP address, since your file server is a server I find it best to remove a margin of error by always setting IP address for servers to static even in a home network.

  3. I'm assuming your Media Centers also have a static IP addresses, since I view Media Center in the same category as servers/ network appliances I feel it offers a more organized network by having them static. This way the Media Center always knows where the File Server is and the File Server always knows where the Media Center is coming from, Especial in a network that has multiple Media Centers.

  4. Since multiple Media Center are becoming more popular this How-To will setup the server to grant two Dedicated Media Centers access to it shares. If you have more just continue the network architecture to satisfy your needs.

  5. The File Server has a Folder in its root that houses the data. We will be using the root path /Media01

  6. We will setup the shares with full access to the following user for simplicity sake this will ensure read/write access from Media Center to File Server. The user in this How-To is mcuser

  7. My editor of choice in this How-To is pico since its simple to use and very light weight, however feel free to use any editor you like.


The Setup:

The table below lays out the systems we are using in this example, with their host name, a brief description and the static IP address being assigned to that machine.


Host Name

Description

IP Address

FS01

File Server: This is going to serve files to the Media Centers

192.168.10.1

MC01

Media Center: This is the first Media Center in our setup. For all intensive purposes we can assume these have the same setup.

192.168.20.100

MC02

Media Center: This is the first Media Center in our setup. For all intensive purposes we can assume these have the same setup.

192.168.20.101


Create the File system architecture

The first thing we want to do is create the File Server's architecture. This is going to be the organizational back bone to our file server. All data files that are to be accessed from outside the server should be located here.



mkdir -p /Media01/home/public/

cd /Media01/home/public

mkdir video

mkdir mp3

mkdir pictures



NFS Server Setup


Install Needed Packages

Copy and past the command below to install the NFS file server


sudo apt-get install nfs-kernel-server


Exporting Shares:

On the file server you must export each directory or directories you want to share, and what hosts can access them. Use the following command to open the exports file for editing


sudo pico /etc/exports


Append this the following lines to /etc/exports:


#MC01 Shares

/fs01/home/public/video 192.168.20.100(rw,sync,no_subtree_check)

/fs01/home/public/mp3 192.168.20.100(rw,sync,no_subtree_check)

/fs01/home/public/pictures 192.168.20.100(rw,sync,no_subtree_check)


#MC02 Shares

/fs01/home/public/video 192.168.20.101(rw,sync,no_subtree_check)

/fs01/home/public/mp3 192.168.20.101(rw,sync,no_subtree_check)

/fs01/home/public/pictures 192.168.20.101(rw,sync,no_subtree_check)




Adding individual exports for one or two Media Centers works fine, but if you have more this can become cumbersome. To setup your exports file to allow an entire IP range you will use the following


#Global Media Center Share

/fs01/home/public/video 192.168.20.100/255.255.255.0(rw,sync,no_subtree_check)


What the above will do is grant all computers with the 192.168.20.100-192.168.20.255 I doubt you will have 155 Media Centers running and if you did I doubt you will have need for this hot-to



Now run the following to ensure the exports have applied.


sudo exportfs -ra


This is about all it takes to setup a functional well organized back-end for your Media Center network now lets move on to the client side.


Client Setup


On both Media Centers install the base files needed to access the file server and mount the files shares exported in the previous section.


Run the following to install the nfs client packages


sudo apt-get install nfs-common


After the nfs-common package installs with all its dependencies it is time to setup the Media Centers architecture. Since the home directory of mcuser on both media center already have a Video, Pictures, and Music directories we will use those to mount the NFS shares.


Use the following to open your fstab file

sudo pico /etc/fstab


append the following to the bottom of your fstab file.


#NFS

192.168.10.1:/fs01/home/public/video /home/mcuser/Videos nfs timeo=14,intr

192.168.10.1:/fs01/home/public/mp3 /home/mcuser/Music nfs timeo=14,intr

192.168.10.1:/fs01/home/public/pictures /home/mcuser/Pictures nfs timeo=14,intr


Now that we setup the shares in fstab its time to see if we did everything right.


At the command prompt enter the following to reprocess the fstab file.


sudo mount -a


if all went well you should be dropped back into the command prompt and on the desktop of mcuser you should see the tree shares you created. The nice thing about this setup is, since we are using the same user that has read/write access to the system we wont have to worry about permissions and can treat the shares as local directories.


The next step is to repeat the client setup on every Media Center in your network. If you are using Moovida then it will automatically start scanning the Videos, Pictures, Music folders of mcuser once it is reloaded. If your using XBMC you will need to setup the shares manually.


Suggestions:

  • Since this is a Media Center you should expect to be transferring significant amounts of data across the wire. I suggest having a 1 Gigabyte backbone to connect the two even better would be to round robin your file server preventing overloading a single nic but this is for another how-to and will not be covered here. Keep in mind though depending on your file server hardware your hard drives may not be able to access the data as fast as your network can send it. So try and get the fastest drives you can with in your budget.


Trouble Shooting tips:


  • If after running “sudo mount -a” you get a permission denied by server check the server log most times this happens is a error in the exports file or the client trying to access the server was set through dhcp.



Welcome to my blog!

Welcome to Jason Birds Tech Note's

Here you will find howto's on computer related information for home and enterprise applications.