Can’t login using PowerShell to Raspberry Pi running Windows IoT [SOLVED]

0

Posted by Cynic | Posted in .NET, C#, Software, Solutions to Problems, Windows | Posted on 03-10-2015

Tags: , , ,

I’ve seen a few people having problems using PowerShell to log into their Raspberry Pi 2 that’s running Windows IoT. If you’re here, you’re already frustrated, so here’s what worked for me…

Restart WinRM using these 2 commands:

net stop winrm

net start winrm

Next, instead of using the device name for your Raspberry Pi 2, use the IP address like this in PowerShell:

Enter-PsSession -ComputerName 192.168.10.111 -Credential 192.168.10.111\Administrator

And yes… I understand that it sounds stupid, but I tried everything else and nothing worked. The above worked for me. YMMV. Good luck!

Oh, also, it took a minute or two to complete, so just be patient. If it fails, my only other advice is to find a baseball bat. ๐Ÿ™‚

Crypto Wallet Backup – Adds Testnet and CONF files

0

Posted by Cynic | Posted in .NET, Bitcoin, C#, Money, Software, Solutions to Problems | Posted on 29-03-2014

Tags: , , ,

This is an updated version of the GUI version of Crypto Wallet Backup.

It adds in 2 things:

  • Testnet folders
  • *.conf files

There are no other functional changes.

If you use testnet, and need your testnet wallet, then this is what you want.

If you also want to back up your *.conf files, then this is what you want.

I added these because I lost a truckload of testnet coins that I needed for some other software development. They took me a good deal of effort to get, and thanks to a software blunder… POOF they went! Sigh… Lesson learned… again… the hard way… as always…

I added in *.conf files because, well, might as well do that too as I’m sure some people might find it useful.

crypto-wallet-backup-add-testnet-conf

The 2 new options are obvious.

Download Crypto Wallet Backup v1.1 < Program Only

Download Crypto Wallet Backup v1.1 source < Source Code Only (not elegant, but effective)

The program is the same otherwise… well, I did freeze the form while the backup occurs, but it unfreezes once the backup is completed. That’s the only other change, and it’s only cosemetic. So, for more information, check out the original post here.

Hopefully that will help save some pain for someone.

Cheers,

Ryan

Crypto Wallet Backup Console Version with ZIP and Password Protection

0

Posted by Cynic | Posted in .NET, Bitcoin, C#, Software | Posted on 01-02-2014

Tags: , , ,

Crypto Wallet BackupI’ve added in a couple new features. Instead of the backup simply being a folder with all the files, it’s now a ZIP file. Also, there’s an option to password protect the ZIP file.

DOWNLOAD

To use it, simply download it, unzip it into the same folder as the GUI version of Crypto Wallet Backup.

The console application takes 2 arguments (parameters) in order:

  1. Backup file list (“backup-file-list.txt” by default)
  2. Password

Those are optional. If you don’t supply any arguments, then the program simply creates the backup as a ZIP file.

If you do use the arguments, you must supply a backup file list file even if you want to only use the password. However, you can supply a non-existent file (garbage input) like “asdf” and the program will use the default listed above (backup-file-list.txt).

The second argument is a password. You can’t use quotes in it because command line arguments use quote for delimiting arguments. Also, if you use spaces, you must quote the entire password. For example, if your password is:

this is my password

Then your command line should look like this:

CryptoWalletBackupConsole.exe asdf “this is my password”

You can schedule that with the Windows Task Manager to create backups on a predetermined schedule.

The source code is included in the download.

The code is well commented, and the “hacky” areas where I’ve taken shortcuts are explained if anyone feels like “doing it right”. e.g. Some verifications could be done in a more robust way and the file copying could be done directly to a stream to zip up.

The program uses the DotZip library (Ionic.Zip.dll), so that must be present.

DOWNLOAD

Cheers,

Ryan

Crypto Wallet Backup Console Version

0

Posted by Cynic | Posted in .NET, Bitcoin, C#, Software | Posted on 31-01-2014

Tags: , , ,

Crypto Wallet BackupSomeone asked me for some more features for the Crypto Wallet Backup program, so I’ve got a quick update with some of those.

This download requires the previous version. It’s just a console version that you can use in the Windows Task Scheduler for scheduled backups. It doesn’t do any zipping or encryption though – just the same basic backup as the Crypto Wallet Backup program.

CLICK HERE TO DOWNLOAD CONSOLE VERSION

The ZIP file includes the source code and the program.

Just unzip it and put it in the same folder as your GUI version. (Link to that above.)

