#!/bin/bash
#
# "tagdirs.sh"
#
# Simple script which iterates over the first level folders in a given directory,
# and tags the files in those subdirectories with the parent folder's name.
#
# Usage: ./tagdirs.sh
#
# N.B. Requires 'tracker-tag'.
#
# The folder to iterate over.
FOLDER=$1
# Check param is a directory...
if [ -d "${1}" ] ; then
echo "Processing directory '${1}'..."
else
echo "Error: bad argument. Expected a valid directory name for the first argument"
echo "Bad directory name = ${1}"
exit 1
fi
(
IFS=$'\n'
# For each directory...
for dir in $(find $FOLDER -maxdepth 1 -mindepth 1 -type d); do
# Strip directory to folder name only...
tag=${dir##*/}
# For each file in the directory...
for file in $(find $dir -maxdepth 1 -mindepth 1 -type f); do
echo "Adding tag '${tag}' to file '${file}'...";
tracker-tag --add="${tag}" "${file}"
done
done
)
exit 0
Tuesday, August 23, 2011
Linux > tag files in a directory by directory name
Work in progress...
Monday, August 22, 2011
Stream content from Ubuntu to an Xbox360
Problem
I wanted to setup Ubuntu (11.04), so that I could access content from an Xbox360 using DLNA
Solution
See also:
http://live.gnome.org/Rygel
http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance
I wanted to setup Ubuntu (11.04), so that I could access content from an Xbox360 using DLNA
Solution
- Open "Ubuntu Software Center" and install "rygel"
- Also install the additional "Tracker plugin" (only)
- Follow the steps under Helper Scripts (requires sqlite3)
See also:
http://live.gnome.org/Rygel
http://en.wikipedia.org/wiki/Digital_Living_Network_Alliance
Installing Netgear WG311v3 Wireless Network Card on Ubuntu 11.04 amd64
Problem
The Netgear WG311v3 Wireless Network Card driver isn't automatically installed by Ubuntu 11.04.
Solution
See also:
https://help.ubuntu.com/community/WifiDocs/Device/Netgear_WG311_v3
The Netgear WG311v3 Wireless Network Card driver isn't automatically installed by Ubuntu 11.04.
Solution
- Download and extract the custom driver from the following website.
- Open "Ubuntu Software Center" and install "ndiswrapper" (i.e. Windows Wireless Drivers)
- Open "Windows Wireless Drivers", and install the "WG311v3.INF" driver.
- Save and close.
See also:
https://help.ubuntu.com/community/WifiDocs/Device/Netgear_WG311_v3
Subscribe to:
Posts (Atom)