Weekly FGO Vol. 3

Oops I forgot about this one.

JP

As per screenshot above, I got another copy of MHXA. Nice, considering I only spent 26 tickets for her. Didn’t get anything else interesting though.

Finished all the challenge quests and stuff. It’s kind of annoying the real challenge quest is a one time quest. Even more annoying I cleared with some stupid team (Bunnytoria and Ishtar and Merlin). I’ll try some lower rarity clear next year if I still play this game by then.

The event is ending soon but no announcement so far. It should be rerun of Christmas 2018. We haven’t gotten our free ☆4 servant and the accompanying campaign either.

I also heard weird rumor like Saber Wars 3 instead of Christmas 2019. That would be weird…?

The announcement should come sometime this week… Maybe.

NA

8M download campaign thingy is ongoing. I’m not pulling though as I’m not much into gramps.

Jailter has started as well and I’ve played it once before it’ll be skipfest and rushing whatever I can rush.

I didn’t manage to gather enough exp card to level Jailter to 80. Not even 70 at just ~100 total. 2x super/great success rate is still ongoing which should help though. Also there will be 300 additional exp cards which after subtracting for Mash and Mech Eli I should still have at least 85 left so it could be enough if I’m lucky enough, I guess?

Oh well, farming time!

DKIM signing with OpenSMTPD and dkimproxy

After a long wait of OpenSMTPD 6.6 and its accompanying rspamd filter, I finally sent my mails DKIM-signed. Along the way I also discovered rspamd does a bit too much for my need and learned that it’s way simpler to use dkimproxy instead.

Outline of the steps required as follow:

  • Install OpenSMTPD
  • Install dkimproxy
  • Create signing keys
  • Decide “selector” name
  • Add relevant DKIM entry to all relevant domains
  • Setup dkimproxy to sign stuff
  • Setup OpenSMTPD to relay to dkimproxy before finally sending the message
  • Test
  • Done

Signing keys are created by:

openssl genrsa -out /etc/mail/dkim/selector1.key 1024

Followed by creating the public key for DNS entry:

openssl rsa -in /etc/mail/dkim/selecto1.key -pubout -out /etc/mail/dkim/selector1.pub

Don’t forget to fix private key permission to 400 owned by whatever user running dkimproxy.

The dkimproxy setting is pretty simple:

listen 127.0.0.1:10027
relay 127.0.0.1:10028
domain domain1.com,domain2.net
signature dkim(a=rsa-sha256c=relaxed)
signature domainkeys(c=nofws)
keyfile /etc/mail/dkim/selector1.key
selector selector1

It’s pretty straightforward.

And equally straightforward the settings for OpenSMTPD:

table aliases file:/etc/mail/aliases

listen on lo0
listen on lo0 port 10028 tag DKIM

action "local" mbox alias <aliases>
action "relay_dkim" relay host smtp://127.0.0.1:10027
action "outbound" relay

match tag DKIM for any action "outbound"
match for local action "local"
match for any action "relay_dkim"

First line sets the aliases.

Followed by a listener on localhost because this is just an example for sending-only server.

The listener on port 10028 is to accept the signed mail by DKIM to be finally sent.

local action sending mails to mbox for local user.

relay_dkim action will send mails to dkimproxy which will sign the email…

And relayed to 10028, accepted by smtpd, tagged DKIM and thus will be finally sent to where it should be. I learned the hard way it needs to come first because mails will be acted on first match.

Local for local. Don’t bother doing anything.

And finally the rest will be relayed to dkimproxy. As mentioned above, this must come after the outbound action for DKIM tagged mails.

If you want to run proper mail server with rspamd and stuff, read this instead. That article was also the reason I started looking into all this DKIM stuff.

Update 2024-07-21: Now with more modern algorithm.

Psycho Pass S3 ep. 2

I haven’t written episodic post since forever. Not like this one will be any better than the last time anyway lol.

I guess it’s a good thing I watched the SS. It’s not that important so far apart of just introducing some of the new faces and explains how Kogami returned to Japan. Interesting, but not really necessary so far, I think.

More Akane screen time yay. I guess this season will end with the end of Sibyl System?

Weekly FGO Vol. 2

“But it’s not even a week since the last one”

