This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Find (and optionally delete) unreadable Tab Session Manager records in Firefox. | |
| * | |
| * Symptom it fixes: the TSM popup lists only a handful of sessions (often exactly one) | |
| * although hundreds or thousands are stored, and re-importing sessions does not help. | |
| * | |
| * Cause: TSM's session-list reader walks the whole "sessions" IndexedDB store with a | |
| * single cursor. One record whose externalised blob file (idb/<db>.files/<n>) is missing | |
| * makes the read fail with NotReadableError; the cursor transaction aborts, the stream of | |
| * batches stops, and every session after that record never reaches the popup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """Extract Tab Session Manager sessions from Firefox IndexedDB. | |
| Firefox IndexedDB stores each session as a structured clone (SpiderMonkey | |
| format: stream of 64-bit [data:4][tag:4] pairs, tag in the high 32 bits). | |
| Large records are Snappy-framed compressed in the `.files` directory. | |
| Parser logic ported (heavily simplified) from Google dfindexeddb | |
| (Apache-2.0): dfindexeddb/indexeddb/firefox/gecko.py, definitions.py. | |
| Snappy decompression via ctypes binding to system libsnappy.so.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # afuse-sshfs mount helper to automatically mount remote machines. | |
| # It is intended to be used as mount.afuse in command line. F.e. in /etc/fstab you may mount directory like: | |
| # afuse# /mnt/remote afuse auto 0 0 | |
| # And then as regular user just do: | |
| # $ cd /mnt/remote/user@remote.host/remote/path | |
| # and folder /mnt/remote/user@remote.host will be mounted automatically! | |
| # | |
| # On Mac some also recommend add defer_permissions,noappledouble mount options. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find -type f -exec sh -c 'F=$( basename "{}" ); mv $F $(echo $F | sed -r "s/^([[:digit:]]+).+?/\1/")' \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| execve("/usr/bin/kcolorchooser", ["kcolorchooser"], [/* 75 vars */]) = 0 | |
| brk(NULL) = 0x5619369e1000 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ffbf6d20000 | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=271676, ...}) = 0 | |
| mmap(NULL, 271676, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ffbf6cdd000 | |
| close(3) = 0 | |
| open("/lib64/libKF5XmlGui.so.5", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0p5\4\0\0\0\0\0"..., 832) = 832 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // For structured comment of http://naleid.com/blog/2009/07/30/modularizing-groovy-config-files-with-a-dash-of-meta-programming | |
| // SecurityConfigPlain.groovy | |
| security { | |
| includeScript( SecurityDefaults ) | |
| active = true | |
| password = 'redefined' | |
| } | |
| // and then use (OtherClass.groovy): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var template = $.templates({ | |
| specialistsTmpl: tmpl | |
| }); | |
| $.templates.specialistsTmpl.link(container, { | |
| specialists: list | |
| }, { | |
| onAfterCreate: function(view){ | |
| if (view.data instanceof Specialist){ | |
| console.log('onAfterCreate', view, view.data, view.tmpl.tmplName, view.data instanceof Specialist); | |
| $(view.nodes()).find('.edit').click( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Object to save test тест "test тест" main.js:98 | |
| Success set: ["test тест"], {"response":1} main.js:108 | |
| Success get: ["test ����"], {"response":"\"test ����\""} main.js:116 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Добрый вечер. У меня какая-то странная проблема с кодировкой (UTF-8) в storage.get/set. | |
| Простой код: | |
| var t = { en: 'test', ru: 'тест' }; | |
| console.log('Object to save', t, JSON.stringify(t)); | |
| VK.api( | |
| 'storage.set' | |
| ,{ | |
| key: 'test' | |
| ,value: JSON.stringify(t) |