Category Archives: Uncategorized

Syncthing

Everyone and their dog has used Dropbox in the past.  It is good, but commercial and your data is stored in the cloud.

Another option is Resilio, a nice application but I don’t find it stable enough for production use.

I have found Syncthing, open source and your data is not stored in the cloud.  I’m  testing it out on several Windows machines and a couple Linux machines.

Installing on Linux (Debian) from the Debian package was easy enough, but it does not complete the install. 🙁

On top of that the documentation is currently out of date and/or not correct on how to get the thing running as a service.

I found this page that goes over how to get it running, the instructions even work unlike a number of others I have found.

Another thing that is not clear, is where the configuration file is.  If you start it using systemctrl as per the instructions (assuming username is user1), the system creates a default config file at: 

/home/user1/.config/syncthing/config.xml

I assume this is all done so each individual user can  set it up on the machine and have their own configuration…  of course in that way you have multiple people using the same port but guess they can fight over that.

The following commands could be used to enable the service (assuming username is user1)

systemctl enable syncthing@user1.service

With the service enabled it will start automatically on a restart.

If you want to stop/start or get the status while running, use these commands:

systemctl start syncthing@user1.service
systemctl stop syncthing@user1.service
systemctl status syncthing@user1.service

Builing A Deck With No Screws

Well, not exactly no screws but how about no screws that can be seen?  I have viewed a couple YouTube deck builders who were making decks while screwing in from the sides.

Today I found the tool that can do this easily.  It is called the Camo Marksman, from a company called Camo Fasteners.  You place it over your board and it automatically spaces the board and allows you to screw in from the side.

The result is a very clean looking deck, love it.

Testing the SSL Certificate on an Email Server

Have you ever tried to remotely test an SSL/TLS certificate on an email server?

It is no easy task, unless you know the simple command. Most online SSL testing tools that work against an email server will report if the connection is encrypted, if the cert matches the expected server name etc. However one piece of information they fail to check is if the certificate is expired.

I found OpenSSL has an easy command you can use to connect to an SMTP server and pull the details of the certificate in use on that server.

openssl s_client -starttls smtp -crlf -connect 123.456.789.012:25

Multiple Locale Website

This week I am experimenting with multiple languages in PHP based websites. The process is of course not so straight forward, so I am documenting some of what I am doing to get a server setup.

I am using GNU’s GETTEXT and Poedit, in order to get these things running you need to prep the server first. Gettext is well supported in PHP, which is why I am going that route.

On my debian server, I must first install gettext. I just installed the package.

apt-get install gettext

If you want to support a specific language, it must be a supported locale in the host OS as well.

In most linux distributions you can get a list of currently installed languages using:

locale -a

If you try and use gettext with a language that is not supported, it will not work.

On debian to install another supported language, it is fairly easy (I like easy) if you run:

dpkg-reconfigure locales

Then just select the locales you want to support and it takes care of the rest. Doing a locale -a again you should see your newly added languages.

Super Micro IPMI Firmware – X7DWT-INF

supermicro-logoI am managing a rack of Super Micro servers, the motherboard model is X7DWT-INF with built in IPMI using a AOC-SIMSO+ card.

The servers are old – quite old, but still perform their designated tasks just fine.

The rack contains a mix of Windows & Linux servers.

iodriveI wanted to convert one of the Linux servers over to Windows 2008 (the latest Windows OS supported by the board) to test out the performance of a Fusion-IO ioDrive (also old technology).

Despite having installed all the operating systems on this rack of Super Micro boards, getting Windows 2008 installed via IPMI was quite difficult. The system would install until the graphical interface showed up – then I lost all mouse or keyboard control.

Tried everything I could think of, no luck. Maybe there is a newer firmware than is installed on this machine? The AOC-SIMSO+ had firmware 1.60 installed, after hours of searching I found that 1.64 was available but I could not find any release notes anywhere.

Don’t know what the difference in firmware is, but it seemed to have fixed my problem. Just for my own future reference I am leaving a copy of the 1.64 build here… with such old computers Super Micro has sorta pushed the firmware to the back of their site so it is difficult to location.

