Saturday, December 15, 2012

How to send email from command line using Gmail (or any other provider)

If you want to send email from command line using a Gmail account (or any other provider), you can use SendEmail.

SendEmail is a lightweight, completely command line based, SMTP email agent. It was designed to be used in bash scripts, Perl programs, and web sites, but it is also quite useful in many other contexts. SendEmail is written in Perl.

1) Install SendEmail
 In debian 
#apt-get install libio-socket-ssl-perl libnet-ssleay-perl perl
#apt-get install sendemail

For other distributions:
Refer to the official site http://caspian.dotconf.net/menu/Software/SendEmail/


2) Run it
Here is an example:
sendEmail -f user@gmail.com -t myfriend@gmail.com \
-u "this is the test subject" -m "this is a test message" \
-s "smtp.gmail.com" \
-o tls=yes \
-xu user -xp password



3) Problems
If you get the following error:
"invalid SSL_version specified at /usr/share/perl5/IO/Socket/SSL.pm line 332"

It is a known bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679911

A temporary workaround is to edit the file /usr/bin/sendemail on line 1907 by changing 'SSLv3 TLSv1'in  to 'SSLv3',


1903     ## Start TLS if possible
1904     if ($conf{'tls_server'} == 1 and $conf{'tls_client'} == 1 and $opt{'tls'} =~ /^(yes|auto)$/) {
1905         printmsg("DEBUG => Starting TLS", 2);
1906         if (SMTPchat('STARTTLS')) { quit($conf{'error'}, 1); }
1907         if (! IO::Socket::SSL->start_SSL($SERVER, SSL_version => 'SSLv3 TLSv1')) {
1908             quit("ERROR => TLS setup failed: " . IO::Socket::SSL::errstr(), 1);
1909         }
1910         printmsg("DEBUG => TLS: Using cipher: ". $SERVER->get_cipher(), 3);
1911         printmsg("DEBUG => TLS session initialized :)", 1);
1912 
1913         ## Restart our SMTP session
1914         if (SMTPchat('EHLO ' . $opt{'fqdn'})) { quit($conf{'error'}, 1); }
1915     }
1916     elsif ($opt{'tls'} eq 'yes' and $conf{'tls_server'} == 0) {
1917         quit("ERROR => TLS not possible! Remote SMTP server, $conf{'server'},  does not support it.", 1);
1918     }


Saturday, November 24, 2012

How to launch Raspberry Pi GUI from SSH connection

To launch Raspberry Pi GUI from a SSH connection on windows:

- First ensure you have an X server running in Windows. Me I'm using Xming.
- Then create a SSH connection with X forwarding. If you need help with this point, check this site.
- Once connected, launch the GUI with lxsession command.

Sunday, October 21, 2012

PuTTy Fatal Error - Network error: Software caused connection abort [SOLVED]

In order to prevent this error after some time of inactivity you can do the following:

PuTTy Fatal Error - Network error - Software caused connection abort



1- Open Putty and go to "Connection".




















2- Change the "Seconds between keepalives" to a number higher than zero. 120 should be good.




















3- Now go to Session and save as "Default Settings"





















4- Done! Now every time you launch a SSH session with Putty, these settings will be used.


Comments welcomed!

Wednesday, October 3, 2012

-bash: tshark: command not found [SOLVED]

You have installed wireshark but when trying to run the CLI version, tshark, you get:

-bash: tshark: command not found

1) Make sure tshark is there

$ locate tshark
      /usr/sbin/tshark
      /usr/share/man/man1/tshark.1.gz
      /usr/share/wireshark/tshark.html

2) You need to be root
$ su -
$ tshark


If you would like a tutorial about tshark, let me know posting a comment.

Monday, June 11, 2012

Best torrent searcher for US TV Shows

The best torrent searcher for US TV shows is:

http://eztv.it/


How to delete a blog on blogger

In your blogger acount homepage, click over the blog you want to delete.

Then click on "Settings" > "Other" > "Delete blog"


Unable to resolve target 'android-x' - Android SDK Error

If you get one of these errors:
Unable to resolve target 'android-1'
Unable to resolve target 'android-2'
Unable to resolve target 'android-3'
Unable to resolve target 'android-4'
Unable to resolve target 'android-5'
Unable to resolve target 'android-6'
Unable to resolve target 'android-7'
Unable to resolve target 'android-8'
Unable to resolve target 'android-9'
Unable to resolve target 'android-10'
Unable to resolve target 'android-11'
Unable to resolve target 'android-12'
Unable to resolve target 'android-13'
Unable to resolve target 'android-14'
Unable to resolve target 'android-15'

Reason

Could not find the proper Android SDK version. If the android SDK is installed correctly the problem is that the platform SDK requested by the "default.properties" is not installed. For example:

Unable to resolve target 'android-1' - (Android 1.0) change the "default.properties"
Unable to resolve target 'android-2' - (Android 1.1) change the "default.properties"
Unable to resolve target 'android-3' - install SDK Platform Android 1.5
Unable to resolve target 'android-4' - install SDK Platform Android 1.6
Unable to resolve target 'android-5' - install SDK Platform Android 2.0
Unable to resolve target 'android-6' - install SDK Platform Android 2.0.1
Unable to resolve target 'android-7' - install SDK Platform Android 2.1
Unable to resolve target 'android-8' - install SDK Platform Android 2.2
Unable to resolve target 'android-9' - install SDK Platform Android 2.3
Unable to resolve target 'android-10' - install SDK Platform Android 2.3.3
Unable to resolve target 'android-11' - install SDK Platform Android 3.0
Unable to resolve target 'android-12' - install SDK Platform Android 3.1
Unable to resolve target 'android-13' - install SDK Platform Android 3.2
Unable to resolve target 'android-14' - install SDK Platform Android 4.0
Unable to resolve target 'android-15' - install SDK Platform Android 4.0.3


Solution:
To install the missing SDK, using Eclipse:

- Click on "Windows" > "Android SDK Manager"
- Choose the missing packages and install them.









Source: Sagi's Tech