Overview

Automounting usb flash drives

  1. Add a file automount.rules in /etc/udev/rules.d
  2. Put following lines in it:
ACTION=="add",KERNEL=="sdb*", RUN+="/usr/bin/pmount --sync --umask 000 %k"
ACTION=="remove", KERNEL=="sdb*", RUN+="/usr/bin/pumount %k"
  1. Reload the udev rules with:
udevadm control --reload-rules

MPD

With the following lines in /etc/mpd.conf the MPD will automatically scan plugged pendrive:

music_directory     "/media"
auto_update    "yes"

WiFi Access Point

First install the required software:

apt-get install hostapd dnsmasq

then create/edit the /etc/hostapd/hostapd.conf file:

interface=wlan0
driver=nl80211
ssid=drsMalina
channel=7
hw_mode=g

auth_algs=1
wpa=3
wpa_passphrase=veryStrongPassword
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

macaddr_acl=0
ignore_broadcast_ssid=0

Next, configure the dhcp server (/etc/dnsmasq.conf):

interface=wlan0
dhcp-range=192.168.1.2,192.168.1.50,12h

Set the ip of the new network interface (/etc/network/interfaces)

allow-hotplug wlan0
auto wlan0
iface wlan0 inet static
     address 192.168.1.1
     broadcast 192.168.1.255

Restart the dhcp server:

/etc/init.d/dnsmasq restart

and run the access point:

hostapd -d /etc/hostapd/hostapd.conf