One of the features I added to Bimil was NTP client support for time-based two-factor authentication. For this I needed NTP server so I turned to ntp.org pool and requested vendor zone. Once zone got approved I suddenly had infinite* amount of NTP servers at my disposal.
So, when I decided to give Linode’s $5 virtual server a try, I didn’t want just to create dummy machine. I also wanted to do something for community. As NTP pool service is one of invisible pillars of Internet-connected devices and I was really happy such service was provided for free to myself, it was easy to decide. I am going to build NTP server.
Creating account on linode was a breeze as it was creating the machine. It was literally, click-next, click-next process. Once I finally logged on to it, the first action was to update system to the latest packages. Surprisingly, on Linode there was literally nothing to do - all was already up to date. Awesome!
yum update -y
…
No packages marked for update
By default, Linode’s CentOS installation has firewall disabled. As this server will be open to public, enabling firewall is not the worst idea ever:
With firewall configuration completed, you can finally install NTP:
yum install-y ntp
And this brings you to the most involved part of the process. You need to go over available stratum 1 time servers and select between four and seven of them for your devious synchronization purposes. Which servers should you select? As long as they are reasonably close (in the terms of network distance) you will be fine.
Using your favorite editor, you need to adjust /etc/ntp.conf file. Following ntp.org recommendations always worked for me but with a slight adjustment in the form of a separate log file and forcing IPv4 resolving for servers. Quite a few IPv6 capable servers only serve clients over IPv6 and don’t like other servers via the same. I personally use the following configuration (don’t forget to adjust servers names):
driftfile /var/lib/ntp/drift
restrict -4 default kod limited nomodify notrap nopeer noquery
restrict -6 default kod limited nomodify notrap nopeer noquery
restrict -4 127.0.0.1
restrict -6 ::1
server -4 ^^clock.fmt.he.net^^ iburst
server -4 ^^clock.sjc.he.net^^ iburst
server -4 ^^usno.hpl.hp.com^^ iburst
server -4 ^^clepsydra.dec.com^^ iburst
server -4 ^^tick.ucla.edu^^ iburst
server -4 ^^time-a.timefreq.bldrdoc.gov^^ iburst
server -4 ^^time-c.timefreq.bldrdoc.gov^^ iburst
logfile /var/log/ntp.log
With configuration ready, it is the moment of truth - start the NTP daemon and configure its automatic startup upon boot. Don’t forget to disable chrony too:
With all up, wait for couple minutes while checking state with ntpstat or ntpq. Forgetting it for hour or two will save you lot of angst :) I consider sync good enough whenever pooling interval goes to 1024s.
watch"ntpq -np ; echo ; ntpstat"
remote refid st t when poll reach delay offset jitter ``==============================================================================``
*66.220.9.122 .CDMA. 1 u 415123772.0226.6806.798
+216.218.254.202 .CDMA. 1 u 7710243772.1275.6636.180
+204.123.2.72 .GPS. 1 u 2575123774.9082.7535.031
+204.123.2.5 .GPS. 1 u 405123775.2325.2786.052
+164.67.62.194 .GPS. 1 u 5325123779.978-0.6373.795
+132.163.4.101 .NIST. 1 u 362102437735.2265.4897.610
+132.163.4.103 .NIST. 1 u 43051237735.1485.3537.607
synchronised to NTP server (66.220.9.122) at stratum 2time correct to within 19 ms
polling server every 1024 s
It will take some time for other servers to “discipline” yours so do be patient. If servers are showing INIT refid for a while, this might indicate a permanent issue (e.g. server might be down) or just something temporary (e.g. server might be overloaded). If server is not reachable for a while, toss it out and select another one from stratum 1 list (followed by systemctl restart ntpd).
I personally gave server an hour or two to get into the shape before proceeding with the final step - adding it to pool. This can be done at ntp.org management pages and it is as easy as simply adding server using either host name or IP address.
After monitoring server for some time and assuming its time is stable, your score will raise and you get to be the part of the collective NTP pool.
If you are using GELI to encrypt ZFS disk as I do, there is a slight issue with default NAS4Free configuration. Disk access is slow and everything points toward encryption as culprit.
To test encryption speed, one approach can be to load zero geom and encrypt a few bytes.
By default NAS4Free doesn’t load AES encryption module. And AES without hardware support is not as impressive as one would expect.
Fortunately, it is simple to load it. Going to System, Advanced, loader.conf, and adding aesni_load=YES is all that is needed. After reboot, we can check if module is properly loaded:
My beloved Casio Edifice has been on my wrist for years. And due to “gentleness” on my part, its mineral glass got scratched to the point of impacting readability. It was time for either a new watch or change of the glass. Guess which one I have chosen?
First task was the hardest - I had to find appropriately-sized replacement glass. Diameter was easy as you can measure it with calipers. Thickness was a bit more difficult. Someone doing it properly would disassemble the watch, remove crystal, and measure it. I just eyeballed it and decided that beveled 2.5 mm should fit just fine. And bevel did save me as its “unbeveled” height of 1.6 mm fits nicely in place of Casio’s 2 mm flat mineral glass.
For the new glass, I didn’t just want anything. I wanted to have sapphire as to minimize scratching in the future. And on that front I had choice between generic sapphire glass or a bit fancier AR coated ones. I went with blue AR coating as I felt it would bring a bit of pizzazz.
Once I received my glass, I was ready to begin with process. Instructions for it, of course, I found on YouTube. Disassembly went according to plan as soon as I took the bracelet off to ease handling. I used case opener to get the back off and then spent 10 minutes searching for a small hole to release the crown. With crown out the watch mechanism itself was trivial to remove.
All this was done while wearing finger cots (I find them much more comfortable than full gloves) and with occasional blow from dust blower. With quartz mechanism as one in this Casio, this might not be too important but I read too many horror stories about dust getting into gears so playing it safe seemed reasonable. To protect mechanism and avoid losing small parts I used a small plastic container.
Watch press was the most fidgety part of process because I had to find appropriately sized dies. Pains were worth it because glass did come out in a single piece despite the loud cracking noise.
As I have a good experience with silicon grease from my fountain pen hobby, I decided to get both case and the side of glass generously coated. Not sure whether my glass was better sized than one in video or due to silicone grease but glass was fitted on the first try. I found it so unbelievable that I had to check multiple times it’s really in and fitted straight. While grease probably did help with inserting it also meant I had to spend a few minutes cleaning the excess. Well worth if you ask me.
With glass mounted it was time to reassemble the watch. As expected, the same steps followed in reverse direction were all it took. In hindsight, I should have tested waterproofness before returning mechanism in but I simply forgot. In any case, my son has been wearing it while swimming in pool a few times already thus proving it’s reasonably waterproof. I wouldn’t bet on full 100 m rating though.
With sapphire replacement watch got a new lease on life and completely new look. Polishing the case would probably bring me a step further but I’ll save that for some later time. :)
Here is the list of all parts used in the course of swap. Note I didn’t actually buy all these things specifically for this project (e.g. Calipers, silicon grease, and figer cots I had from before) but I listed them anyhow.
PS: Albeit pronoun I is used all throughout this text, most of work was actually done by my son while I was providing paternal support in form of instructions and warnings. :)
Men are often irrational beings. For example I simply hate F1 key. I know, that key is there to give me help but realistically if I need help I will google for it. Absolutely every time I press F1 it is by accident and it leads to annoying wait for Help to load - especially in Microsoft Office. That key is useless!
Fortunately, deep in Microsoft’s Keyboard and mouse class drivers documentation there is a chapter on scan code mapper for keyboards. In short, there is a functionality enabling us to remap any key just by writing entry in registry without any external programs.
At first I though to simply disable F1 key. But reading a bit further into documentation I though better - why not use F1 key as a mute button?
For this conversion it is necessary to know codes for both F1 and Mute key. A bit of searching later I’ve found that information in USB HID to PS/2 Scan Code Translation Table. This ancient document has exactly what we need under “PS/2 Set 1 Make” column. F1 key has scan code 0x3B while mute is a bit more involved 0xE020 (disabling would be 0x0000).
Format of Scancode Map field is a bit confusing at first, but table examples do help a lot. For my use-case, table would be as this.:
Value
Field
Interpretation
0x00000000
Version
Set to all zeroes.
0x00000000
Flags
Set to all zeroes.
0x00000002
Count
Two entries in the map (including null entry).
0x003BE020
Mapping
Remap <F1> (0x3B) to <Mute> (0xE020).
0x00000000
Mapping
Termination entry.
These values would need to be written in registry under key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout as binary entry named Scancode Map. Of course, since binary data has to be little-endian, (hex) value would actually be:
00000000 00000000 02000000 20E03B00 00000000
Or one can simply download prepared registry file for creating mapping and, if necessary, removing the same.
Honestly, I almost lost hope this day will come. However, finally there is a download of Visual Studio Express 2017. Because no sunshine can happen without clouds here in Redmond, only Desktop edition is available. Moreover, Microsoft found it necessary to clarify it further with the following asterisk:
* Visual Studio Express 2017 is available for Windows Desktop developers. This will be the final version of Visual Studio Express, and there will not be a UWP or Web offering of Visual Studio Express 2017. We encourage all users to look at the free development options offered by Microsoft such as Visual Studio Code and Visual Studio Community for future development needs.
Yep, this is the last edition for the fans of Express. It has been a good ride I guess.
PS: And no, answer is not using Community as its licencing restrictions make it wildly unsuitable for the whole host of scenarios where Express was shining. For example, use in a bigger company is not really allowed - even if you are not using it for production software but only for internal tools.