Samba Sharing in XBMCbuntu

Posted: October 4th, 2012 | Author: | Filed under: Linux, XBMC | Tags: , , , , | 4 Comments »

Samba is not included with XBMCbuntu (at least in 11.10), so first we have to install it:

sudo apt-get install samba

Open Samba’s configuration file in an editor

sudo nano /etc/samba/smb.conf

Scroll down to the bottom of the file and add the following sections, which will create a public share with read/write access without password validation:

[global]
workgroup = Workgroup
netbios name = XBMC
server string = XBMC Server
log file = /var/log/samba/log.%m
max log size = 50
map to guest = bad user
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
dns proxy = no
[public]
path = /media
public = yes
only guest = yes
writable = yes
force user = xbmc

The above configuration example shares everything under the /media directory in a folder called “public”. The “force user” property must be set to a user with write access to the directory being shared. All files and directories will appear to have been created by this user.
Run “testparm” to check if your Samba configuration is parseable. For configuration changes to take effect, the Samba daemon can be restarted with

sudo /etc/init.d/smbd restart

The following screenshot shows my XBMC box sharing the /media directory which contains mount points for two harddrives (ingeniously named according to their capacities…):


Linux Commands

Posted: December 30th, 2011 | Author: | Filed under: Linux | Tags: , , , | No Comments »

find

Find all files from current directory and subdirectories

find . -name ‘*.doc’ -print

Result

report.doc
somedoc.doc

Finding files by date: http://www.cyberciti.biz/faq/howto-finding-files-by-date/

du

Show total disk usage of a directory:

du -sh /tmp/somedir

Starting, restarting and stopping daemons in Linux

Posted: January 16th, 2011 | Author: | Filed under: Linux, QNap | Tags: , , , , | No Comments »

Daemon services, or just daemons, are started at boot time. They are roughly equivalent to services in the Windows world.
To see which daemons are available on a system, do an

ls -l /etc/init.d/

Every script in that directory represents a daemon, which can be started, restarted and stopped manually using the following syntax:

/etc/init.d/<daemon name> start | restart | stop

If, for example, I wanted to restart an nzb-get daemon due to changes in its configuration files, I would type

/etc/init.d/nzb-get.sh restart

After issuing the command, the daemon will usually print some lines to the terminal indicating what it is doing, e.g.: ”Starting NZB-Get Daemon” or “Shutting Down“.

If you want to make sure whether a daemon is running or not, you can grep for its name in the list of running processes. If I wanted to see if the nzb-get daemon was really started, I could do the following grep:

ps -aux | grep nzb

If the daemon is running, this will produce a result like:

8148 admin 2456 S /opt/bin/nzbget –daemon
8355 admin 564 S grep nzb

The first line is the daemon. Notice the “–daemon” at the end of the line. The second line is the grep process we just ran to find the daemon.