I’ll do this whenever I feel like to =)

Anyway,

JP

Saber Wars 2 has started. 10 tickets were spent. Two SR event CEs were obtained. And then the rest of the pulls were crap. Oh well at least I got some event CEs although an SSR would be nice.

If the mission counter is to be believed, I’m about 3/4 way to the end. I haven’t checked any guides or spoilers yet so I don’t know if it’s way longer than I thought or if there will be another set of missions. Considering the duration it’s probably not going to happen though.

I cleared Eli challenge quest with help of one command spell. I probably should’ve waited until I got all the damage booster CEs especially considering it’s not repeatable. But I didn’t. It’s not that difficult, just rather annoying. Also I probably should level Spartacus a bit more. Except I don’t have enough grails. Yay.

There are still quite a lot of store items to be purchased and a bit more missions to be cleared. And challenge quest. It’ll be kind of annoying with all CE slots potentially taken up by event CE.

NA

I haven’t finished the Babylonia campaign quests yet. The item drop ones. Maybe once I finish the last bit of monuments from event store.

Next event will be Jailter. That’ll be fun. I sure can use a good area NP lancer.

It kinda sucks Okita pick up isn’t happening and the next pickup will be May next year. That sounds like a long time without Okita. On the brighter side, it’ll also give me ample time to save some quartzes and tickets.

Weekly FGO Vol. 1?

Dunnolol I’ve been kind of doing this somewhere else and I figured I should move it here.

FGO JP

Event starts later today! Maybe will do an 11 rolls. I hope to get some event CEs at least.

Now I think again, I’m not sure if I even want any of the new servants.

FGO NA

I’m done with Halloween missions. I haven’t finished Salomon so I can’t do challenge quests yet ;_; RIP fancy cube.

The Babylonia anime campaign is a nice surprise. It’s mostly the same as the one in JP.

yes-www

I’ve been using blanket rule of no-www this past years and that is coming to an end.

Leaking WordPress cookies to every single sites hosted on this domain is probably not the best idea. Not that there’s any problem but just in case. Also no cookie to worry about for uploads and other static sites. Or maybe not if WordPress sets the cookie properly (it seems to be mostly does).

I was thinking of moving everything but for some single-use domains like 0paste.com it’s probably fine with no-www.

The other benefit is I can point the bare domain to a cheap server just for redirection and properly set CNAME for www subdomain instead of relying Cloudflare’s top-level CNAME function (which apparently also called “ANAME”?).

I’ve switched the redirection for www to 302 (temporary redirect) from 301 (permanent redirect) a while ago so hopefully no browser still cache the 301.

HTML template

Apparently I made over 50 drafts for this blog years ago. This is one of them. And the content doesn’t seem to be too bad so might as well finish this post.

I occasionally write some HTML. There are some essential things needed for a valid page.

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Title goes here</title>
<!-- additional meta goes here or wherever -->
</head>
<body>
Content goes here.
</body>
</html>

The doctype is just the basic HTML 5 doctype.

Followed by setting the language of the page. Usually English. Apparently it’s recommended by W3C. Although I sometimes forgot about it.

Then of course head, followed right away by charset. UTF-8 is the best set we currently have and so it’s set there. Without this tag, the page might be rendered in some other set.

I’m not sure if setting X-UA-Compatible is still relevant anymore but IE11 is still here so might as well set it. Or remove if IE compatibility isn’t needed.

Viewport setting is unfortunately essential so the page isn’t zoomed out when viewed using mobile device. Just don’t disable scaling as that’s rude (unless it’s game or something).

The rest are just usual HTML stuff.

Mastodon and FreeBSD

Together with updating all other craps and server migrations, I decided to finally update Mastodon install as well which I broke after upgrades and package removals.

Then in usual fashion, one of dependency didn’t install on FreeBSD because it’s missing pre-compiled binary and the build script has too strict settings causing the build to fail.

Did some hackery to figure out how to fix it (following this guide works) but then when I looked around the situation on the official uws module page it says it’s been unmaintained since forever. Googling around a bit it seems like the author is being a dick and ended up ragequitting the module. Mastodon dev was notified but no action is taken.

