This is so damn useful to turn on and off remote displays through SSH, for wall-mounted information screens and similar. Available in your friendly neighbourhood Linux distribution. VBETOOL(1) User Commands VBETOOL(1) NAME vbetool – run real-mode video BIOS code to alter hardware state SYNOPSIS vbetool [[vbestate save|restore]|[vbemode set|get]|[vgamode]|[dpms on|off|standby|suspend|reduced]|[post [romfile]]|[vgastate on|off]|[vbefp pan‐ elid|panelsize|getbrightness|setbrightness|invert]] DESCRIPTION vbetool […]
So the VM is using too much space, and the disk image needs to grow. Previously I used dd with a bunch of options to do this. However, the truncate tool makes the whole ordeal a lot easier. A simple command, such as the following, will grow the file disk.img by 10 gigabytes: truncate -s […]
Something completely unrelated to this blog thing, but I feel I have to put it somewhere. I recently did some mechanical work on an Aeon Cobra 50cc (AT70 in the registration) and spent a few evenings looking up information about it. The Aeon Cobra 50cc is sold in several Nordic countries as the GOES 50s. […]
To avoid holding up everything else when deleting massive amounts of data from an SQL Server table, you can use the TOP() function to delete the data in chunks. SELECT 1 WHILE @@ROWCOUNT > 0 BEGIN DELETE TOP(1000) FROM [dbo].[mytable] WHERE timestampUtc < ‘2015-05-29’ END The “SELECT 1” primes the @@ROWCOUNT variable, so the while […]
Quick reference on how to remove only the duplicate rows when attempting to add a unique index: WITH custom AS ( SELECT [projectId], [zoneId], [type], [name], RN = ROW_NUMBER() OVER (PARTITION BY [projectId], [zoneId], [type], [name] ORDER BY [projectId]) FROM [mydata].[dbo].[Properties] ) DELETE FROM custom WHERE RN > 1
noah.org has an excellent writeup on this. Link here, archive here.
Found this on xiph.org. If you think you need 24 bit audio, and that you can actually hear the difference, you need to read it. You also need to do a blind test with their provided audio files. Archived here, just in case.
Just learned something neat: In XChat, if you hold ctrl and shift, and then press “u”, followed by “a”, you get a weird character that signifies a line break. This can be used to put several commands on one line in the configuration, or to type several lines before spamming them all at once into […]
To avoid locking a table for a damn long time, this is how Google told me to do mass copies of data in Microsoft SQL Server: DECLARE @BatchSize INT = 1000 DECLARE @IdMax INT = 25179272 DECLARE @i INT = 0 WHILE @i <= @IdMax BEGIN INSERT INTO [mydata].[dbo].[ProjectEventValues] WITH (TABLOCK) ([projectId] ,[descId] ,[index] ,[controllerId] […]
I recently had to repair the Switched Mode Power Supply for my RockWheel (a one-wheeled electric “vehicle”). Looking around for some general guidelines, since I hadn’t touched line voltage in a while, I found this guide over here useful. Archived here for archival purposes…