Compile Android on Cordova

set ANDROID_HOME=C:\Program Files\Android\android-sdk-windows

set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

Open a command line window, and go to /path/to/your/project/platforms/android/cordova.

cordova build android –release, from top level directory

Check ant.properties for the keystore details..

Also keygeneration:

keytool -genkeypair -dname "cn=Mark Jones, ou=JavaSoft, o=Sun, c=US" -alias xyu.com -keypass kpxx135 -keystore xyu.keystore

Debian Install Packages behind Firewall

apt-get --print-uris install mysql-server -y

Will print out the URL for the package and dependancies;

'http://mirrordirector.raspbian.org/raspbian/pool/main/liba/libaio/libaio1_0.3.109-3_armhf.deb' libaio1_0.3.109-3_armhf.deb 8944 MD5Sum:ddc43710db3f102df9477a8a95f025ad
'http://mirrordirector.raspbian.org/raspbian/pool/main/m/mysql-5.5/mysql-server-core-5.5_5.5.40-0+wheezy1_armhf.deb' mysql-server-core-5.5_5.5.40-0+wheezy1_armhf.deb 3060608 MD5Sum:9a8f4620799fcceb4567433caad2434e
'http://mirrordirector.raspbian.org/raspbian/pool/main/m/mysql-5.5/mysql-server-5.5_5.5.40-0+wheezy1_armhf.deb' mysql-server-5.5_5.5.40-0+wheezy1_armhf.deb 1729934 MD5Sum:98fe33dd64039ba120d1aa77e0992fa7
'http://mirrordirector.raspbian.org/raspbian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5-2+deb7u1_armhf.deb' heirloom-mailx_12.5-2+deb7u1_armhf.deb 253508 MD5Sum:6155feba05b677f5f01eb5b53ae4ba2d
'http://mirrordirector.raspbian.org/raspbian/pool/main/libh/libhtml-template-perl/libhtml-template-perl_2.91-1_all.deb' libhtml-template-perl_2.91-1_all.deb 72020 MD5Sum:b25cc0a02e43fe4b5b46a01af3e98c4c
'http://mirrordirector.raspbian.org/raspbian/pool/main/m/mysql-5.5/mysql-server_5.5.40-0+wheezy1_all.deb' mysql-server_5.5.40-0+wheezy1_all.deb 73872 MD5Sum:b49873c3a32d33f6186e779202f6a87e

Cut out the URLs and put them into a file.

y=0;for x in `cat deps.txt`; do ssh username@192.168.8.111"wget -O - $x" >> $y.deb; y=$y+1; done

dpkg -i *.deb

Quick – Install Package on a Firewalled Server

On the firewalled/vpnd server;

1. find the package URL

apt-get –print-uris install dos2unix

2. wget over ssh from an internet bound server on the same network

ssh use@somehost ‘wget -O – http://mirrordirector.raspbian.org/raspbian/pool/main/d/dos2unix/dos2unix_6.0-1_armhf.deb’ >> dos2unix_6.0-1_armhf.deb

3. dpkg -i dos2unix_6.0-1_armhf.deb

Perl – Sending Email with NET::SMTP using username and password

First of all double check that Authen::SASL is an installed module.. If you are not getting emails this could be why – it doesnt provide an error that is understandable!

#!/usr/bin/perl
### ENSURE Authen::SASL is installed
use Net::SMTP;
use strict;
use warnings;

my $host= 'yourhostname';
my $username= "yourpop3username";
my $password = "yourpassword";

my $from = 'bob\@GOemail.com';
my $to = 'bob@here.co.uk';
my $DOMAIN = "somedomain.co.uk";

my $smtp = Net::SMTP->new($host, Hello =>$DOMAIN, Timeout => 60) or die "Failed to Open SMTP Connection : $!";
$smtp->auth($username, $password) or die "Failed to authenticate";

my $subject = "Build";
my $emailBody = "This is the body...\n BOB";

$smtp->mail("$from"); ## FROM
$smtp->to("$to");
$smtp->data();
$smtp->datasend("To: $to\n");
$smtp->datasend("From: $from \n");
$smtp->datasend("Subject: $subject \n");
$smtp->datasend("\n");
$smtp->datasend("$emailBody:\n");
$smtp->datasend("\n");
$smtp->dataend();
$smtp->quit;

These links were useful also:

http://quark.humbug.org.au/publications/perl/perlsmtpintro.html

http://www.perlmonks.org/?node_id=449583

http://search.cpan.org/~shay/libnet-1.27/Net/SMTP.pm

Fix Open Postfix Relay – Unauthenticated Email

If your mail server is left open, anyone can use your SMTP service to send mail, and spammers will use it. This can result in your server being blacklisted and extraneous use of system resources that neither benefit you nor your users.

Postfix logoTo secure Postfix, there are a number of functions you can add the configuration file /etc/mail/main.cf. Edit the file and add the following lines:


smtpd_helo_required = yes
smtpd_delay_reject = no
disable_vrfy_command = yes

smtpd_helo_restrictions = permit_mynetworks,reject_invalid_hostname,reject_unknown_hostname,reject_non_fqdn_hostname

This will force incoming requests to pause and identify themselves before proceeding, and will allow properly authenticated users to pass through and send mail. To finish, save the file and restart Postfix:

/etc/init.d/postfix restart