The good thing is I looked into replacing it with ws a long time ago and posted it to Mastodon issue tracker. As I’m not interested in doing the module-level hackery, I figured it’s easier to do it now. Also I forgot how I fixed it before which didn’t involve such hackery. Or maybe I did. I don’t know.

In the end I reapplied my patch and everything is good again.

Or not, because I switched PostgreSQL authentication to the shiniest Scram-SHA-256 which isn’t supported by node-postgres. The issue has been open forever and I’m not really interested in fixing it.

Thankfully someone tweeted me the existence of node-pg-native. I looked into it and even though it’s not a drop-in replacement for node-postgres, adding pg-native and setting NODE_PG_FORCE_NATIVE=1 environment variable will force the module to use native library which fixed the problem.

Except for node-libpq which for some reason doesn’t link correctly (my postgres is installed in non-standard path). Whoops. I think fixed it and hopefully it gets merged.

With all the fixes in place, everything seems fine.

Letsencrypt, cavemen edition

Just had to do some letsencrypt setup in some servers so I figured I should write down what I did so I can just check this page again instead of digging how I did it previously.

Requirements:

  • nginx
  • certbot

This assumes the server only serves https and redirects all http traffic. Adjust as needed otherwise.

Full nginx SSL/TLS config not included.

First add this config to nginx to handle verification:

# part of default port 80 config block
location /.well-known/acme-challenge/ {
    root /var/www/certbot;
}

And then create the directory (I’m not actually sure if needed):

# mkdir -p /var/www/certbot

Make the first cert because I’m too lazy to ensure the config directory is setup correctly:

# certbot certonly --webroot -w /var/www/certbot -d DOMAIN_NAME_GOES_HERE --keep --agree-tos --email SOME_KIND_OF@EMAIL_ADDRESS --no-eff-email

At this step, the certificate and all should have been properly generated.

Then use it in nginx configuration, the relevant server block:

ssl_certificate /etc/letsencrypt/live/DOMAIN_NAME_GOES_HERE/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/DOMAIN_NAME_GOES_HERE/privkey.pem;
ssl_trusted_certificate /etc/letsencrypt/live/DOMAIN_NAME_GOES_HERE/chain.pem;

If the full path seems too long, symlink it to nginx config base directory or something.

Update certbot CLI configuration located at /etc/letsencrypt/cli.ini:

rsa-key-size = 4096
text = True
authenticator = webroot
webroot-path = /var/www/certbot

To add more certificates:

# certbot certonly -d ANOTHER_DOMAIN

Don’t forget to update nginx configuration as before.

Since the certificate needs renewal periodically, create this simple script:

#!/bin/sh
# I personally put this in /root/bin/refresh-ssl-certbot

/usr/bin/certbot renew
/path/to/sbin/nginx -s reload

Make executable, etc. Try it to make sure it runs properly.

Then add it crontab. I usually do it weekly.

And done.

There might be smarter way using certbot’s nginx plugin or something but I haven’t bothered reading its documentation and initially this was just a stopgap switching from acme-client which is way simpler but stopped working for me few months ago.

IP address checker

Random idea I came up when reading nginx mailing list. A very simple way to set up external IP address checker using nginx on a remote server.

location = /ip {
    default_type text/plain;
    types { }

    return 200 $remote_addr\n;
}

Accessing /ip will then return the current external IP address. A more fancy output like JSON is possible as well.

HP Z210 SFF/CMT and SSD

My SSD doesn’t quite “work” with HP Z210 SFF/CMT.

  • Model: CT525MX300SSD1
  • Brand: Crucial
  • Type: MX300
  • Capacity: 525Go
  • Error:
    • 1798- Hard drive with hardware encryption enabled detected while in RAID mode. Drive: SATA0 (Dark Blue). Drives that are using hardware encryption should not be included in RAID volumes. Using them may cause volume corruption and unpredictable behavior.

It can still be booted (I think) but F1 needs to be pressed when on startup which is annoying.

Note that same type but with 275Go capacity doesn’t have same problem.

Update 2017-05-31: Doesn’t work with Z210 CMT either. Same error.

Update 2017-08-04: Forgot to update but the drive does work after I clear out the eDrive mode or something. It was done using Crucial’s SSD utility.

