Skip to content

Instantly share code, notes, and snippets.

@phil294
phil294 / main.js
Last active May 19, 2021 20:44
Migrate MongoDB collection to SQLite DB table using Javascript/Deno
import { DB as SqliteDB } from "https://deno.land/x/sqlite/mod.ts"
import { MongoClient } from "https://deno.land/x/mongo@v0.22.0/mod.ts"
const sqlite_db = new SqliteDB("out.db")
sqlite_db.query('drop table if exists posts')
sqlite_db.query("CREATE TABLE posts (id INTEGER PRIMARY KEY AUTOINCREMENT, message TEXT)")
const client = new MongoClient()
await client.connect("mongodb://localhost:27017")
const mongo_db = client.database("my-db")
@phil294
phil294 / undo.md
Last active January 2, 2021 14:35
Undo/reverse an accidental "Forget about this site" click in Firefox history

If you have a backup of the old places.sqlite file (of the old Firefox profile folder), you can simply replace the new one with the old one or you can do the following. Meant for MacOS/Linux systems, on Windows you'd probably also need to install sqlite.

Close Firefox and copy the new places.sqlite and the old places.sqlite, renamed as old.sqlite, into a folder.

sqlite3 old.sqlite

You need to adjust the-site-to-restore.com to your needs below.

attach "places.sqlite" as new;
insert or ignore into new.moz_places select * from main.moz_places where url like "%the-site-to-restore.com/%";
@phil294
phil294 / n3DS_view.md
Last active October 3, 2023 05:42
Running Keity/Katsukity's n3DS_view.exe for 2DS Capture Card on Linux using QEMU VM and USB passthrough

Solution for running n3DS_view.exe, the driver software for 2DS (old 3DS) made by NON-STANDARD, on Linux devices.

Cute3DSCapture is great but it cannot handle Keity cards, it only works with Loopy cards. WineHQ does not seem feasible either because I don't think there is a way to install the USB driver. When contacted, Non-Standard said they do not plan on releasing a Linux-compatible build of the software. Running some kind of VM seems the only viable solution – thus this guide.

I tested the following on Manjaro Linux (Arch Linux based) with n3DSview_ver701_r6 (Keity_old3dsview from merki.net). _r5 etc. should also work, they simply refer to different revisions but may not include the DirectX setup which you then need to install manually on the Windows guest. Please note that you will need a Windows license, and Audio capture does not work. You can still record