Thursday, April 14, 2011

Setting up dropbox with encryption on ubuntu.

Firstly install drop box: https://www.dropbox.com/install

Now we need to install the encfs.

#apt-get install -y encfs

Now to create an encrypted drive:

#encfs ~/Dropbox/data.encrypt ~/data
Creating new encrypted volume.
Please choose from one of the following options:
enter "x" for expert configuration mode,
enter "p" for pre-configured paranoia mode,
anything else, or an empty line will select standard mode.
?>
Standard configuration selected.

Configuration finished. The filesystem to be created has
the following properties:
Filesystem cipher: "ssl/aes", version 2:2:1
Filename encoding: "nameio/block", version 3:0:1
Key Size: 192 bits
Block Size: 1024 bytes
Each file contains 8 byte header with unique IV data.
Filenames encoded using IV chaining mode.
File holes passed through to ciphertext.

Now you will need to enter a password for your filesystem.
You will need to remember this password, as there is absolutely
no recovery mechanism. However, the password can be changed
later using encfsctl.

New Encfs Password:
Verify Encfs Password:

Now that we have setup the encrypted folder we need to tell Dropbox to not sync the drive settings.

#dropbox exclude add ~/Dropbox/data.encrypt/.encfs6.xml
Excluded:
~/Dropbox/data.encrypt/.encfs6.xml

Now to get this to mount when you login. First install libpam-encfs:

#apt-get install libpam-encfs

Edit /etc/fuse.conf and add:
user_allow_other

Edit /etc/security/pam_encfs.conf
drop_permissions
encfs_default
* /home/$USER/Dropbox/data.encrypt /home/$USER/data -v allow_other

Edit /etc/pam.d/common-auth to look like:
auth sufficient pam_encfs.so
auth [success=2 default=ignore] pam_unix.so nullok_secure use_first_pass
auth [success=1 default=ignore] pam_winbind.so krb5_auth krb5_ccache_type=FILE cached_login try_first_pass
auth requisite pam_deny.so
auth required pam_permit.so

And your done, Enjoy.

Tuesday, August 31, 2010

Zabbix SMS queuing.

I had a problem with the sms program we use just dropping sms's if you tried to send too many at one time.

I'm using the following script in zabbix to interface with gammu the sms tool.
#!/usr/bin/env bash

LOCKFILE=/tmp/sms.lock
LOCKED="false"

echo "waiting for lock" |logger -t "sms" -i -p local3.info
while [ "${LOCKED}" = "false" ]
do
if [ ! -f ${LOCKFILE} ]; then
echo "$$" > ${LOCKFILE}
fi
if [ "$$" = "`cat ${LOCKFILE}`" ]; then
LOCKED="true"
fi
done
echo "got lock." |logger -t "sms" -i -p local3.info

trap "{ rm -f $LOCKFILE ; exit 255; }" EXIT
echo "sending sms to: $1" |logger -t "sms" -i -p local3.info
echo "$2 $3 $4 $5 $6 $7 $8 $9" | /usr/bin/gammu sendsms TEXT $1 > /dev/null 2>&1

exit 0
Maybe someone else will find this useful.

Monday, January 26, 2009

Installing app_txfax on Trixbox 2.6.2 for Noojeefax aka Asterfax


When compiling the noojeefax app_txfax.c under agx-ast-addons you will need to make the following changes to app_txfax.c:
@@ -14,6 +14,9 @@
 /*** MODULEINFO
          spandsp
 ***/
+
+#define _SPANDSP_PLC_H_
+

 #include "asterisk.h"

@@ -38,6 +41,10 @@
 #include "asterisk/translate.h"
 #include "asterisk/manager.h"

+#ifndef AST_MODULE
+#define AST_MODULE "app_rxfax"
+#endif
+
 static char *app = "TxFAX";

 static char *synopsis = "Send a FAX file";
@@ -334,7 +341,7 @@
         // We are in simulation mode
         ast_log(LOG_DEBUG, "Sending UserEventFaxTransmitted");
         manager_event(EVENT_FLAG_CALL,
-                "UserEventFaxTransmitted", "Channel: %s\r\nUniqueid: %s\r\nExecResult: %d\r\nTransmissionResult: %d\r\nRemoteStationID: %s\r\nLocalStationID: %s\r\nPagesTransferred: %i\r\nResolution: %i\r\nTransferRate: %i\r\nFileName: %s\r\n",
+                "UserEventFaxTransmitted", "Channel: %s\r\nUniqueid: %s\r\nExecResult: %d\r\nTransmissionResult: %d\r\nRemoteStationID: %s\r\nLocalStationID: %i\r\nPagesTransferred: %i\r\nResolution: %i\r\nTransferRate: %i\r\nFileName: %s\r\n",
                 chan->name,
                 chan->uniqueid,
                 res,