Upgrade Log 3

The last one for this batch! Everything arrived, assembled, and finished without much problem.

Windows 10 is even more annoying than ever. Disabling Cortana now must be done using Group Policy. Great. I have to slowly live it up because this is the future of Windows and I don’t see myself using another operating system for desktop for foreseeable future.

Also, don’t disable universal app background process if you want a functional start menu search.

<insert a bunch of other tweaks here>

Up next

Closest upgrade I can think of is getting an extra 6+To drive so I have 6 drives raidz2 instead of current 5 which is quite a waste. I’m not sure how to migrate the data though. That’ll cost about 25k?

And I remembered about my netbook only having 2Gio of RAM. Surely can be upgraded to 8Gio for maximum lulz. Or just more useful. I remember it’s much more usable when it’s running on 4Gio of RAM. I don’t exactly remember when and why it’s only 2 now. It already has SSD so the RAM upgrade would pretty much max out upgrades for this system. Not counting higher capacity/performance SSD because I don’t think it won’t make much difference apart of having more storage – faster SSD won’t help the slow CPU much. 5k for RAM.

After that, I can certainly use more storage for my main desktop. A 1To SSD would certainly be nice. A bit expensive at 33k.

With storage out of the way (and moves the 525Go drive to office desktop), I think my office server can also use some storage upgrade. Just like current home server, it can certainly use two more drives for optimum raidz2. That means a controller, HDD cage, and one extra HDD (because I already have one spare 3To HDD). The total would be about 51k.

There’s VGA card upgrade for main desktop but I’m still not sure about that. I don’t really need it but certainly would be nice! Let’s pretend it’ll cost 40k for whatever card at that budget whenever the upgrade is happening.

Talking about VGA card, there’s also a would-be-nice upgrade for my office desktop VGA. It’s currently running GT730 which is not quite fast. Limited to 45W, current choice is limited to GT1030 at 10k.

At this point there isn’t much left to be upgraded. So let’s upgrade the server RAM to 32Gio from currently pitiful 12Gio. I would like to pretend it’s cheap but it really isn’t even now. I was pretty lucky last time getting two sticks of 8Gio for just 10k but it won’t happen often. So maybe about 25k I’d be willing to spend.

I think there is no more after this. I probably won’t reach this far until at least next year or even later anyway and something may break in the meantime, requiring change of plan.

  1. (5k) RAM: 8Gio PC3-12800S
  2. (25k+) Storage: 6+To HDD
  3. (33k) Storage: 1To SSD
  4. Storage:
    • (4k) Controller: LSI SAS 9212
    • (7k) Misc: HDD Cage 2 5.25″ to 3 3.5″
    • (15k?) Storage: 3+To HDD
  5. (40k) VGA card: ???
  6. (10k) VGA card: GT1030 (or better)
  7. (25k) RAM: 32Gio PC3-12800E

Total: 164k.

…maybe this will happen sooner than expected ( ゚◡゚)

Upgrade Log 2

“New” “server” has arrived. So have the SATA/SAS controller and hdd backplane.

Unfortunately the 5.25″ bay separator is a bit too big so I had to “fix” it.

The cage works complete with hot swap.

So is the SAS card. Flashed to P20 IT mode without much problem. Someone mentioned it might fail on UEFI motherboard booted to DOS in BIOS mode but I didn’t encounter such problem.

Updated the system BIOS as well.

Processor installed without much problem – finally another server with Ivy Bridge processor. SAS card seems to be a bit problematic when system boot support is enabled. I just disable it and everything seems fine. Ethernet card also installed without problem. SSD thankfully detected without hitch and the OS from previous server boots fine.

Still quite a lot of restructuring needed thanks to two servers being merged but there’s nothing else to do hardware side (unless I decided to buy extra drive to round up the data pool to 6 drives raidz2).

Office server also done the rearrangement and now has more threads but much less memory.

Office desktop is currently gimped a bit with just E3-1225 but that will be fixed once the DDR4 memory arrives. And then the graphics card will get a downgrade from GTX660 to GT730.

Now waiting for the memory. I hope it arrives this month so I can say goodbye to this memory-starved system as soon as possible.

That reminds me, I should put up old stuff for auction…

Upgrade log 1

