Skip to content


How to make Tor Browser remember permission settings across sessions

Warning: this is not recommended at all, as it makes it easier to link your different browsing sessions. I’m actually mainly posting it here for future reference on how to disable it. If you really do know what you’re doing, read on.

It’s simply a boolean setting: in about:config, set permissions.memory_only to false if you want Tor Browser to remember your permissions from a browsing session to another. This can be used for instance when you’re tired of being asked for permissions to use HTML 5’s Canvas-of-Doom. Personally, I’d prefer an easy setting to just kill Canvas once and for all.

Posted in privacy, security, Tor.


A few things I learned from my Windows 10 disaster recovery

After a crash, Windows 10 managed to restart but decided its partition should be “fixed”. So I rebooted to let it “fix” it, which caused it to become unbootable. My few recovery attempts failed, and since I had a partition setup that would preserve my important data (ie, everything except what the stupid programs decide to store into %appdata%), I quickly reinstalled. And learned a few interesting things in the process.

About installing over a previous Windows

First, when you install Windows on a partition which already contained Windows, it warns you it will move the previous Windows installation to a Windows.old folder. I was afraid it would only move the former “Windows” folder there, but it turned out it moved everything on the partition there (NB: I only had standard folders, like Users, Program Files, etc, so I’m not sure it would also move custom root folders although my guess is it probably would). Pretty handy to grab your former program settings (those in %appdata%, sadly not those in the registry), documents (I got to keep my desktop contents, yay), etc.
Edit: well actually, something strange happened just the day after I wrote this part: most of the contents of that Windows.old folder vanished overnight… :s So now I’m happy I used a Linux LiveUSB (NB: Tails is nice for that, as it’s pretty small) to duplicate the contents of the C: partition elsewhere myself.

About Cortana and other bloatware

Second, there exists a version without Cortana, Windows Store, and Windows Media Player. It’s version N (without Windows Media Player) and Long Term Servicing Branch (LTSB), which is without Cortana, Windows Store, but also the Edge browser, Photo Viewer and the UWP version of Calculator. Wikipedia has a nice page detailing the different editions and notes that Windows 10 Enterprise N LTSB is the most stripped down edition of Windows 10 available.

The N flavor will create some issues for video playback in your browsers. For instance, Youtube will work, but Twitch won’t (there are other ways to watch Twitch streams though, for instance Streamlink). If that turns out to be a blocker, however, you can download a patch by Microsoft (the “Media Feature Pack”), which will restore those functionalities. So there’s no risk in trying out N, it’s not irreversible.

The LTSB comes without Edge, so I was wondering if I’d need Firefox on a stick to get started 😉 But it turns out it contains… good old Internet Explorer 11. The lack of Photo Viewer means your pictures will open in Paint (or Internet Explorer as usual for the GIFs). I still have to find a replacement, because opening pictures in Paint works great but I find it a bit risky (I’m always afraid to accidentally draw a few pixels and save)

About PuTTY and my backup software

Third, I already used it before but I had forgotten about it, PuTTY settings can be easily exported to a reg file with this command:

regedit /e "%userprofile%\Desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham

(source)
Of course, this only works on a working Windows. In my case I gladly had those settings +/- duplicated exactly on another computer, so yay ^^

Fourth (and last for this post ^^), backup software are unequally easy to migrate.
For SpiderOak, I simply copied the old AppData/Local/SpiderOak folder and then reinstalled SpiderOak, and it behaved just as if nothing changed.
For LiveDrive, I used a backup I had of the registry settings (and found nothing of value in %AppData%), and it recognized the computer but had lost the most important backup settings (namely, which folders to back up, for fucking fuck sake)

Well that will be all. Hopefully I won’t have a use for this in the future, but for some reason I’m pretty sure I will :/

Posted in Windows 10.


Emojis in a MySQL database

A while back, I’ve had issues when user input contained an emoji: the database field would then cut after (and including) the first emoji). My table seemed to be configured properly for Unicode though, so that was a bit puzzling.

It turned out that “utf8“, in MySQL/MariaDB language, doesn’t actually mean the real, proper UTF-8: it contains a MySQL-specific limitation preventing use of characters numbered above 0xFFFD (source, with also a comparison between utf8mb4_unicode_ci and utf8mb4_general_ci). So you’ll want to use utf8mb4, which is the real deal and will store emojis without issue.
The good news is, if you already have an utf8 database or table, the migration may be as easy as just switching the column types (still you should make a backup first, just to be safe), at least for me it was. You might want to have a look at this first, though: How to support full Unicode in MySQL databases.