It’s a console application and takes 1 argument: a file with a list of files to backup (1 per line). That’s the same as the backup-file-list.txt file that the GUI version creates automatically for you. So, if you want, you can copy or rename that file and manually add files.

Here’s a screenshot of the output:

crypto-wallet-backup-console

Ignore the “W” characters – they’re the slashes on my system as I’ve got it set to Korean.

So, to use the command line with a file, you’d type something like this:

CryptoWalletBackupConsole.exe file.txt

It reads the file for the list of files that you want to back up, then creates the same kind of folder as the original GUI version of the program, and copies all those files there as a backup for you. The console outputs the names of all the files it backs up.

I’ll try to get more added to it, e.g. zipping the backup, allowing for encryption, etc., as time allows.

Cheers,

Ryan

Back Doing Guitar & Drum Trainer Development

0

Posted by Cynic | Posted in .NET, C#, Music, Software | Posted on 15-07-2013

Tags:

GDTBuyNowWhile I’ve been back doing some more development on Guitar & Drum Trainer, I noticed a few bugs and fixed them. The funny thing is that with thousands of people using it, nobody has ever noticed the bug or at least not reported them. They were very minor, but still… one would have thought that somebody would notice.

Recover Lost FreeNAS User and Password

5

Posted by Cynic | Posted in .NET, C#, Logic, Software, Solutions to Problems | Posted on 21-11-2012

“Brute Force FreeNAS” is a simple, quick utility to get back a forgotten user name and password.

It works very simply. You must enter a list of possible user names that you had for your FreeNAS and a list of possible passwords. The utility then combines them all (in a Cartesian product) and brute forces your FreeNAS web interface until you are logged in. Once you’re logged in, you then know which user name and password is correct.

Further instructions on how to use it are in the program. You can download it here:

DOWNLOAD FreeNAS Brute Forcer

Brute force freenas user password

Why did I write this?

Well, I had a problem where I couldn’t login. For some reason, there was an error in my FreeNAS box, and the proper login didn’t work. So, I started to write this utility, thinking that I’d forgotten the right login, and knowing that I knew or could guess the right user name, and the right password, but not the right combination of the two.

I then had further problems, and had to hard reset my FreeNAS box. And therein lies the key… Once I had reset it, I was able to login. However, I was already writing the utility, finished it, and tried the proper login then. However, since it works, and does what it is intended to do, I’m releasing it for others to use.

Make certain to read the instructions in the program.

The code in included in the download for anyone that wants to tweak it or whatever. There is no license – this is in the public domain. I have noted some code in there that I used from elsewhere to get some things done.

Notably, there’s a very cool bit of code that lets you do an N-ary Cartesian product, which is the core of this program as it combines the user names and passwords. You can find that here:

http://www.interact-sw.co.uk/iangblog/2010/07/28/linq-cartesian-1

I first found that article and piece of code while creating some custom software to create a corpus for the Samsung S Voice artificial intelligence – the Samsung version of Siri. I needed an N-ary Cartesian product, and not just a simple cross join on 2 sets.

Anyways, hopefully that helps someone out there.

Cheers,

Ryan

 

 

OpenTK, GTK#, GLControl, and GLWidget

2

Posted by Cynic | Posted in .NET, C#, Linux, Software, Solutions to Problems, Windows | Posted on 30-06-2012

Sigh… So I’m banging my head against the wall trying to get a GLControl working in a GTK# project in MonoDevelop… Not gonna work.

The GLControl inherits from System.Windows.Forms.UserControl, so you basically end up resorting to exactly what you wanted to avoid in the first place by using GTK#, i.e. Windows Forms. Here’s an image of the error (click to enlarge):

OpenTK GLControl error

Instead, you need to use a GLWidget with GTK#.

http://www.opentk.com/project/glwidget

Anyways, hopefully that will help someone from having a bloody forehead.

I’d been trying to add a reference to OpenTK.GLControl.dll and trying to get it to work in the visual designer (stetic) with no luck. I searched around for answers, and didn’t get any. I then simply tried to add it manually. And that was it. The error.

People have complained about OpenTK not really having the best documentation, but I’m going to stick with it for a while longer and hope that I can fudge my way through it enough to finally get to that stage where I can be productive. It seems like with things like this, the ramp up time and effort that it takes to get started is the most painful part. From past experience, I’m expecting things to finally smooth out in the very near future.

So, on to OpenTK with GTK# and MonoDevelop!

Cheers,

Ryan

Frackin’ Reserve! – A Fractional Reserve Banking Simulator

10

Posted by Cynic | Posted in .NET, Awake, Banking, C#, Logic, Money, Rant, Software | Posted on 16-05-2012

Tags: ,