Ordered the RAM sticks. According to the store they’re on backorder and should arrive in one or two months. Hopefully they actually arrive. And doesn’t take two months.

It’s the most annoying part because barely anyone sells what I want and most of them are stupid overpriced.

On another note, I’ve gotten the all in one server. Should arrive sometime this week.

Accompanying the server, I also secured the drive bay converter and SATA (SAS) controller.

I can then proceed to put it in service once everything arrive. Starting from basic check, reflashing the controller, updating BIOS, and swapping parts. Need to take out 1230v2 from office desktop.

I’m thinking of doing everything at once after the basic preparation is done so I can minimize downtime. It’ll be my router after all. And web server. And storage server. Everything~

If there’s no problem, I’ll continue finishing new office desktop and swapping parts for end state of office server.

That will conclude the most troublesome parts. Assuming everything works as planned, that is.

Sure hope there’s no problem with new Ryzen system~

I will probably end up getting a new SSD though. Or not. We’ll see.

Upgrade plan

It’s time to upgrade my system! Everything! Or not really because some parts are just shuffled around.

Here’s the planned final state.

Home / Server

  • System: Dell PowerEdge T110 II
  • Processor: Intel Xeon E3-1230v2
  • RAM:
    • DDR3 PC3-12800 ECC UDIMM 8Gio x4
  • PCI cards:
    • SATA Controller / LSI SAS 9212-4i
    • Ethernet Controller / Realtek 8111
  • Misc:
    • 2×5.25″ to 3×3.5″ HDD Converter Bay / Century iStarUSA BPN-DE230SS-BK
  • Drives:
    • Seagate 600 SSD 240Go
    • SanDisk Ultra II SSD 240Go
    • Western Digital Red HDD 6To x5 (or 6?)

New all in one server replacing current combination of Microserver and Z210 SFF.

Home / Desktop

  • System: Custom built
    • Case: SilverStone Micro ATX SST-PS07B
    • Power supply: Antec Green 650W / EA-650-GREEN
    • Motherboard: ASRock AB350M Pro4
  • Processor: AMD Ryzen 7 1700
  • RAM:
    • DDR4 PC4-19200 ECC UDIMM 16Gio x2
  • VGA: ASUS GeForce GTX950 / GTX950-2G
  • Optical drive: TSST (Toshiba Samsung) DVD-ROM 16x
  • Drives:
    • Crucial MX300 SSD 525Go
    • Samsung 840 SSD 250Go
    • Western Digital Blue HDD 250Go x2

Now with 100% more modern everything. No, just new processor/motherboard/RAM.

The VGA and SSD can use better upgrade but those will do for now.

Office / Server

  • System: HP Z210 CMT
  • Processor: Intel Xeon E3-1235
  • RAM:
    • DDR3 PC3-10600 ECC UDIMM 4Gio x2
    • DDR3 PC3-10600 ECC UDIMM 2Gio x2
  • Misc:
    • 1×5.25″ to 1×3.5″ HDD Converter Bay / Century iStarUSA BPN-DE110SS-SV
  • Drives:
    • Transcend SSD370 SSD 512Go
    • Samsung 850 EVO SSD 500Go
    • Seagate 7200.10 (or 11?) HDD 3To x5 (4 connected due to lack of SATA ports)

Processor is upgraded from E3-1225 but RAM is downgraded from 20Gio total.

Office / Desktop

  • System: HP Z210 SFF
  • Processor: Intel Xeon E3-1270
  • RAM:
    • DDR3 PC3-10600 ECC UDIMM 8Gio x4
  • VGA: MSI GT730
  • PCI cards:
    • USB 3 Controller / Inateck 2 Ports USB3
  • Optical drive: HP DVD-RW 16x?
  • Drives:
    • Crucial MX300 SSD 275Go
    • Seagate Barracuda HDD 250Go x2

Another victim here. The RAM is now ECC but the VGA is downgraded far from GTX660 which I’m moving to somewhere far away.

Notes

Now I look again there’s possibility the current drive structure plan to not work because of compatibility problem. I will need to figure that out later and shuffle the drives around as need. I should’ve taken memo of the compatibility problems I encountered.

NEC Express5800/53Xg review

