Skip to content

Instantly share code, notes, and snippets.

@wilkart
wilkart / sendEmail.patch
Last active January 3, 2024 11:29
sendEmail.pl 1.56 patched to use TLS 1.2
67,68c67,68
< "tls_client" => 0, ## If TLS is supported by the client (us)
< "tls_server" => 0, ## If TLS is supported by the remote SMTP server
---
> "tls_client" => 1, ## If TLS is supported by the client (us)
> "tls_server" => 1, ## If TLS is supported by the remote SMTP server
1906c1906
< if (! IO::Socket::SSL->start_SSL($SERVER, SSL_version => 'SSLv3')) {
---
> if (! IO::Socket::SSL->start_SSL($SERVER, SSL_version => 'TLSv1_2', SSL_verify_mode => 0 )) {
@MaxChinni
MaxChinni / sectotime.sh
Last active September 15, 2015 11:25
bash number of seconds to human readable time
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage:" >&2
echo " $(basename $0) <sec>" >&2
exit 1
fi
function secToTime() {
local s=$1
@JakeWharton
JakeWharton / BaseActivity.java
Created July 6, 2012 01:17
Scoped event bus which automatically registers and unregisters with the lifecycle.
package com.squareup.example;
public abstract BaseActivity extends SherlockActivity {
private final ScopedBus scopedBus = new ScopedBus();
protected ScopedBus getBus() {
return scopedBus;
}
@Override public void onPause() {