Samba hide dot files

Setting up a Samba server at work using local users I found that when logging via windows the following files were displayed in the shared folder

.bash_history
.bash_logout
.bashrc
.profile
 Now there there is a possibility that these files can be deleted via the share which would impact the local ssh user. After searching I found that there is a variable that can be set in smb.conf by putting
hide dot files = yes
 in the [homes] section, however as I found out if you have windows set to ‘view hidden files’ this takes priority and the files are still shown.
 After much more searching I found the veto function, so adding
veto files = /.*/
to [homes] section results in the . (dot) files not being displayed. So my smb.conf [homes] looks like this
[homes]
comment = Home
Directories browseable = no
writable = yes
create mask = 0700
directory mask = 0700
valid users = %S
veto files = /.*/
Don’t forget to restart Samba after making the change.
Continue Reading

bash: /bin/rm: Argument list too long

I came across this error when trying to delete lots of files on Debian Squeeze. This error apparently occurs due to the reason that the system commands show limitations when a large number of arguments are fed into a single command.
 
so I created a bash script called bulkrm containing
 
for i in *; do
rm -f $i;
done
chmod +x bulkrm
../bulkrm
 
(WARNING THIS WILL DELETE ALL FILES IN THE FOLDER IT'S EXECUTED FROM SO USE
AT YOUR PERIL)
 
Continue Reading

NAS down! NAS down!

My home nas has decided to die for the second time, good job I keep a cold spare. I've swapped the drives over and the raid is currently rebuilding. I am now on my third shuttle so thinking I will replace it with a HP N54L Microserver and be done with it, just need to wait for one of their cashback offers to crop up then I'll buy one.
Continue Reading