More reviews! I’ve always wanted to write these because there doesn’t seem to be many information on those. Most likely because they’re branded PC. Not only that, they’re branded workstation PC. Expensive new but dirt cheap second hand. Being workstation, I also expect them to last quite a long time.

Anyway, after the uselessness of Z210 SFF for desktop, I got its CMT version and used it for a while. That one has relatively similar specs, just larger and fit normal GPU and can supply enough power to it. There’s no problem with it except being large.

Surfing around Yahoo! Auction again, this time I found this NEC Express5800/53Xg. At 14100 yen total with shipping, it came with E3-1225, 4Gio of RAM, and two 250Go WD Blue hard drives.

Unlike the HP counterpart, this one is noisy. So bad that I ended up replacing the front 8cm fan with my spare Gelid fan. It helped a bit. Then I replaced the CPU HSF with the only one that seems to be compatible with it, Thermaltake Engine 27. It helped a lot. I also put some resistors on the tiny back fan. Also helped a lot.

Thankfully the headers are standard and BIOS doesn’t stop when it spots missing fans.

Unfortunately, it resulted in hot CPU. Mainly because the replacement HSF is rated for 70W TDP CPU while the installed CPU is 80W. Whoops. At least it works. Most of the time. Just a bit hot. 100°C hot.

And it’s still kind of noisy.

It doesn’t support Ivy Bridge CPU either so I can’t use E3-1230v2 which has 69W TDP.

On the bright side, it uses riser so it accepts full sized GPU. And the motherboard can also supply full 75W to it.

In the end, it’s usable for desktop. Kind of.

The other problem is it only has 2 RAM slots, maxing out at 16Gio. I thought it’s enough. Except it isn’t. Task manager is currently showing I’m using 14.6Gio which isn’t quite comforting. Electron apps are to blame but in the end I just need more RAM because I ultimately use those apps.

(WthasApp using 300Mio? Really? And Slack 500Mio? What the hell is this?)

It also has two gigabit ethernet which I have no use of.

Another small complain is it’s got slim DVD which isn’t as nice as normal drive. Mainly the attaching the disc part.

Internally there are only three SATA ports. And the hard drive cage, while completely standard, is a pain to install/remove drives with because it needs full removal of optical drive and the cage itself.

My unit didn’t come with rubber feet so I used this thing. Works pretty well.

Conclusion

  • usable for desktop (it’s my current desktop)
    • except it’s noisy and/or hot
  • should be fine for server as well if 16Gio is enough

The noise pretty bad and the heat is worrying so I’m considering replacing it with something else. Of course there’s Ryzen. But it’s expensive and is way more than what I need. It also won’t run Windows 7 unless Microsoft backs their stance. I may consider it next year but for now I don’t think it’ll happen. Maybe it’ll happen sooner than I thought.

Alternatively there’s another workstation candidate: Fujitsu Celsius J510. It also seems to support full sized GPU. Assuming it’s not too long, that is. Turned out the PCIe slot is at the bottom which means it only supports single slot GPU. Nope.

HP Z210 SFF review

I got this last year for a total of 6026 yen with shipping. It didn’t come with CPU though. And I don’t remember it came with RAM either. Thankfully everything works.

First on motherboard. I don’t remember it has standard fan headers. At all. Well, it’s only got a total of one fan anyway. And that doubles as CPU fan, no less. Okay, I lied, there’s another one inside PSU which has weird form factor.

At least they are relatively silent. I have no complaint on noise department.

CPU support is limited to Sandy Bridge series. No v2 CPU or i3 3xxx series. Don’t bother trying. I did.

RAM support is okay. It only supports maximum of PC-10600. There’s ECC support though and at 4 slots, it maxes out at 32Gio.

GPU support is the worst thing about this PC. The PCIe slot being limited to low profile isn’t too bad nowadays with proliferation of small sized no external power started by GTX750. But the problem is none of them will work. Or at least specification wise. The reason is the motherboard only officially supports providing PCIe slots with 45W at most. That’s 30W less than what those GPU needs. The fastest consumer level GPU I can find is GT730. It sucks and noisy. Noise part can be mitigated by getting MSI card and adjusting fan speed curve accordingly but I generally don’t like installing crapware on the already crap Windows.

