Category Archives: Linux

How to Stop your Synology NAS from Junking up your directories with @eaDir directories

If you start mounting Synology volumes over NFS, you will quickly learn that the Synology NAS drops directories cryptically named “@eaDir,” in every single subdirectory on your data volumes. 

They are hidden from Windows clients, but they are there.

The “@eaDir” directories are created for convenience by a system daemon, and they apparently contain image thumbnails or some such nonsense.  There is no easy or convenient way to turn them off or otherwise stop them from being created.

Getting rid of them takes some effort, and here is the easiest way – simply disable the system daemon.

Disable the Synology deamon the Creates the @eaDir directories

To stop the thumb service from creating the @eaDir directories, SSH into your NAS and stop the daemon.  This will keep new directories from being created until the next boot.

/usr/syno/bin/synomkthumb -stop

Next, to remove the service from starting up when rebooting, delete the script:

rm /usr/syno/etc.defaults/rc.d/

Removing the existing directories

SSH into your NAS and you can locate them by typing:

find /volume1/ -type d -name "@eaDir"

Finally, when you are feeling good, you can automatically search and delete them:

find . -type d -name "eaDir" -print0 | xargs -0 rm -rf

[Linux] How to Send E-MAIL (or SMS) Whenever a User Logs In

In the past, I’ve written about some of the con artist masquerading as consultants, which I’ve run into during my travels as a technical mercenary.

At one gig, a younger and inexperienced team lead was conflicted about canning a developer that wasn’t even showing up for work, but who claimed to be working remotely.

Of course, I checked the logs and he never logged in.

The team lead wanted more data, so I suggested that whenever the developer logs in, the lead would get an email.

“You can do that?”  the lead asked. 

Easy.  The solution is to add a few lines to the shell init script in the user’s home directory.  In a few minutes, it was done.

This is also a nice way to shoot yourself an SMS message via your cell phone companies email-SMS gateway when someone logs into one of your cloud instances.  It will give you an immediate notification if someone compromises a system.

In any event, the solution is extremely easy.

Put something similar to the following in the user’s .profile (csh):

mail << EOF
From: Linux System
subject: user login
user $LOGNAME has logged into `hostname`