I’m still looking for the latest firmware for the motherboard itself…

WD RE4 series benchmark.

So I was curious after doing that benchmark test on my SSD’s in RAID 0.

I ran the benchmark on a server that has a 1TB WD RE4 series disk. They claim 128 MB/s sustained from the disk.

My benchmark of the drive confirms their claim.

WD RE4 Benchmark

The drive maxed out at about 127 MB/s write and 138 MB/s on the read. I guess that is a fast drive, but is left in the dust when put up against an SSD and blown away totally against SSD in RAID 0.

Single Drive vs Raid 0

Every computer nerd knows RAID 0 is quick. My most recent computer (now about 1 year old) I put in three SSD drives operating in RAID 0 – I wanted quick.

I had an extra drive come out of another machine so I stuck it in there, but as a stand alone drive where I just put temporary files etc.

I was doing some reading today about different raid levels and performance. If you need redundancy RAID 10 seems to be the fastest option so that is what I will be using in my next batch of servers.

I never bothered to benchmark them before, I just knew that RAID 0 was faster. Is there an actual difference? Lets find out.

Performance of single SSD

The single SSD maxes out with a write speed of 138MB/sec with a read speed of 276MB/sec. That is quite snappy. I’ve seen laptop hard drives that can only do in the 12MB/sec, those laptops are painful to use.

Performance of three SSD in RAID 0

RAID 0 with three SSD disks. A max write speed of 1205MB/sec and a max read speed of 1552MB/sec – incredibly fast!

Interesting how the write speed closes the gap when you have multiple disks. Bottom line, running disks in RAID 0 does make a considerable difference! Even more interesting is how the performance increased by more than three times!

I used the free benchmark software from ATO Tech to do the testing.

Dyn Kills Free Hostname Program

I recently got some email from Dyn, something about their free hostname program being canceled.

I honestly did not think about it and just deleted the message, for a couple of reasons:

1) I’m not using their hostname program
2) I have a grandfathered free Dyn account from WAY back in the day

Then today I got another email, as seen here.

dyn

The part that stuck out to me was “If you are receiving this email, you have one or multiple free hostnames with us.”

Hmmm, if they are saying I have a free hostname let me think about this a bit more. Oh yea, I do use their DynDNS service – is that what they are taking about?

Should not impact me, I am on the grandfathered free account. Then I noticed the note in the email that says if you are a paid customer (which I consider myself to be) that this free hostname service would no longer be free. A Google search led me to a blog post by the CEO, which explains a bit more – basically they feel people are abusing it.

Dam! What’s a guy to do???

I run a few servers with Simple DNS Plus, which fortunately supports dynamic DNS updates.

It was very easy to setup, in fact the Dyn Updater software the Dyn distributes is actually developed by KanaSolution and they have the unbranded version of the software the Dyn uses available as DynDNS Updater.

I just removed the Dyn version and went with the unbranded one. So far so good.

I logged into my account and I don’t see any mention if my DynDNS is being canceled or what. At least now I don’t have to worry if Dyn is going to be canceling my free service since I am no longer relying on them for the service (it did work well while it lasted, thanks guys).

PHP session_start makes PHP single threaded

By no means do I consider myself a PHP expert, but I have been using it for quite a few years to build various websites.

If you are doing any websites with a login, you probably need to use PHP sessions to keep track of the user’s login status, preferences or who knows what.

Anytime I need to track a session, I toss this into the PHP code:

session_start();

That initiates user session tracking in PHP. Looks OK to me, been working great for years.

This past week I was developing some PHP/SQL scripts that take a long time to run. It was like if I was running the script, the website would not respond in another browser window.

I assumed the problem was related to mySQL, assumed there was a lock on the database until the first request was done.

After a couple of hours of researching I determined it was not mySQL, or my framework…

So I started from the ground up, the hello world code. That works, I can hammer it hundreds of times per second and there was no performance problem.

Yet running that single script that took maybe 30 seconds to run would bring the site down, no other page would respond.