The absolute fastest one can get for this is Quadro K1200, by the way. At over US$300, I’m not sure if it’s worth buying.

USB ports also occasionally stop working on Windows 10. I vaguely remember it’s fine on Windows 7 but some changes on Windows 8 caused it to occasionally not working on boot. The only fix I have is to remote desktop into it and reinstall USB driver. Installing additional USB card didn’t help either from what I can remember.

Oh, and SmartOS doesn’t support the SATA controller because it is in RAID mode. Switching it to IDE emulation works but no one should do that. I’d just buy a SATA PCIe card instead if I really want to use SmartOS on it. Which I haven’t yet.

It’s got two SATA3 ports and two SATA2 ports. Note that it only has 1 external 5.25″, 1 external 3.5″, and 1 internal 3.5″ bays. I used a HDD 5.25″ converter to get one extra bay and dumped two SSDs to max out the storage (2 HDD, 2 SSD). Just remember that one SATA power cable splitter is needed.

Mine didn’t come with the screws needed for installing HDD at the back side but there are plenty of them for cheap in eBay. Those are of doubtful quality but as they’re just screws, I don’t really care that much. Just look for “hp sff hdd screws.”

Conclusion

In term of purpose, it goes like this:

  • best as personal non-storage server
  • don’t bother for desktop if using large monitors (1080p+?)
  • with additional SATA card, can also be used as SmartOS box

And yeah, it’s where some of my sites are currently hosted at.

Left handed mouse

I’ve been using mouse left handed for a long while after (kind of) breaking my right hand thanks to playing a bit too much rhythm game and too lazy to visit doctor (and that it doesn’t hurt that much).

I initially switched the button using Windows’ built-in mouse button setting but learned that it breaks in various ways ranging from application not honoring the setting to just plain annoyance to having to set the thing at all.

Later I found this hardware-stored profile for certain mice and I’ve been happily using mouse left handed ever since.

There are quite a few things I noticed from switching side.

One main thing I first noticed is how much keyboard shortcuts are located on left side. From the most basic copy/paste, browser tab open/close, closing app, switching app, switching tab, escape key, and some keyboards don’t even have windows key on right side. Those are cause a slight annoyance when using mouse left handed because that means I need to switch position more often than needed. Either that or I just right click and do copy/paste stuff and set my mouse’s 5 additional buttons to do those tasks. I like my mouse.

The other thing is keyboard and mouse positioning is actually more balanced when using keyboard with numpad. The main keys on keyboard are pretty much located on the middle with numpad on right side and mouse on left side. Very convenient.

Oh and I have profile for both sides on my mouse so it’s just clicks away to switch its handedness.

I haven’t used right handed mouse for so long I find it weird now. And my accuracy have dropped as well. Combined with my left hand not being that accurate yet, I probably have overall even less accuracy on my mouse control now.

VirtualBox again

Due to reasons I swapped my web server (was in VM) and VM box role. Or more like web server is now bare metal and functions as VM box. It’s downgraded from real virtualization (Hyper-V) to VirtualBox though.

That said, FreeBSD doesn’t seem to be quite fully functional on Hyper-V thanks to performance hit and slow disk detection on boot causing failure.

Yeah, I’ve had enough of it so I decided to swap the role and run the web server directly on the server instead.

On the bright side, I can use zfs for everything and no more stupid SSD setup (it was unbalanced 500 and 250 GB disks).

VirtualBox seems to be flaky as always though apparently once it’s setup correctly it runs without much trouble. Also thankfully VirtualBox on FreeBSD has complete scripts for running it headless and autostart on boot.

This was also my main setup for quite a long time years ago and I sure hope it’s at least as stable as it was back then! That said, the initial setup seems to be flakier. Oh well.

Memo and stuff.

Ruby 2.3 on FreeBSD 11

Note: outdated. Check this post instead.

Compiling Ruby on FreeBSD is not quite simple.

  • make sure to tell it to also find libraries in /usr/local
  • and tell configure script to find OpenSSL in /usr because the later version isn’t quite compatible with latest ruby yet

So here’s the configure line