To help explain what the effects of fractional reserve banking are, and to illustrate just how evil it is, I’ve written a simple program that lets you simulate fractional reserve banking and the effects of compound interest.

The “Frackin’ Reserve!” program simulates what happens in fractional reserve banking, and lets you change the parameters for it. What this lets you do is simulate fractional reserve banking from a variety of perspectives, and see the results in real time. It also lets you generate a report so you can view all the generated output in a linear time series of the iterations through fractional reserve banking. That was probably a mouthful, and may have sounded like so much balderdash to some people. But it will all become clearer later on, and in particular when I post a follow-up article about fractional reserve banking.

The 10 Second Summary

Download and run the program to play with the factors that make up fractional reserve banking. Change them to see what happens. As a bonus, you can also see how interest works.
Read the rest of this entry »

The Licensing Experience with Infralution and DotNetNuke

0

Posted by Cynic | Posted in .NET, C#, Databases, DotNetNuke, Online Marketing, Software, Solutions to Problems, Super Simple, Web Sites | Posted on 20-09-2011

Tags: ,

I don’t think that I’ve ever done a licensing or purchasing flow exactly the same way twice. Well, a couple times, but mostly I experiment with both major changes and minor tweaks.

This time around for the Super Simple Photo Resizer Social Edition, I’m doing things more or less right. There are a few things that still could be improved, and a few things that I’m not really all that happy with, but like my friend Nick Longo says, “Release at 80%.”

However, overall, I think the current functional set that I’ve got mapped out for Photo Resizer Social Edition are pretty good, and will deliver a solid user experience. My goals on the user-experience side are:

  1. Make it easy to purchase
  2. Make it easy to get and enter the license
  3. Make it easy to get a lost license back

Each of those has a real upside for users, and an upside for me as well (respectively):

  1. I make more money
  2. Fewer support emails
  3. Fewer support emails

But I also have some other goals.

  1. Cut down on piracy
  2. Cut down on piracy
  3. Cut down on piracy

For a little guy like me, piracy hurts. Badly. It also hurts users, because it removes the financial incentive to continue development. You’d be surprised at just how many people like to get paid for their work, and how much they enjoy having food on the table and paying their bills. ๐Ÿ˜‰

I recently got an email from someone who purchased some other software that I write. This is part of that email:

I could have pirated the software if I wished as it is easy to crack which is something you need to work on, but I thought the software is so good that I would pay you the money for a genuine copy and support its future development.

I’m glad he bought a copy! It quite literally puts food on the table.

However, I don’t want to get into piracy here. Instead, I’d like to go over some of the things I’m doing with the new licensing scheme…

The flow looks something like this (click to zoom):

Super Simple Photo Resizer Social Edition Licensing Flow
Now, I’m leaving out a lot there because it would just be boring details, but that’s the basic flow.

The user gets 2 emails:

  1. PayPal receipt
  2. License email with account information

Now, in the past I’ve done licensing manually, which has been in many ways pretty easy, but it’s not been without its pain as well.

I’ve previously mentioned that I’m using the Infralution toolchain for licensing, but nothing is perfect “out of the box”, so I’ve done a good amount of customization. Having been burnt very badly in the past, I tend to purchase source code licenses whenever I can afford to. This leaves me the freedom to get down into things and tweak, fix, or just pimp-out stuff. Infralution offers source code along with their various products, which is another reason why I strongly recommend them to people whenever the topic of software licensing or payment integration arises.

