≡ Menu

I’m not sure if I will have enough time to document all of my adventure with upgrading to Windows 10. Needless to say, it wasn’t as painless as I would have hoped.

There is one thing I want to document in the hopes that it might help someone else who has an Roland/Edirol M16-DX sound board. At the time of writing this, Roland hasn’t released a Windows 10 driver, and at the moment it’s unclear if they will. That said, the 8.1 driver works just fine, but does require 2 “hacks” to achieve it.

The first hack is to the INF file:

1. Change the %MfgName% to be %MfgName%=Roland,NTamd64.6.2
2. Remove the section with the header [Roland.NTamd64.7]

Doing this will allow Windows 10 to see the driver, however, it will no longer install it as the INF file and the HASH associated with the cat file no longer match (security issue). To get around this problem, you have to perform a second hack that disables the driver security check. To do that, you have to boot into a special mode. Click here to read how to do that.

Once the Driver Signature Verification is turned off, it should install the board without issue (and it appears to work just fine… I haven’t tested the ASIO yet, but all my inputs and outputs are showing up in Windows 10, and sound is flowing.

I’ll make this last note in case I don’t get back to my adventures in upgrading to windows 10:

I strongly encourage a clean install… Which if your going to do.. YOU NEED to get the key first (assuming your doing the free upgrade). Doing an in-place install left me in a non-bootable state where I had to do a clean install (most likely due to my wide array of weird drivers). That said, clean installs means fast OS’s… I don’t think my computer has been this fast since 2010…

And for those of you who are wondering: other than the launch day hiccups… Windows 10 seems great to me so far. No complaints (other than the install/driver issues which were to be expected day 1).

 

{ 0 comments }

Color Profiles and PDF to JPEG conversion

Again, just documenting some code for myself in case I find myself in this situation 10 years from now, and happen to be googling my blog for how to convert a PDF to a JPG/JPEG/anything really.

Let’s start off where this ordeal started… with this simple line of code:

convert source.pdf output.jpg

Jam that into a php exec statement, and you got yourself some basic PDF to jpg conversion going on… However, there will be some issues. The first one I ran into was quality (okay, so honestly the first one was the mistake of trying to use Imagick() object in php and assuming it had all the power easily accessible that existing in the command line version. It doesn’t as far as I can tell). Quality was easy enough to fix. The setting that made the difference for me was density:

convert -density 300 source.pdf output.jpg

That worked great… Until the client uploaded a PDF they had cropped in Adobe Acrobat. Strangely, when being converted using imagemagick, it was still showing white where the client had cropped. Rather than explain to the client how PDF’s have a trimbox, cropbox, bleedbox, and artbox that can all be “cropped”, I decided the best course of action was to modify imagemagick to us the cropbox instead of the trimbox:

convert -define pdf:use-cropbox=true -density 300 source.pdf output.jpg

And, again, the people rejoiced… Until the client manged to find a way to really stump me. They uploaded a pdf that contained a particular shade of green. This green went from being a nice, tree like green, to a insanely bright neon green when converted from a PDF to a JPG. I knew this was most likely a color profile issue… which in the past has always proved to be a problem for me.

Color profiles have this fun way of not always behaving the way you want them to. I tried various things to get the color profiles to behave consistently upon conversion, but no matter what I did, nothing seemed to work in all cases of conversion. So got a little more creative… I decided to try some inbetween conversions… I ended up finding something that worked by sending it through a post script (PS) file. Here’s the final 2 lines I’m now using:

pdftops -paper letter -expand source.pdf inbetween.ps
convert -density 300 inbetween.ps output.jpg

pdftops handles the cropbox on it’s own, so no need for those flags anymore. I’m not sure the density line is needed, but I left it in anyway.

 

 

{ 1 comment }

MySQL SSL Setup Debugging

For my own sanity, I’m writing down the steps I took to get SSL working between 2 servers today. I ran into some frustration following the step-by-step instructions on both mysql.com as well as on 1 or two other websites on the web. To add to the fun, it seems sometimes I would get different, no descriptive, errors such as:

  • ERROR 2026 (HY000): SSL connection error (no additional details)
  • ERROR 2026 (HY000): SSL connection error: Unable to get certificate
  • ERROR 2026 (HY000): SSL connection error: protocol version mismatch

So here is what I did, step by step, with multiple test points…

On The MYSQL SERVER  that I wanted to connect to, I logged in and created a self signing Certificate Authority (CA) and then used that to sign a key for my mysql server. The commands looked like this:

openssl genrsa 1024 > ca-key.pem
openssl req -new -x509 -nodes -days 3600 -key ca-key.pem -out ca-cert.pem

openssl req -newkey rsa:1024 -days 3600 -nodes -keyout server-key.pem -out server-req.pem
openssl rsa -in server-key.pem -out server-key.pem
openssl x509 -req -in server-req.pem -days 3600 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem

You’ll note that I used 1024 for my key instead of 2048. While 2048 would be more secure, and is what is provided in the example here, it causes my version of OpenSSL to generate in a slightly weird format that the mysql client doesn’t seem to like in some cases. A number of example online said there was a simple work around involving adding “RSA” to the header and footer of the keys, but no matter what I seemed to do, this never worked for me… so I just lowered the key strength to 1024 to get it to generate it the old way. There was also a suggestion to merge the server and client certs into one “CA”… but I didn’t like that either… in fact… I didn’t want a Client cert if if I could avoid it… as I wasn’t authenticating against it… I just wanted the SSL tunnel.

Once I had my certs created, I added these 3 lines to my.cnf. In theory I could have put them in the startup command for the server, but this was the better long term solution:

ssl-ca=/etc/mysql/ca-cert.pem
ssl-cert=/etc/mysql/server-cert.pem
ssl-key=/etc/mysql/server-key.pem

Note: when I created all my certs above, I was in the folder /etc/mysql/ (in case you didn’t guess that already).

At this point, I restarted the mysql server and ran the following query on it:

show variables like “%ssl%”;

The server came back and would say that it “have_ssl” and “have_openssl” along with the paths to the certs I just loaded in. This was a good sign.

I think modified one of my users to only allow connections using SSL:

grant usage on *.* to example_user require ssl;

I than began testing from client devices. The first stop was the mysql workbench for windows. I loaded it up and tried to log in, and on the first try it failed (this I took to be a good sign, as I hadn’t told it anything about the SSL). I then grabbed the ca-cert.pem file I created on my server, and brought it over to my client box. I then told mysql workbench to use this file for the CA. You’ll note I DID NOT specify a client key or certificate for this. I then tried to connect, and wha-la, it let me in.

To confirm I was in fact transmitting over SSL at this point, I ran this query:

show status like ‘Ssl_cipher';

and then insured it came back with a value (if it’s blank, your NOT connected over SSL)

I then moved on to my second client, which a LAMP setup. I tried connecting using phpmyadmin, and of course, it failed again as I had told it nothing about the certificate authority. So again, I copied the file over, this time adding the following to my my.cnf:

[client]
ssl-ca=/path/to/ca-cert.pem

I first tested with my mysql client on the machine and it worked great. I did run into a little trouble with phpmyadmin, but I found the connect lines in my config file and basically added this one line before the connection was made, but after the init:

mysqli_ssl_set ($link , NULL , NULL , “/path/to/ca-cert.pem” ,NULL , NULL );

I think this may not have been needed if my version of phpmyadmin had been newer… but not sure. (I was in 3.4.5 at the time, the documentation I was reading would have been for 4.2.7).

Regardless, when I signed off for the night, all my mysql connections that I cared about between my older “clients” and my new mysql server were running over SSL. Tomorrow, I hope to setup some replication between servers over SSL. This may require that I create a client certificate, but until then, I’m happy to not have needed one.

 

 

 

 

{ 2 comments }

A Culture of Pressure

The USA has turned into a culture of pressure. We never “ease up”. We are always “connected”. Etc.

I’m sure I’m one of the worst at this… between my job, my email, and my family, there’s barely enough time to check out the latest humble bundle.

And when I do, I feel guilty, for not doing other things that need doing.

And there is always something that needs doing.

The bible says we should have a day of rest, and up until the last 20 to 30 years, history seems to agree.

I feel like if there was some way to force a “Sunday” on everyone again, or at least get culture to really allow it, that we might see a lot of problems in our world vanish.

Maybe less students and adults snapping on Mondays…

Maybe less people suffering from anxiety.

Maybe a reduction a people addicted to drugs to help them unwind.

I’m sure this has all been said before… but it seems Christmas is a good time to mention it again.

Jesus wasn’t born in the middle of a busy city. He was born pretty much alone with his family (until the visitors started to show up). Different.

Maybe it’s time to reflect both on the peace that the one baby can bring us, and start making some changes in 2014 as a culture…

I guess that starts with changing myself first.

{ 0 comments }

Bitcoin as a Government Currency

I was thinking today about Bitcoin as a government currency. Particularly, when it comes to using it as a government currency.

I think, if I was starting a new country, or looking to replace my countries currency… I would use something based on either Bitcoin or Litecoin. I’ll call it GovCoin for the sake of this blog post.

Here’s my 3 biggest reasons:

No Need For A FED – 

The currency would be self regulated in the same way Bitcoin is. The downside to this is the same downside you have to any currency that can’t be manipulated: you can’t stop panics or bubbles. But I’ll take panics and bubbles any day over having my money easily manipulated by the government.

No Need For The IRS, or Tax Season –

The one change I would make to GovCoin is how the transactions work. I would set it up so that on every transactions, either a fix feed or a percentage was taken out of the transaction. This would basically amount to a sales tax, but done on every transaction, similar to how Visa does discount rates. Every citizen would have their own “pay in” ID that must be included with the transaction that is assigned they are issued a wallet. This would make it possible track how much you’ve paid in easily, either for refund purposes (tax-exempt organizations), or simply for your own reporting. The downside to this is the damage to free trade caused by imposing a transaction tax… but I believe the costs savings of not really needing an IRS could more than make up for it.

The other catch 22… Dealing with other currencies in your country. The only real solution to this problem is to not allow business to be transacted in other currencies… I’m okay with that… There will be international companies that are able to get around taxes by doing things in other currencies… I’m okay with that. As long as they are forced to pay their employees in our country in bitcoin, and all the stores online and off, require govcoin…  If it’s an international transaction, then there would probably need to be some sort of “flat govcoin tax” for bringing it into the country (like reverse postage).

Mining To Balance the Economy

I would use mining to help keep the classes balanced more than they are now. I would look at possibly making mining exponentially harder, the more you tried to do it as a pool or individual… Thus allowing the automated distribution of wealth (lottery) to be equal among the citizens… Maybe even making it somewhat based on how many transactions (or better, how much) you engaged in (inversely)…. This would somewhat create an automated redistribution of wealth… As the richest people in the country would no longer find it worth while to mine (most likely, as their odds would be hurt by the amount of the transactions they engage in), and the poorest people could mine to possibly collect a ‘minimum wage’. Don’t get me wrong… it’s tricky… and you don’t want everyone simply relying on generating currency (that wouldn’t work)… But it’s a more “practical” way to hand out money to people than say… straight up hand outs or subsisdies…. At least this way, if they simply take the money and go and spend it like mad, they have less a chance of getting more free money… But if it works, you’ve pretty much eliminated the need for government programs that are simply there to hand out money. (You might still need some public education programs like… public education… might… being the keyword).

I’m not sure it would work… but… If I had a couple billion dollars and some land to try it out on… It would be a fun experiment… Wonder if a commune could pull it off legally inside state borders.

 

{ 0 comments }

Christmas Is Coming

It has been awhile since I have taken the time to write here. Much has happened over the summer, most of which you could label as “busy”.

I haven’t given up on my home automation dreams, in fact, my latest improvement was moving the Raspberry Pi out of my office and into the basement. There it continues to collect data, and powers my bitcoin miner (which also doubles as a space heater).

In terms of other things I wish to automate going forward… I really want to get to the point where I have my home’s Christmas lights do cool things. That said, I don’t have $1000’s of dollars to spend just yet, so I’m going to take it year by year I guess to make it happen. This year, I focused on getting the trim decked out with some new LED lighting.

The biggest issue I’ve run into though is electricity… For some strange reason, there are no outlets on the outside of our house. At least, non that are useful. Next summer, I’ll need to look into changing that. I’ll try to do it with the goal in mind of being able to run lots of cable (not just electrical) to my future winter scenes.

I’m also kind of wondering what my neighbor’s do for Christmas. This being the first year in our home, and the first year I’ve been able to decorate, I’m kind of concerned that I may eventually do “to much” (is there such a thing)?

In other news: Link continues to get older. Ellie seems to as well, but I swear not as fast as it went with Link. I feel like Link could be starting 1st grade any day now (okay, maybe not). Being a father is a new challenge every day. But it’s one I am very much enjoying.

{ 0 comments }