Finally adding code back into my test environment I found it. session_start()

The default session handler drops the session information to disk. To prevent corruption the same user (same session) can’t access the same session data. Essentially meaning that PHP becomes single threaded on a per user basis. Normally this is not an issue for a couple of reasons 1) webpages are normally very quick 2) users don’t often execute many pages on the same site at the same time.

In my case the script tooks a considerable amount of time, I was unable to get results from a second page. To get around this problem you could use a different session handler (like storing sessions in Memcache).

Another way to fix it, do not leave the session open all day. When you need the session, open the session, access your variable and close it.

session_write_close();

Now other threads that may be called by the same user don’t get hung up waiting until the first script ends. PHP will automatically close the session and release the lock when the script ends…. but don’t wait. Close it with session_write_close(); when you are done with it.

Canon Online Shop – Hong Kong

I am currently in Hong Kong and needed a printer. Normally I just order from Dell but they don’t seem to be in the printer market in Hong Kong.

Canon Logo

I found a low cost printer from Canon Hong Kong’s online shop that met my requirements. Placed the order, paid by credit card… Delivery address is the same as billing address of the credit card… case closed right?

Not so fast!

I get an email from their online shop, which says the order was received. The odd part is this:

We shall confirm whether or not your order is accepted by us within 10 working days.

I think that is quite crazy, but I can live with that.

The following day I get another email that says the order has been accepted and they will deliver the printer within 10 working days.

To compelete the order these are the things I must do for them to continue processing the order:

1) Print out the email
2) Make a copy of my identity card or passport
3) Make a copy of the credit card I used to place the order
4) Print and sign an authorization form if I am not available that reads:

Authorization Form

To: Canon Hongkong Co., Ltd. (Canon online shop),

I ___________________ with Hong Kong/Macau identity card or passport No.:____________________ hereby authorize ______________________ with Hong Kong/Macau identity card or passport No.:_______________ to collect the product for my online order in Canon Hongkong Co., Ltd. shopping web site.

___________________________________
Signature
Date: ________________

Now keep in mind I don’t have a printer, I’m trying to order one. Essentially all that work of printing, scanning and document signing is too much effort.

In their email they say all of the above items must be present together with the authorized person (me) at the time of delivery. If not they may not dispatch the goods and they wanted verification that the above would all be available at the time of delivery.

Since in the email they said they will not complete my order unless I do all the above steps I decided just to cancel the order.

No reply.

The next day I get a phone call from Canon’s delivery team. They are calling to confirm delivery. I said no, I canceled the order (plus I had not completed all their documents so the order should not have been going through anyway).

A few hours later I got a phone call from someone else at Canon. He said I could just show the driver a printout of the email, rather than printing it. That would be OK, but I still could not scan/print my ID and credit card.

He asked if I would like a refund. Obviously I would, I will not be taking possession of the new printer. He stated that would be fine, it would take 40 – 60 days to refund the purchase amount to my credit card.

Hong Kong – Behind The Times

Online Fraud

Not to just pick on Canon, but Hong Kong is years (a decade?) behind other countries I have lived with their online shopping. In 1997 I started working at an online company. Over the next few years we grew to do 50 million USD revenue monthly – all online. We had an entire department for fraud prevention which is what Canon is obviously trying to do here.

Canon is not some small company, why does Hong Kong shopping lag behind other countries. I’ve never ordered from Canon USA but I bet the experience would be nothing like this.

By getting the copies of documents and the signed letter they are trying to prevent a chargeback against the credit card. That’s all fine and good, but lets see what would happen here if I was using a stolen credit card.

Since they have gone ahead and billed my credit card and are saying they will give a refund in 40 – 60 days. If it was a stolen credit card, the card owner would be doing a chargeback when they see an unauthorized charge on their card.

They will not be getting a chargeback as long as they issue the refund to me, but their processes seem seriously flawed to me. Hong Kong in general has a long way to go with their use of online shopping and online websites in general…. Seems there is plenty of opportunity for building quality websites and online shopping system for Hong Kong but I’m not in that business but the opportunity is there for someone.