Skip to content

Instantly share code, notes, and snippets.

View darinkes's full-sized avatar
🎯
Focusing

Stefan Rinkes darinkes

🎯
Focusing
View GitHub Profile
@darinkes
darinkes / AesDecryptor.cs
Created September 15, 2012 07:59
AesDecryptor.cs
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
@darinkes
darinkes / Topshelf-Session.diff
Created December 4, 2012 14:41
ServiceBase Session Events for Topshelf
diff -NurP Topshelf/src/Topshelf/Configuration/Builders/ControlServiceBuilder.cs Topshelf/Configuration/Builders/ControlServiceBuilder.cs
--- Topshelf/src/Topshelf/Configuration/Builders/ControlServiceBuilder.cs Wed Nov 28 13:21:02 2012
+++ Topshelf/Configuration/Builders/ControlServiceBuilder.cs Thu Nov 29 08:32:37 2012
@@ -14,6 +14,7 @@
{
using System;
using Runtime;
+ using System.ServiceProcess;
public class ControlServiceBuilder<T> :
@darinkes
darinkes / teamcity.diff
Created March 3, 2014 13:35
teamcity diff for gitlab
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 51509ec..e4a472e 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -166,7 +166,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController
end
def ci_status
- status = @merge_request.source_project.gitlab_ci_service.commit_status(merge_request.last_commit.sha)
+ if @merge_request.source_project.gitlab_ci?
@darinkes
darinkes / gist:9889276
Created March 31, 2014 10:13
make portforwarding more stable Found while testing portforwarding with http and some real quick reloads. Port-Forwardings crashes when unable to ship data. https://sshnet.codeplex.com/discussions/446914
diff --git a/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs b/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs
index c0518ce..dccca76 100644
--- a/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs
+++ b/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs
@@ -21,7 +21,14 @@ namespace Renci.SshNet.Channels
partial void InternalSocketSend(byte[] data)
{
- this._socket.Send(data, 0, data.Length, SocketFlags.None);
+ try
@darinkes
darinkes / gist:9889304
Created March 31, 2014 10:15
add the ability to catch SSH-Debug Log in your app, don't crash if Channel-Open failed, stricter privatekey regex + validation-method, various null exception fixes
diff --git a/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj b/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
index 4204d96..8e160f3 100644
--- a/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
+++ b/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj
@@ -144,6 +144,9 @@
<Compile Include="..\Renci.SshNet\Common\HostKeyEventArgs.cs">
<Link>Common\HostKeyEventArgs.cs</Link>
</Compile>
+ <Compile Include="..\Renci.SshNet\Common\LogEventArgs.cs">
+ <Link>Common\HostKeyEventArgs.cs</Link>
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using System.Timers;
using Renci.SshNet;
namespace SshNetWaitHandleIssue
{
class Program
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Timers;
using Renci.SshNet;
namespace SshTests
{
DDR Version 1.07 20161103
In
Channel 0: DDR3, 666MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
Channel 1: DDR3, 666MHz
Bus Width=32 Col=10 Bank=8 Row=15 CS=1 Die Bus-Width=16 Size=1024MB
256B stride
ch 0 ddrconfig = 0x101, ddrsize = 0x20
ch 1 ddrconfig = 0x101, ddrsize = 0x20
pmugrf_os_reg[2] = 0x32817281, stride = 0x9
@darinkes
darinkes / ftp_no_proxy.patch
Created April 26, 2017 13:40
OpenBSD ftp(1) no proxy patch
Index: fetch.c
===================================================================
RCS file: /mount/cvsdev/cvs/openbsd/src/usr.bin/ftp/fetch.c,v
retrieving revision 1.163
diff -u -r1.163 fetch.c
--- fetch.c 7 Mar 2017 08:00:23 -0000 1.163
+++ fetch.c 26 Apr 2017 13:10:48 -0000
@@ -57,6 +57,7 @@
#include <unistd.h>
#include <util.h>
@darinkes
darinkes / Program.cs
Created December 7, 2018 09:45
SSH.NET EC Tests
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using Renci.SshNet;
using Renci.SshNet.Common;
using Renci.SshNet.Security;