Skip to content

Instantly share code, notes, and snippets.

@maricn
maricn / webcam-rx100m7.sh
Created November 13, 2021 13:20
Use the Sony RX100m7 as a webcam. Requires `gphoto2`, `v4l2loopback-dkms`, `v4l2loopback-utils` and `ffmpeg`.
#!/bin/bash
sudo modprobe v4l2loopback devices=1 exclusive_caps=1 max_buffers=2 video_nr=2 card_label="fake-cam"
DUMMY_VIDEO=$(v4l2-ctl --list-devices | grep Dummy -A1 | tail -n1 | awk '{ print $1 }')
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 "$DUMMY_VIDEO"
# The commits that did automated reformatting. You can ignore them
# during git-blame with `--ignore-rev` or `--ignore-revs-file`.
#
# $ git config --add 'blame.ignoreRevsFile' '.git-blame-ignore-revs'
#
# Additional options to mark unblamable and ignored lines in the
# git-blame output:
#
# $ git config --add 'blame.markUnblamables' 'true'
# $ git config --add 'blame.markIgnoredLines' 'true'
@maricn
maricn / swaywm-get-window-criteria.sh
Created January 17, 2021 20:54
User friendly way to find the window in the swaywm tree for use in sway configuration. Idea taken from https://gist.github.com/jottr/8645010
#!/bin/sh
# swaywm-get-window-criteria - Get criteria for use with swaywm config commands
# To use, run this script, then click on a window.
# Output is in the format: [<name>=<value> <name>=<value> ...]
# Remember the previous state of WAYLAND_DEBUG and temporarily run in quiet
wl_debug=$WAYLAND_DEBUG
#!/bin/bash
ROOMS="
rc1
rc2
csh (cs-hamburg)
oio
r3s
cwtv2
kreaturworks
cbase
@maricn
maricn / Sony Xperia XZ2 Compact Dual SIM (H8324) liberation.md
Last active June 18, 2020 12:18
My reminder for how to install LineageOS 17.1 on Sony XZ2C Dual.. Big shouts to SODP, XDA team and @MartinX3..

Sony Xperia XZ2 Compact Dual SIM (H8324) liberation

This instruction list grow from XDA member @Raphos instructions here and their, @MartinX3 and others' posts throughout that thread as well as documentation found at ix5.org

Flashing

Use one of the flash modes

  • flashmode (VOL_DOWN) #green - is used by flashtool to flash the Sony Software - press volume down and insert the USB cable (green light will come)
  • fastboot (VOL_UP) #blue - is used by fastboot to flash the AOSP images - press volume up and insert the USB cable (blue light will come)

Backup TA

@maricn
maricn / startpage.css
Last active June 28, 2019 12:08
My Dark (orange side) StartPage Stylus CSS [THAT DOES NOT CONFLICT WITH VIMIUM]
body *
{
background: #1f1f1f url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkAgMAAAANjH3HAAAACVBMVEUaGhohISElJSUh9lebAAAB20lEQVRIx4XWuZXDMAwE0C0SAQtggIIYoAAEU+aKOHhYojTrYP2+QfOW/5QIJOih/q8HwF/pb3EX+UPIveYcQGgEHiu9hI+ihEc5Jz5KBIlRRRaJ1JtoSAl5Hw96hLB1/up1tnIXOck5jZQy+3iU2hAOKSH1JvwxHsp+5TLF5MOl1/MQXsVs1miXc+KDbYydyMeUgpPQreZ7fWidbNhkXNJSeAhc6qHmHD8AYovunYyEACWEbyIhNeB9fRrH3hFi0bGPLuEW7xCNaohw1vAlS805nfsrTspclB/hVdoqusg53eH7FWot+wjYpOViX8KbFFKTwlnzvj65P9H/vD0/hibYBGhPwlPO8TmxRsaxsNnrUmUXpNhirlJMPr6Hqq9k5Xn/8iYQHYIuQsWFC6Z87IOxLxHphSY4SpuiU87xJnJr5axfeRd+lnMExXpEWPpuZ1v7qZdNBOjiHzDREHX5fs5Zz9p6X0vVKbKKchlSl5rv+3p//FJ/PYvoKryI8vs+2G9lzRmnEKkh+BU8yDk515jDj/HAswu7CCz6U/Mxb/PnC9N41ndpU4hUU7JGk/C9PmP/M2xZYdvBW2PObyf1IUiIzoHmHW9yTncliYs9A9tVNppdShfgQaTLMf+j3X723tLeHgAAAABJRU5ErkJggg==) !important;
color: #ddd;
border-color: #997 !important;
}
body a
{
color: #fe9 !important;
@maricn
maricn / vimium.css
Created June 28, 2019 12:06
My Dark (orange side) Vimium CSS with vomnibar
div > .vimiumHintMarker {
/* linkhint boxes */
/* background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785),
color-stop(100%,#FFC542)); */
background: #383c4a;
border: 1px solid #E3BE23;
}
div > .vimiumHintMarker span {
/* linkhint text */
@maricn
maricn / feedback.css
Created March 27, 2014 13:46
JavaScript Feedback form (similar to github.com/niklasvh/feedback.js) with back button to get one step back. [feedback.js is used as an example in index.html as if it is in 'js' folder with jquery and feedback.css in 'css' folder with bootstrap]
/*!
* Bootstrap v2.0.4
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/