While looking into this, I also found some stuff about utf32. Not sure if I’ll ever use it but here it is for bookmarking purpose.

Sorry that was once again a brief post, I’m cleaning up my tab groups because after Firefox decided to kill the feature, they now also killed the extension that tried to continue the feature… Thanks again Mozilla! 😡

Posted in web development.


How to generate a file of a specified size on Windows

The command is:
fsutil file createnew [filename] [size in byte]

Note that it doesn’t generate random contents: the contents is all zero bytes. If you want a random file, you can use something like Random Data File Creator, or encrypt a zero file that you generated with fsutil (I find AES Crypt pretty convenient for that purpose)

Posted in Windows.


How to get rid of Music.UI.exe

Lately (maybe since last month), I’ve had that Music.UI.exe executable, located in C:\Program Files\WindowsApps\Microsoft.ZuneMusic_3.6.19261.0_x64__8wekyb3d8bbwe, regularly (like, every few hours) popping up in my firewall, trying to access the network 😮 Every time, I denied it and killed it, but it kept coming back.

I tried deleting the file, with no success (permission denied, even as admin).
I eventually found the solution: go to Settings > Privacy > Background Apps, and turn off Groove Music. While you’re at it, you might want to disable the shitload of other apps that are there too.

Posted in Windows 10.


How to prevent Windows 10’s auto volume reduction?

Sadly this time it is still an open question.
Whenever there’s a system beep sound, Windows 10 automatically lowers the volume of everything else for a pretty damned long while (maybe 5-10 seconds). This is particularly annoying when trying to adjust the volume, as adjusting the volume will itself generate a beep, causing the volume to be automatically reduced (WTF were those engineers thinking when then did that? :o).

Anyway, apparently this could be caused by Windows trying to be smart and “guessing” that you are using VoIP, and then reducing the volume of other activities so that you can hear your communication better. The solution, as I found there for instance, would be to disable that feature, by going to system sound settings, then in the “Communications” tab and choosing “When Windows detects communications activity, do nothing” (the default is a huge “reduce the volume of other sounds by 80%” :o).

Sadly, for me it didn’t do the trick, even after a restart (which was suggested there).

I’m running out of ideas to fix this (already), so if you have a magical solution do post it in the comments ^^

Off-topic bonus: apparently Windows 10 comes with an annoyance called Xbox DVR, which doesn’t seem to be necessarily linked to owning an Xbox and can fuck up performance in some games. Steam provides a guide to disable it there.

Posted in Windows 10.


aToad #23: Dan’s Tools

Lots of little development-related tools

This time it’s not one tool but a pretty large collection of tools. I found Dan’s Tools while looking for a Unix timestamp to date and time converter (or the other way around), but the site also have many other helpful little (or not that little) things, such as:

  • HTML formatter
  • Javascript formatter and minifier
  • JSON formatter, minifier and validator
  • PHP formatter
  • Python formatter
  • Ruby formatter
  • SQL formatter
  • CSS sprite generator
  • Regex testing
  • SHA-1 hash generator
  • URL encode/decode

… and some more. Quite a tool belt 🙂

Posted in A Tool A Day, programming.


My Visual Studio Code config file (TypeScript-oriented)

Just to find it easily whenever I switch computer, my Visual Studio Code user settings file (for TypeScript development):

{
  "telemetry.enableCrashReporter": false,
  "telemetry.enableTelemetry": false,
  "typescript.disableAutomaticTypeAcquisition": true,
  "files.exclude": {
    "**/*.js": { "when": "$(basename).ts"}
  },
  "git.enabled": false,
  "git.path": null,
  "git.autofetch": false,
  "workbench.iconTheme": null,
  "typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib",
  "typescript.autoImportSuggestions.enabled": false,
  "update.channel": "none",
  "extensions.autoUpdate": false,
  "php.executablePath": "D:\\PROG\\PROGRAMMING\\xampp-7.0.8\\php\\php.exe",
  "php.suggest.basic": false,
  "editor.insertSpaces": true,
  "editor.tabSize": 2,
  "files.eol": "\n",
  "workbench.settings.editor": "json",

  "update.showReleaseNotes": false,
  "extensions.showRecommendationsOnlyOnDemand": false,
  "workbench.settings.enableNaturalLanguageSearch": false,
  "workbench.enableExperiments": false,
  "npm.fetchOnlinePackageInfo": false
}