I’ve also raved about how much I love DotNetNuke. It’s a fantastic CMS/portal written in ASP.NET (VB.NET in the past and now in C#), and comes with a BSDish license. However, I’ve been hesitant in the past to do much integration due to time constraints and other factors. However, this time around, I’m aiming to get things done more or less “right”.

Neither the Infralution ILS nor their IPN.NET integrate into DotNetNuke, so all of that is goodness that I need to take care of. Luckily, DotNetNuke is very well designed and integration isn’t really much of a problem. It’s really only a matter of getting it done and testing things out to make sure that they work. The trick is to try and make certain that I don’t step outside of the framework, and don’t create potential future issues for when I upgrade the DNN version. (Moving from DNN v2.1.2 to v3.x was a NIGHTMARE.)

ILS and IPN.NET take care of all the license generation and authentication, so the only thing needed is to get that into DNN. The relevant user-portion of the database is (click to zoom):

DotNetNuke Users Roles Database DiagramTo get ILS and IPN.NET working there, I needed to create 2 new entries in the database:

  • A Role for licensees
  • A ProfileProperty to store licenses

No new tables needed to be added, and no table modifications were needed. So, everything fits into DNN nice and cleanly.

A Note About the Database: When installing DNN, I would highly recommend using object qualifiers. These are prefixes for the database objects (tables, stored procedures, views), and will help to guarantee that well written modules that use them do not have conflicts. IPN.NET and ILS do not support object qualifiers, and have table names that could be used by other modules. As such, I’m very happy that I always stick with the wisdom of using object qualifiers because it’s made things much safer, and has allowed me the freedom to use the DNN database for the IPN.NET and ILS Authentication Server. Later on, this will let me create custom modules or do additional programming that let me access all user data in 1 place. The advantages here are never-ending.

When a user purchases a license through PayPal, PayPal then securely contacts my IPN.NET instance, and I then process the transaction by either updating the user’s existing profile, or creating a new user profile for the user and updating it with their new license information.

Since IPN.NET has no DNN integration, everything needs to work around that, and consequently, needs to be done at a low-level. Luckily,ย the DNN community is quite large, and there’s a lot of code out there to help with very low-level stuff like this.

The first step to integration is to create a user, and there’s some existing code out there that helped me get jump started:

Creating a DotNetNuke User via SQL

So starting from there, I’ve got a new account for the user and it has their license securely stored.

Next, there’s a password problem there… I certainly don’t want to use a known password, so that needs to change. Again, thanks to the DNN community, I’ve got the solution:

Updating a DotNetNuke User Password via SQL

However, what password do I create? What I wanted to do initially was to create a pass phrase instead of a password. However, being the grammar-Nazi that I am, and being constitutionally incapable of generating icky passphrases, I realized after some investigation that any decent passphrase generator would take me far longer than I was prepared to spend. So… Thank you again to the .NET community, I have a ready-made password generator that creates strong passwords of an arbitrary length:

Strong Passwords in C#

So that problem is also solved, in more detail that I’d care to bother with too! It creates passwords that look like these:

  • a+7P9A*rp6F&
  • So5={9WsM+g7
  • Ax8$+3JwD=a2
  • Ky8-i?H6Dw3&9%sS$rX54Q!f{2eLPp_7

The nice things about that password generator are that it

  • Leaves out ambiguous characters, e.g. I vs. | vs. l vs. 1 or 0 vs. o vs. O
  • Lets you choose the length of the password
  • Mixes in upper and lower case letters, numbers, and symbols

As far as being able to remember them? Bah! Not going to happen. Which is why I wanted to have a pass phrase generator, but, you do what you can with the time you have.

Now, code-wise, there are a few points where things need to get done:

  1. MS SQL Server stored procedures
  2. The IPN.NET project
    1. Default.aspx.cs
    2. Add in the RandomPassword.cs class
    3. Add in the “DnnLicenseIssuer.cs” class
    4. Modify the “Keys.htm” file

The MS SQL Server stored procedures won’t have any impact on DNN if done right. The prerequisite PropertyDefinitions and Roles need to be there, but that’s simple enough.

The RandomPassword.cs and DnnLicenseIssuer.cs classes won’t have any impact on the IPN.NET installation, so there’s a lot of freedom there.

However, changes to the Default.aspx.cs file will break across IPN.NET upgrades unless care is taken to migrate those changes to any new IPN.NET version. Luckily, everything that needs to be done can be done in this method:

private void ProcessPurchaseItem(PurchaseItem item, int quantity)

However, if you’ve actually sold a license, and the payment is successful, there’s only 1 spot that you need to modify, which will look something like this:

DnnLicenseIssuer dnnLi = new DnnLicenseIssuer(ipn, item, keys, false);
if (dnnLi.HasExistingAccount)
{
// Do stuff for license email
}
else
{
// Do stuff for license email
}

So you can easily minimize the impact there and make future upgrades very easily.

The “Do stuff” part contains customizations that I’ve written for the license email. If users have an existing account, then they get a different email than users that I’ve created an account for.

Of course it is possible to go further, and create users irrespective of whether the license payment succeeded or failed, and follow up later, however, it’s not one of my requirements at the moment.

The End Game

There’s a plan behind all this though. I’m not going to spill the beans quite yet, and it won’t get done for some time yet. However, all of this has a forward-looking purpose, and when I finally make it to that stage, I’ll post back on what I’m doing and the results.

Until then, check back at Super Simple over the next few weeks as the new Photo Resizer Social Edition is coming out very soon.

Cheers,

Ryan

Creating Urgency for Sales with Infralution Licensing System

0

Posted by Cynic | Posted in .NET, Business, C#, Databases, Money, Online Marketing, Software, Solutions to Problems, Super Simple | Posted on 15-09-2011

Tags: ,

I need to create a large number of “products” for Photo Resizer, but they’re really all just the same product with different prices. And not 2 or 3 prices, but more like 20 or 30 prices. Actually, I’ll likely end up creating more than 30, but that’s a detail.

It may seem strange to some people as to why I would do this. I’ve had people tell me to just set one price and be done with it. Well, that’s all fine and dandy, but it also shows a lack of understanding about how to sell software. Just because you’re a rock star coder, doesn’t mean you’re a rock star marketer.

So, what I’m going to cover now are some motivations and reasons for the problem, and how I’m solving it. There are of course other ways to create problems, and other ways to solve them too. ๐Ÿ™‚

  • Urgency and creating urgency
  • The Infralution Licensing System and License Tracker
  • The Code: Creating massive numbers of products for the License Tracker database

Urgency and Creating Urgency

When you’re selling, you sometimes need to create a sense of urgency for people to BUY NOW! Not later. Not tomorrow. NOW! Stores do with with 1-day sales, or “on sale until <date>”. The same sort of thing can be done for software. You just tell people that there’s a deal to be had RIGHT NOW, and that if they don’t buy your product RIGHT NOW, then they’re going to miss out.

What happens when you do this is that you effectively remove a barrier to purchase for the customer. They have 1 less reason to “not buy”, and 1 more reason to buy. The more things you can do like this, the better. Typical things include telling potential customers how your product will benefit them and make their lives better, or offer free shipping, or… You get the point.

The way in which I am creating urgency is with an initial steep discount for the product that decreases; that is, the price increases over the course of the trial period. e.g. Today it’s $5 and tomorrow it’s $6, and the day after that… So… BUY NOW and SAVE~! I’ve done it before, and it works.

The Infralution Licensing System and License Tracker

There are lots of ways to license your software, but the one I like is from Infralution. The Infralution Licensing System, or ILS, integrates with their IPN.NET product as well, so it gives me a way to license the software and collect money for it; those are 2 very different things and should not be confused.

ILS includes a program to help keep track of licenses and customers called License Tracker, which up until now I’ve never used. Since I’m looking to automate as much as possible at this stage, I’m moving things over to it now.

License Tracker stores data in a database; I’m using MS SQL Server for that. To add a new product, you simply open up a new form and enter all the data then click OK. Sounds simple enough? Well… Not when you want to add in a truck load of products; it is extremely tedious and painful. I don’t want to copy and paste 500 million times, and I don’t want to change my mind later on and end up copying and pasting another 500 million times.

Since License Tracker is a database-connected application, all data in it is just the data in MS SQL Server. This makes it easy to deal with your data because you can simply connect to the database and do whatever you feel like. As such, I wrote a utility to generate SQL for products, or rather, for product variants, though it could also be used to create top level primary products as well.

My simple “SQL Generator for the Infralution Licensing System License Tracker ” (that’s a mouthful) lets you enter data for a product and generate product variants very quickly. It even lets you increase product costs by a set increment, and lets you auto-increment IPN item numbers. Here’s a screenshot of it (click to zoom):

SQL Generator for the Infralution Licensing System License TrackerIt’s pretty basic, but it saves product information and settings automatically so that you don’t need to enter everything the next time.

You simply fill in the form and click the “Generate SQL” button. The SQL is then appended to the Generated SQL text box at the bottom of the form. You can automate part of it with the Automatic Increments settings, or quickly change the price manually and click the Generate SQL button again. It’s MUCH faster than copying and pasting for every field.

Now, you do need to know what you are doing, and the “Parent Product ID” needs to be the primary key for the product’s parent in SQL Server, so this isn’t a utility for just anyone to use. However, if you use the Infralution Licensing System and License Tracker, you’ll already be familiar with everything in there, and you won’t have any problems in using it.

Once you have your SQL, you can simply review it to see that it’s what you want and run it in MS SQL Server Management Studio, or whatever you use to execute SQL against MS SQL Server.

After you run your SQL, simply open up License Tracker and all your products will be there.

The Code: Creating Massive Numbers of Products for the License Tracker Database

To make things easier, I’m including the full source code for download here. Please note that I’ve chosen for it to be licensed under the WTFPL 2.0, so you have maximum freedom to “Do What The F*** You Want To”. If you don’t like that license, then feel free to send me lots of money and I’ll give you another license. ๐Ÿ˜‰

Download Source Code forย SQL Generator for the Infralution Licensing System License Tracker

The download includes all source code and a debug build that you can run immediately.

The code is commented extensively, so you can consider that the “documentation”. If you have any questions, which I rather doubt anyone will, you can post a reply here. (Also email me to let me know to respond. You can email me through the contact page at http://renegademinds.com.)

I hope that helps someone out.

Cheers,

Ryan