Sunday, December 19, 2021

QEMU/KVM/virt-manager guest can't access network in bridged mode with iptables

I could not access the network in a guest VM using bridged networking. To fix I had to set the following in iptables:

# iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
# ip6tables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

Sound stops working in Linux

If your sound stops working in linux, you may see errors about being unable to connect to ALSA, or mplayer might say "Audio device got stuck!". If you don't want to reboot, killing pulseaudio will usually do the trick:

$ pulseaudio -k

Sunday, April 11, 2021

View all packages installed from overlay in Gentoo Linux

To easily view which packages were installed from which overlay, using app-portage/eix:

eix --installed-in-overlay <optional overlay name>

If you do not specify an overlay name, it will show all packages from all overlays.

Sunday, January 3, 2021

Neo Geo AES Memory Card Management

I recently got an aftermarket Neo-Geo memory card (one which uses F-RAM instead of battery backup) and needed to format the card before using it. There is a built-in memory card management menu on the AES: with a game inserted, hold ABCD on controller 1 and power on the system. Translation of the menu is below:

メモリーカード ユーティリティ-
Memory Card Utility

1 カードのフォーマット
1 Card Format

2 データネームのひょうじ
2 Display Of Data Name

3 データのコピー
3 Copy Data

4 データをけす
4 Erase Data

5 ユーサーネームとうろく
5 Username Registration

6 おれる
6 Break (Exit Menu)

Thursday, October 8, 2020

SQL Server Management Studio (SSMS) 18.x won't save server passwords

Starting around SSMS 18.x, Microsoft changed the way credentials were stored. This caused any saved passwords from previous versions to stop working in the server connection dialog popup.

To fix this, just delete the servers from the drop-down list. Alternatively, exit SSMS, clear out the saved servers in C:\Users\%username%\AppData\Roaming\Microsoft\SQL Server Management Studio\18.x\UserSettings.xml and then restart.

If you use registered servers, the saved passwords will still work and will automatically be saved into the popup. If not, you'll have to type them in again.

Friday, October 2, 2020

Monday, September 21, 2020

PC Engine HuCard Volumes

Originally posted at the pcenginefx forums and reposted here in case that site disappears (update: it did). The PC Engine HuCard volumes:


  1. The Kung Fu
  2. Bikkuri World
  3. Victory Run
  4. Shanghai
  5. Necromancer
  6. Kato chan & Ken chan
  7. R-TYPE I
  8. Yuu Yuu Jinsei
  9. R-TYPE II
  10. Sengoku Mahjong
  11. Power League
  12. Mashin Eiyuuden Wataru
  13. Appare! Gateball
  14. Sadakichi Seven
  15. Dungeon Explorer
  16. Nectaris
  17. Susa No Ou Densetsu
  18. Power Golf
  19. Gunhed
  20. Power League II
  21. Super Momotarou Dentetsu
  22. Doraemon Meikyuu Daisakusen
  23. Neutopia
  24. PC Genjin
  25. Blodia
  26. Blodia Special
  27. Maniac Pro Wrestling
  28. Be Ball
  29. Momotarou Densetsu Turbo
  30. Super Star Soldier
  31. Power League III
  32. Momotarou Katsugeki
  33. Aero Blaster
  34. Bomberman
  35. Momotarou Densetsu II
  36. Jackie Chan
  37. Populous
  38. Adventure Island
  39. Power Eleven
  40. Final Soldier
  41. PC Genjin 2
  42. Power League IV
  43. Neutopia II
  44. Raiden
  45. Super Momotarou Dentetsu II
  46. Doraemon - Nobita No Dorabian Night
  47. Ninja Ryūkenden
  48. Paxanadu
  49. Takahashi Meijin No Shinboukenjima
  50. Soldier Blade
  51. Power League V
  52. Honou No Doukyuuji Dodge Danpei
  53. Power Sports
  54. PC Denjin - Punkic Cyborgs
  55. Momotarou Densetsu Gaiden Daiichi
  56. Bomberman '93
  57. Battle Lode Runner
  58. PC Genjin 3
  59. Power Tennis
  60. Power League '93
  61. Bomberman '94

