Skip to content

Instantly share code, notes, and snippets.

tekbird

Block or report user

Report or block tekbird

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tekbird
tekbird / s3copy.sh
Created Feb 8, 2016
Use this gist to copy an object from one bucket to another from bash
View s3copy.sh
s3key=your key
s3secret=your secret
function putS3
{
object=$1
sourceBucket='bucket'
destinationBucket='bucket'
date=$(date +"%a, %d %b %Y %T %z")
@tekbird
tekbird / server.java
Last active Nov 14, 2018
java ssl socket server
View server.java
public static void main(String[] args) throws IOException {
System.setProperty("javax.net.ssl.keyStore", "C:\\path\\to\\keystore\\store.jks");
System.setProperty("javax.net.ssl.keyStorePassword", "Password1");
SSLServerSocketFactory ssf = (SSLServerSocketFactory) SSLServerSocketFactory.getDefault();
ServerSocket ss = ssf.createServerSocket(7000);
System.out.println("started");
while (true) {
Socket s = ss.accept();
System.out.println("connected");
InputStreamReader reader = new InputStreamReader(s.getInputStream());
View client.java
static final String alphabet = "0123456789ABCDE";
public static void main(String[] args) throws UnknownHostException, IOException {
System.setProperty("javax.net.ssl.trustStore", "C:\\path\\to\\java\\truststore.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "Password1");
SSLSocketFactory factory = (SSLSocketFactory) SSLSocketFactory.getDefault();
SSLSocket sslsocket = (SSLSocket) factory.createSocket("127.0.0.1", 7000);
OutputStreamWriter writer = new OutputStreamWriter(sslsocket.getOutputStream(), "UTF-8");
char[] buffer = new char[9];
Random r = new Random();
You can’t perform that action at this time.