Skip to content

Instantly share code, notes, and snippets.

View AudriusButkevicius's full-sized avatar

Audrius Butkevicius AudriusButkevicius

View GitHub Profile
@AudriusButkevicius
AudriusButkevicius / gist:ae7b2a818ce4d7f6213c
Created August 24, 2014 17:26
MahApps.Metro C# UI blocking
public partial class MainWindow : MetroWindow
{
public MainWindow()
{
InitializeComponent();
RegisterHandlers();
this.Loaded += WindowLoaded;
}
void WindowLoaded(object sender, RoutedEventArgs e)
@AudriusButkevicius
AudriusButkevicius / go-windows-symlinks.go
Created November 3, 2014 00:26
Symlinks in Windows - check, read, create - golang
Audrius@Audrius syncthing $ git reset --hard HEAD
HEAD is now at fc0cb70 Merge pull request #1523 from calmh/vv
Audrius@Audrius syncthing $ cat Godeps/Godeps.json | grep -A1 protocol
"ImportPath": "github.com/syncthing/protocol",
"Rev": "f9132cae85dcda1caba2f4ba78996d348b00ac6c"
Audrius@Audrius syncthing $ godep save ./cmd/...
Audrius@Audrius syncthing $ git --git-dir ../protocol/.git/ show -1
commit 6277c0595c18d42e9db75dfe900463ef093a82d2
Merge: 5750443 aa9eda1
Author: Jakob Borg <jakob@nym.se>
21:50:34 INFO: File "0-A\1-Ä" has UTF8 encoding conflict with another file; ignoring.
21:50:34 INFO: Normalized UTF8 encoding of file name "0-A\3-Ã".
21:50:34 INFO: File "1-Ä" has UTF8 encoding conflict with another file; ignoring.
21:50:34 INFO: File "1-Ä\1-Ä" has UTF8 encoding conflict with another file; ignoring.
21:50:34 INFO: Normalized UTF8 encoding of file name "1-Ä\3-Ã".
21:50:34 INFO: File "2-Å\1-Ä" has UTF8 encoding conflict with another file; ignoring.
21:50:34 INFO: Normalized UTF8 encoding of file name "2-Å\3-Ã".
21:50:34 INFO: Normalized UTF8 encoding of file name "3-Ã".
21:50:34 INFO: File "4-☕\1-Ä" has UTF8 encoding conflict with another file; ignoring.
21:50:34 INFO: Normalized UTF8 encoding of file name "4-☕\3-Ã".
@AudriusButkevicius
AudriusButkevicius / gist:c53c613c593a247ad695
Created June 22, 2015 11:07
TLS proxy example with both ends being clients
package main
import(
"fmt"
"net"
"path/filepath"
"crypto/tls"
"time"
"sync"
)
root@audrius:~/gohome/src/github.com/syncthing/syncthing/test# go test -v -tags "integration b
=== RUN TestBenchmarkTransferLargeFile2G
2016/02/04 14:30:25 Cleaning...
2016/02/04 14:30:25 Generating files...
2016/02/04 14:33:53 Total 2048.0 MiB in 1 files
2016/02/04 14:33:53 Starting instance 1...
2016/02/04 14:33:54 Starting instance 2...
2016/02/04 14:33:54 {6 2016-02-04 14:29:26.929296081 -0500 EST StateChanged map[folder:default
2016/02/04 14:33:54 {9 2016-02-04 14:29:26.932481087 -0500 EST StateChanged map[duration:0.003
2016/02/04 14:33:54 {17 2016-02-04 14:29:27.624453379 -0500 EST StateChanged map[duration:0.69
2016/02/04 16:10:07 Generating files...
2016/02/04 16:10:20 Total 2048.0 MiB in 1 files
2016/02/04 16:10:20 Starting instance 1...
2016/02/04 16:10:39 Starting instance 2...
2016/02/04 16:10:39 {8 2016-02-04 16:10:39.700263063 -0500 EST StateChanged map[folder:default from:idle to:scanning]}
2016/02/04 16:10:39 {11 2016-02-04 16:10:39.704780175 -0500 EST StateChanged map[duration:0.004516652 folder:default from:scanning to:idle]}
2016/02/04 16:10:40 {16 2016-02-04 16:10:39.944190713 -0500 EST StateChanged map[duration:0.23940970900000003 folder:default from:idle to:syncing]}
2016/02/04 16:12:15 {67 2016-02-04 16:12:14.974551475 -0500 EST StateChanged map[folder:default from:syncing to:idle duration:95.030358331]}
2016/02/04 16:12:15 Verifying...
2016/02/04 16:12:22 Result: Wall time: 1m35.030360762s
diff --git a/src/crypto/tls/cipher_suites.go b/src/crypto/tls/cipher_suites.go
index 224ed1b..badf640 100644
--- a/src/crypto/tls/cipher_suites.go
+++ b/src/crypto/tls/cipher_suites.go
@@ -9,6 +9,7 @@ import (
"crypto/cipher"
"crypto/des"
"crypto/hmac"
+ "crypto/md5"
"crypto/rc4"
@AudriusButkevicius
AudriusButkevicius / syncthing.diff
Created March 6, 2016 21:23
syncthing crypto patch
diff --git a/cmd/syncthing/main.go b/cmd/syncthing/main.go
index 319131d..783d968 100644
--- a/cmd/syncthing/main.go
+++ b/cmd/syncthing/main.go
@@ -602,12 +602,7 @@ func syncthingMain(runtimeOptions RuntimeOptions) {
InsecureSkipVerify: true,
MinVersion: tls.VersionTLS12,
CipherSuites: []uint16{
- tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
- tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
// Read system DNS config from /etc/resolv.conf
package net