Tuesday, September 25, 2018

Tiny C# Remote SSH Version Detector

Whilst doing some NetSec stuff, I needed a quick way to get the SSH version of a remote target, so I coded the following.

Demo (No Connection, Open Connection via Netcat, Actual SSH Server, Actual SSH Server on a custom port)

SSH Version Detector

Download: Here (5kb)

Source

Saturday, September 15, 2018

Configuring MPC-HC for easy Anime watching

Whilst watching some Anime recently, I got a bit annoyed that the default language was always set to English, so I had to change the language, and fixed the subtitles every 20 minutes or so which got super annoying.

I eventually found a fix.

Right Click -> Options -> Playback -> Default track preference

Set the number to the "Subtitles" number to the order of the option you prefer at the bottom of the Right Click -> Subtitle Track list, and the "Audio" option to "jpn"


Tuesday, September 11, 2018

Simple C# Command-Line Twitch Bot

Got bored one evening, so decided to create a basic Twitch bot in C#

It can't really do anything besides watch the chat, count the users, parse Twitch user tag data (Oh gawd why...) and have the user send messages to the chat, but the basic infrastructure is there for anything more complex.

Code: Here

Sample Screenshot


Ready Player One - Audio Book (Free)

It seems that the Audio Book for Ready Player One has become free. It's read by Wil Wheaton, and it's an awesome listen!

Go here to see and sample, or just download the entire thing in .ogg format here (480MB)

Friday, July 27, 2018

My Chrome Theme

This is the Fluttershy-themed Chrome theme I use.

This post is here because I had a few people asking me which it was.

Theme link: Here

Thursday, December 28, 2017

NetSec - A simple .zip dictionary attacker

I couldn't find a simple app to dictionary attack .zip files on Windows for a NetSec challenge, so I coded one.

Download Link: Here (106kb)
Github Repo: Here

If you're looking for something more intensive, try John the Ripper

Sample Screenshot

Sunday, December 18, 2016

JavaScript - Sum of the first X prime numbers

I recently had a programming challenge where I had to find the sum of the first X prime numbers in JavaScript in a slightly compressed format, and couldn't find anything decent online.

So I coded this.


It could be far better, although the challenge was timed :P

Thanks to The Polyglot Developer for their "isPrime" function :)

Wednesday, November 23, 2016

A Textbox that only allows numbers

Since this seems so hard to do... An actual working example :)

Usage HTML: <input type="text" onkeypress="return isNumericKeyPress(event.keyCode);" onpaste="isNumericPaste(this);" />

OR

ASP.NET: <asp:textbox ID="txtNumsOnly" runat="server" onkeypress="return isNumericKeyPress(event.keyCode);" onpaste="isNumericPaste(this);"></asp:textbox>

Demo Type or paste something:

Samples
- 1!2@3#
- Test
- Test1
- 1a2b3c

Saturday, October 29, 2016

C# - Finding the Median value of a List

I love using Lists in C#. Unfortunately, the List class lacks some functionality - Like finding the median value in a set.

Definition: The median is the value separating the higher half of a data sample, a population, or a probability distribution, from the lower half. In simple terms, it may be thought of as the "middle" value of a data set. For example, in the data set {1, 3, 3, 6, 7, 8, 9}, the median is 6, the fourth number in the sample. The median is a commonly used measure of the properties of a data set in statistics and probability theory.

Examples:

1.) If there is an odd number of numbers, the middle one is picked. For example, consider the set of numbers:
1, 3, 3, 6, 7, 8, 9
This set contains seven numbers. The median is the fourth of them, which is 6.

2.) In the data set:
1, 2, 3, 4, 5, 6, 8, 9
The median is the mean of the middle two numbers: this is (4 + 5) ÷ 2, which is 4.5.
- Median on Wikipedia

So - Here's some code to do it :)

Monday, July 6, 2015

ASP.NET - Fixing Entity Framework Migration Errors

AKA

"The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information."

OR

"Exception Details: System.InvalidOperationException: The Entity Framework provider type 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' registered in the application config file for the ADO.NET provider with invariant name 'System.Data.SqlClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information."

 

Whilst doing migrations from EF4 to EF6, I came across the following error. This is caused by two different things

1.) Your project contains both EF4 and EF6 references. If you're using EF6, only EF6 can be in the project. Either remove everything EF4 related, or upgrade it to EF6.

2.) You're missing a DLL. This seems to be the most common error. Navigate to applicationPath\bin\ on the server, and look for EntityFramework.SqlServer.dll (Should be around 600KB). For some odd reason, it rarely gets included in deployments. If it's not there, simply copy the version from your development machine onto the server, and you're good to go!