Skip to content

Instantly share code, notes, and snippets.

@RhetTbull
RhetTbull / Apple Photos database schema 10.12.6
Last active July 21, 2024 06:34
sqlite3 ".schema" of Photos Library.photoslibrary/database/photos.db on 10.12.6
CREATE VIRTUAL TABLE RidList_VirtualReader using RidList_VirtualReaderModule;
CREATE VIRTUAL TABLE Array_VirtualReader using Array_VirtualReaderModule;
CREATE TABLE LiGlobals (modelId integer primary key, keyPath varchar, value varchar, blobValue blob);
CREATE INDEX LiGlobals_keyPath_index on LiGlobals(keyPath);
CREATE VIRTUAL TABLE LiGlobals_VirtualBufferReader using VirtualBufferReaderModule;
CREATE TABLE LiLibHistory (modelId integer primary key, modDate timestamp, eventType varchar, metaSchemaVersion integer, libraryVersion integer, comment varchar);
CREATE INDEX LiLibHistory_eventType_index on LiLibHistory(eventType);
CREATE VIRTUAL TABLE LiLibHistory_VirtualBufferReader using VirtualBufferReaderModule;
CREATE TABLE LiStringAtom (modelId integer primary key, string varchar);
CREATE INDEX LiStringAtom_string_index on LiStringAtom(string);
@SukkaW
SukkaW / bookmark-remove-restrictions.min.js
Last active September 25, 2019 17:51
Remove website restrictions
javascript:(function(){var doc=document,body=document.body;with(body.onselectstart=body.oncopy=body.onpaste=body.onkeydown=body.oncontextmenu=body.onmousemove=body.ondragstart=document.onselectstart=document.oncopy=document.onpaste=document.onkeydown=document.oncontextmenu=null,document.onselectstart=document.onkeydown=document.oncontextmenu=document.onmousedown=function(){return!0},document.wrappedJSObject||document)onmouseup=null,onmousedown=null,oncontextmenu=null;for(var arAllElements=document.getElementsByTagName("*"),i=arAllElements.length-1;i>=0;i--){var elmOne=arAllElements[i];with(elmOne.style.userSelect="initial",elmOne.style.pointerEvents="initial",elmOne.wrappedJSObject||elmOne)onmouseup=null,onmousedown=null}body.style.webkitUserSelect="auto!important",body.style.MozUserSelect="normal!important",alert("已经解除右键和复制限制!")})();
-- See the most up to date version here where it says "Download the mrc-converter-suite zip archive" https://discussions.agilebits.com/discussion/30286/mrcs-convert-to-1password-utility/p1
--
-- Exports Safari's saved passwords to a CSV file formatted for use with the convert_to_1p4's csv converter
--
-- Version 1.4
-- mike (at) cappella (dot) us
--
use AppleScript version "2.5" -- runs on 10.11 (El Capitan) and later
use scripting additions
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active October 14, 2024 15:38
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation
@stefancocora
stefancocora / vpn-openconnect-connect-to-cisco-anyconnect.md
Created September 25, 2017 08:48
Split tunneling with openconnect - A guide on how to use openconnect to establish a vpn connection to an enterprise cisco anyconnect vpn endpoint with client side routing.

Introduction

The purpose of this short howto is to show you how to:

  • use openconnect [1] to connect to an enterprise cisco anyconnect endpoint
  • whilst minimizing the amount of traffic that your route through the vpn connection

Usually VPN administrators will puth the default route to the users, so that all user traffic is routed through the vpn connection. This is to address the various security concerns around compromised user computers bridging external internet traffic into the secure VPN network.

While the VPN administrator can push routes to the clients, the client can ignore these default routes and establish client side routing so that only the required A.B.C.D/E network is routed through the VPN. All other traffic will still use the clients default route and default outbound internet connection.

@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active November 17, 2024 04:56 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Exporting your 2FA tokens from Authy to transfer them into another 2FA application

IMPORTANT - Update regarding deprecation of Authy desktop apps

Past August 2024, Authy stopped supported the desktop version of their apps:
See Authy is shutting down its desktop app | The 2FA app Authy will only be available on Android and iOS starting in August for details.

And indeed, after a while, Authy changed something in their backend which now prevents the old desktop app from logging in. If you are already logged in, then you are in luck, and you can follow the instructions below to export to tokens.

If you are not logged in anymore, but can find a backup of the necessary files, then restore those files, and re-install Authy 2.2.3 following the instructions below, and it should work as expected.

@kentliau
kentliau / open-chrome-tabs-in-safari.scpt
Last active July 16, 2023 15:52 — forked from paulirish/open-chrome-tabs-in-safari.scpt
open all chrome tabs of all windows in safari
tell application "Google Chrome"
set window_list to every window
repeat with the_window in window_list
# For each Window in Chrome, create a new Window in Safari respectively
tell application "Safari"
make new document
activate
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@jjnilton
jjnilton / mac-network-commands-cheat-sheet.md
Last active October 18, 2024 21:25
Mac Network Commands Cheat Sheet

Disclaimer: I'm not the original author of this sheet, but can't recall where I found it. If you know the author, please let me know so I give the attribution.

The original author seems to be Charles Edge, here's the original content, as pointed out by @percisely.

Note: Since this seems to be helpful to some people, I formatted it to improve readability of the original. Also, note that this is from 2016, many things may have changed, and I don't use macOS anymore, so I probably can't help in case of questions, but maybe someone else can.

Mac Network Commands Cheat Sheet

After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and s

@justmoon
justmoon / custom-error.js
Last active November 19, 2024 02:40 — forked from subfuzion/error.md
Creating custom Error classes in Node.js
'use strict';
module.exports = function CustomError(message, extra) {
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
this.extra = extra;
};
require('util').inherits(module.exports, Error);