It should be quite self-explaining in most part, but what these settings do is:
– disable telemetry and crash reporter
disable checking for mismatch between VSCode’s TypeScript and the globally installed TypeScript (“typescript.check.tscVersion”=false) (which gives a pretty annoying warning that can’t be permanently dismissed and shouldn’t be a problem if you update everything regularly) This was apparently removed at some point
– disable Automatic Type Acquisition (ATA)
– hide .js files when a .ts file of the same name exists
– disable Git integration (probably the 3 settings I used are a bit redundant though), although in the end I reactivated it because it’s pretty convenient to spot which lines you recently edited
– disable the file icon theme (“workbench.iconTheme” = null), which was enabled by default in version 1.13 and looks pretty nice indeed, but wastes too much space IMO and is a bit useless if your project is well-organized
– use my globally-installed, up-to-date TypeScript, rather than the one included in VSCode (which can be a bit outdated sometimes). NB: you can use npm list -g typescript to find out where your TypeScript package is globally installed
– disable Auto imports (added in TypeScript 2.6), because they seem buggy ATM and tend to import lots of unwanted trash for no good reason
– disable update-checking (“update.channel” = “none” and “extensions.autoUpdate” = false): my original hope was to prevent VSCode from sending mysterious and unsolicited network requests, but despite auto-update and extensions updates being turned off it still sends network requests :/
– use 2 spaces as indent instead of tabs. Note that by default VSCode already replaces tabs with spaces (editor.insertSpaces is true), but it uses 4 instead of 2 (editor.tabSize is 4 by default)
– use LF (rather than CR,LF – “\r\n”) as default line ending

Update (2017-12-21)

Added some stuff for PHP (for the PHP IntelliSense plugin)
{
“php.executablePath”: “C:\\…..\\php\\php.exe”,
“php.suggest.basic”: false
}
– php.executablePath gives the path to the PHP binary
– php.suggest.basic is set to false to avoid conflicts between the plugin and the native (basic) PHP auto-completion

Update (2018-08-16)

Added some stuff (from “update.showReleaseNotes” to “npm.fetchOnlinePackageInfo”) that are supposed to make Visual Studio Code work fully in offline mode. Nice initiative (better late than never, eh), but sadly there is still an ongoing request with those settings, not sure where it comes from. That’s still fewer requests than before, plus at least I don’t get warning messages when I block the request, so it’s definitely an improvement even if it’s not perfect yet.

Update (2018-09-17)

Added "workbench.settings.editor": "json" to disable the graphical settings editor (going back to text-based JSON editor)

Posted in JavaScript / TypeScript / Node.js.


How to move Livedrive’s cache folder

In its older versions, Livedrive had many “advanced” settings. Notably, it was possible to move around its cache folder (which is the folder where, notably, files are temporarily stored while they’re being uploaded to the briefcase, or permanently if you choose to keep them both locally and “in the cloud”), which I found quite useful so as to avoid filling up, or simply wearing out the SSD where Windows resides. Sadly, the new, redesigned version came with many oversimplifications, and this setting was removed. However, I noticed that my upgraded version did retain the modified value from the previous version. So I dug around a little, and found there is a registry setting for it 🙂

So, simply run regedit, then go to key HKEY_CURRENT_USER\SOFTWARE\Livedrive\Users\[your email], and edit the string (REG_SZ) value CacheLocation. Default value is C:\Users\[username]\AppData\Local\Livedrive. Make sure Livedrive is not running when you change that. Also, I think it’s a good idea to manually move the contents of the cache folder from the old location to the new one.
On a side note, it seems that all settings are stored in this key: it might be a convenient way to modify them without looking everywhere in the control center.

Posted in software.


aToad #22: Dillinger.io

Online Markdown editor

I’m really not a fan of Markdown, as I’ve been used to MediaWiki syntax, BBCode, or even more simply, plain HTML (HTML is so trivial, I don’t really get why so many people feel the necessity to invent their own markup language over it…). But with Github’s quasi-monopoly on easy Git hosting (I personally like Bitbucket though – but they use Markdown too) it seems to become kind of a necessary evil.

Dillinger.io provides an easy way to edit your markdown readmes, with a simple and efficient interface: code to the left, “what you see is what you get” (just a non-editable preview) on the right. It lacks a syntax help, but the provided example document already has plenty of the useful syntax and you probably won’t need more than that.

Posted in A Tool A Day.