Skip to content

Instantly share code, notes, and snippets.

@rwohleb
rwohleb / tabs-outliner-db-dump.js
Created March 23, 2024 23:50
Chrome Tabs Outliner extension DB dump
/*
* Inspect the Tabs Outliner window. Run this code in the console. Copy the resulting HTML string. Save to a new HTML file. Done!
*/
var connection = indexedDB.open('TabsOutlinerDB34', 2);
connection.onsuccess = (event) => {
const db = event.target.result;
const transaction = db.transaction(["current_session_snapshot"]);
const objectStore = transaction.objectStore("current_session_snapshot");
const request = objectStore.get("currentSessionSnapshot");
@rwohleb
rwohleb / coral_pcie_in_proxmox_lxc.md
Last active December 29, 2023 09:32
Coral PCIe in Proxmox LXC

Coral PCIe in Proxmox LXC

Check Coral PCIe device exists

lspci -nn | grep 089a

Install Coral drivers

Normally you'd just [install them via apt][1]:

@rwohleb
rwohleb / yt-watch-later-delete.js
Created July 11, 2021 20:46
Mass delete Youtube Watch Later videos
// Go to https://www.youtube.com/playlist?list=WL and run this in browser console.
var popupContainer = $("ytd-popup-container");
var videos = $("ytd-playlist-video-list-renderer #contents").getElementsByClassName("ytd-playlist-video-list-renderer")
function removeVideo() {
if (videos.length) {
videos[0].getElementsByTagName("button")[0].click();
setTimeout(function() {
var dropdown = popupContainer.getElementsByTagName("tp-yt-iron-dropdown");
console.log(dropdown);
var stringElems = dropdown[0].getElementsByClassName("yt-formatted-string");
root@Anubis:~# smartctl -x /dev/sdc
smartctl 7.1 2019-12-30 r5022 [x86_64-linux-4.19.107-Unraid] (local build)
Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Vendor: SAMSUNG
Product: MZ6ER200HAGM/003
Revision: DM0L
Compliance: SPC-4
User Capacity: 200,049,647,616 bytes [200 GB]
@rwohleb
rwohleb / custom_util.post_update.php
Created November 20, 2019 04:11
Drupal 8: Convert text field to paragraph
<?php
use Drupal\Core\Utility\UpdateException;
use Drupal\paragraphs\Entity\Paragraph;
/**
* Convert news,blog,event body field to paragraphs.
*/
function custom_util_post_update_convert_newsblogevent_body(&$sandbox) {
@rwohleb
rwohleb / my_theme.theme
Created October 16, 2019 20:58
D8: Breadcrumb/page links in views
<?php
/**
* Implements hook_preprocess_HOOK().
*/
function my_theme_preprocess_views_view(&$variables) {
$view = $variables['view'];
$variables['breadcrumb_links'] = \Drupal::service('breadcrumb')->build(\Drupal::routeMatch())->getLinks();
$variables['view_page_urls'] = [];
@rwohleb
rwohleb / gist:176fea41c89c02fa4b29f2e1dbc45c4c
Created July 16, 2017 07:02 — forked from logxen/gist:ad195ccd31914bab8869
Edison Quickstart Guide for Octoprint and Smoothie
# *** Documentation Links
Documentation list: https://communities.intel.com/community/makers/edison/documentation/content
Edison Guide: https://communities.intel.com/docs/DOC-23158
Mini Breakout Guide: https://communities.intel.com/docs/DOC-23252
Mini Breakout Schematic: https://communities.intel.com/docs/DOC-23323
Mini Breakout BoM: https://communities.intel.com/docs/DOC-23322
Arduino Breakout Guide: https://communities.intel.com/docs/DOC-23161
Arduino Breakout Schematic: https://communities.intel.com/docs/DOC-23309
Arduino Breakout BoM: https://communities.intel.com/docs/DOC-23308
BSP Guide (yocto build environment): https://communities.intel.com/docs/DOC-23159
@rwohleb
rwohleb / keybase.md
Created September 29, 2016 00:23
keybase.md

Keybase proof

I hereby claim:

  • I am rwohleb on github.
  • I am rwohleb (https://keybase.io/rwohleb) on keybase.
  • I have a public key ASBWaZZ8BO8Mpddeh5xInMOPelSREyOUtkXF7OuwewpcYQo

To claim this, I am signing this object:

@rwohleb
rwohleb / gist:0d590e2a3cefcfa0e09f
Created October 14, 2014 21:12
Upgrade MySQL to innodb_file_per_table [FOUND, UNTESTED]
#!/bin/bash -x
if test "$USER" != "root" ; then
echo "Must be root ..."
exit 1
fi
mysql_dba=root
mysql_pass=your_mysql_dba_password
#! /bin/sh
### BEGIN INIT INFO
# Provides: solr
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Solr
# Description: Solr advanced search engine
### END INIT INFO