CFLAGS=-I/usr/local/include \
CPPFLAGS=-I/usr/local/include \
LDFLAGS=-L/usr/local/lib \
./configure --prefix="/opt/ruby23" --disable-install-doc --with-openssl-dir=/usr \
&& make \
&& make install

Miura Fold

This is mostly for my own reminder.

  1. Google “miura fold”
  2. Read some articles, watch some videos
  3. Remember this:
    1. Long/initial fold must be odd-numbered.
    2. Short/following fold must have approximately same degree.
    3. Open up, fold following the short, zigzagged lines.
    4. ???
    5. Profit?

Not sure if useful.

PHP 7!

Panzer vor! (☞゚∀゚)☞

Panzer vor! (☞゚∀゚)☞

# (build machine since the server itself doesn't have enough memory to build PHP)
root@openbsd:/var# /opt/php7/bin/php --version
PHP 7.0.0 (cli) (built: Dec  4 2015 21:50:31) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
root@openbsd:/var# uname -a
OpenBSD openbsd.myconan.net 5.8 GENERIC#1170 amd64

Oh look, this blog is now running on PHP 7 (under OpenBSD). Apart of OpenBSD-specific mysql socket path, everything seems to be working fine out of box. It seems to be slightly faster as well? Or maybe not, I guess WordPress is just so slow and no amount of speed ups can fix it.

Hopefully OpenBSD 5.9 will have it by default. Still no ports in sight though.

Configure parameters:

./configure --prefix=/opt/php7 --enable-fpm --with-openssl --with-pcre-regex --with-zlib --enable-bcmath --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-gettext --with-gmp --with-mhash --enable-intl --enable-mbstring --with-mysqli --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-mysqlnd --with-webp-dir=/usr/local --with-jpeg-dir=/usr/local --with-freetype-dir=/usr/X11R6 --with-png-dir=/usr/local

Rails and Bootstrap

This hit me when I was rewriting front-end part of Zeropaste. Of course later I found out that there’s gem for it.

But anyway, if you don’t want to add another gem and feel like writing crapload of divs, it’s not that difficult. It breaks Rails standard form error handling though.

First, change the default error field handling to do nothing instead of wrapping it in a div:

config.action_view.field_error_proc = proc { |html| html }

(put in application.rb)

And then create this helper:

def error_class(object, attribute)
  "has-error" if object.errors.include? attribute
end

Finally, here’s how to use it (for attribute key of a model):

<div class="form-group <%= error_class f.object, :key %>">
  <%= f.label :key %>
  <%= f.text_field :key, :class => "form-control" %>
</div>

…and done.

Compiling xpdf (pdfimages) for Windows

…on a FreeBSD system. I recently needed a modified version of it for a good reason. Only tried for its pdfimages. Probably works for other components as well.

  1. Install these packages:
    • mingw32-bin-msvcrt
    • mingw32-binutils
    • mingw32-gcc
  2. Download, extract, go to xpdf source.
  3. ./configure --host=mingw32 --target=i686-mingw32msvc --build=i686-linux
  4. make pdfimages
  5. ???
  6. Profit!

Whoops, almost forgot one last step. Produced binary from steps above will require additional libraries to start. To make it run with just the binary, rerun the last compile command (from output of make) with additional arguments: -static-libgcc and -static-libstdc++.

[ Reference for configure script arguments | Reference for static build ]

Network performance checklist: TSO/LSO

Took me good few hours to find out why specific combination of task performs incredibly slowly on my server.

For reference, in my case it’s port-forwarded ssh/https connection over openvpn.

[ Client ] --(Internet)--> [ Gateway ] --(OpenVPN)--> [ Server (SSH) ]

Doing anything which takes up bandwidth (displaying log files, etc) will shoot the cpu load (at interrupt) up by a lot. By a lot I mean over 50% of one core.

This guy have the reasoning why it’s happening but I don’t know how much of it is correct. VMware support page also suggesting disabling it if network performance is slow.

In FreeBSD it’s:

echo 'net.inet.tcp.tso=0' >> /etc/sysctl.conf

In Windows it’s this .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters]
"DisableTaskOffload"=dword:00000001

It seems to involve a shell script in Linux so I won’t bother writing it off here since it differs by system.

As usual, YMMV.

…and there goes my time 🙁