NCS Masaya

  1. Gaia No Monsho (Regarded as volume 1 although there is no number on the spine)
  2. Moto Roader
  3. Ganbare! Golf Boys
  4. Shubibinman
  5. Energy
  6. Double Dungeons
  7. Gai Flame
  8. Hisou Kihei Serd
  9. Nazo No Mascarade
  10. Kickball
  11. Wallaby
  12. Shubibinman 2
  13. Moto Roader 2
  14. Dragon Egg


  1. Vigilante
  2. Mr Heli No Daiboken
  3. Image Fight
  4. Ninja Sprit
  5. Legend of Hero Tonma
  6. Racing Damashii
  7. Gekisha Boy


  1. Out-Live
  2. Benkai Gaiden
  3. City Hunter
  4. Mahjong Goku Special
  5. Batman

Nihon Bussan/Nichibutsu

  1. Mahjong Wars
  2. F1 Circus
  3. ?
  4. F1 Circus 91
  5. Fighting Run
  6. Terra Cresta II
  7. F1 Circus 92
  8. J-League Greatest Eleven


  1. Hani In the Sky
  2. Cyber Cross
  3. Mahjong Gakuen
  4. Mahjong Gakuen Mild
  5. Ryuukyuu
  6. Hani On The Road
  7. Fushigi No Yume No Alice (Alice In Wonderdream)
  8. Cross Wiber
  9. Metal Stoker
  10. Time Cruise II


  1. Atomic Robo-Kid Special
  2. Gomola Speed


  1. Bullfight


  1. Makyo Densetsu
(Victor released many more hucards after this but none have a volume number.)


  1. Klax

Big Club/Wolf Team

  1. Jinmu Denshou

Copy & Paste does not work in Firefox on Google Docs

Firefox blocks certain clipboard events by default. This breaks some Google Docs functionality. To reenable it, go to about:config and set dom.event.clipboardevents.enabled to true

Please be aware that this is a global setting and allows all websites access to your clipboard, which is a potential privacy/security risk.

Prevent Gentoo Portage from unmerging kernel sources during a world upgrade

Portage typically unmerges all but the newest kernel sources, while I'd prefer to leave the sources to the running kernel and backup kernel installed. I don't reboot very often and I don't bother to build an updated kernel until I'm ready to reboot, just in case there are any issues. I also like to keep the sources to the previous kernel around just in case I need to revert.

A tip posted on the Gentoo user mailing list in 2009 by Mike Kazantzev shows how to accomplish this:

First, define a kernel set in /etc/portage/sets.conf:

class = portage.sets.dbapi.OwnerSet
world-candidate = False
files = /usr/src

Tthen add the @kernel set to your /var/lib/portage/world_sets file.

By doing this, you will need to manually unmerge the specific kernel source packages you want to remove, but none of them will ever be removed otherwise.

Determining the manufacturer and recording medium of a blank CD or DVD

Every recordable CD and DVD actually has a little bit of data on the blank disc. On CDs this is called the ATIP (Absolute Time in Pregroove) and contains things like the manufacturer, length, dye type, and rated speed. This information is used by the disc drive to choose the optimal burning strategy. 

Keep in mind this info can be faked (Hong Kong manufacturers putting fake TY01 codes on their discs was a thing when Taiyo Yuden discs were in high demand). And the dye type is not necessarily the actual dye type used, but the hint to the drive about which burning mode to use (I've read that azo discs are burned using the cyanine strategy).

To view the atip of a CD-R/CD-RW on Linux using the cdrecord package:

# cdrecord -atip

Recordable DVDs have a similar area called the Media Identification Code. To read this information on Linux using the dvd+rw-tools package:

# dvd+rw-mediainfo /dev/sr0

SQL: Get just the date part of a DATETIME on SQL Server 2005

In Microsoft SQL Server 2008+ there is a DATE type, and getting just the date portion of a DATETIME is as easy as a cast or convert to DATE. But, at my job, we're still using SQL Server 2005. What then?

A common technique is to cast to a float, which gives you a number where the part to the left of the decimal point is the date and the part to the right of the decimal point is the time. Wrap that in a FLOOR function to round down to the nearest whole number and you have effectively truncated the time portion. You can then cast that back to a DATETIME.

I have, however, read that doing it that way can be inefficient as it won't use DATETIME indexes. Another approach that it supposed to be more efficient is to use DATEADD and DATEDIFF like so:


Again, there is no reason to do that unless you are on a Microsoft SQL Server version prior to 2008.