Skip to content

Instantly share code, notes, and snippets.

$ sudo LANG= LC_ALL= ddccontrol -c -d dev:/dev/i2c-1
ddccontrol version 0.4.4
Copyright 2004-2005 Oleg I. Vdovikin (oleg@cs.msu.su)
Copyright 2004-2006 Nicolas Boichat (nicolas@boichat.ch)
This program comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of this program under the terms of the GNU General Public License.
Reading EDID and initializing DDC/CI at bus dev:/dev/i2c-1...
I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/BNQ801B.xml"
Document not parsed successfully.
@biinari
biinari / extract-123-reg-zonefile.js
Last active February 8, 2023 14:23
Script to extract the DNS entries from 123-reg advanced dns page
// Moved to a new home at https://github.com/biinari/zonefile-extract/tree/master/123-reg
@biinari
biinari / find_misnamed_specs.sh
Last active July 7, 2021 00:33
Find specs that do not follow the necessary conventional file name '*_spec.rb'. These will not be run by RSpec so should be changed.
#!/bin/sh
find */spec -type f \
-name '*.rb' \
-not -name '*_fabricator.rb' \
-not -name '*_spec.rb' \
-not -name 'spec_helper.rb' \
-not -path '*/cassettes/*' \
-not -path '*/dummy/*' \
-not -path '*/expected/*' \
$ bundle exec rspec spec/rubocop/config_loader_spec.rb:1224 spec/rubocop/target_finder_spec.rb:168 --seed 10065 --format documentation
Run options: include {:focus=>true, :locations=>{"./spec/rubocop/config_loader_spec.rb"=>[1224], "./spec/rubocop/target_finder_spec.rb"=>[168]}}
Randomized with seed 10065
RuboCop::ConfigLoader
.configuration_from_file
when a new cop is introduced
when EnabledByDefault is true
is enabled
@biinari
biinari / rubocop_spec_target_finder
Created August 16, 2020 04:06
spec failure output
Run options: include {:focus=>true}
All examples were filtered out; ignoring {:focus=>true}
Randomized with seed 15787
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
create
create README.md
create Rakefile
create .ruby-version
create config.ru
create .gitignore
create Gemfile
run git init from "."
Initialized empty Git repository in /tmp/shoulda-matchers-acceptance/test-project/.git/
create package.json
@biinari
biinari / postgres_queries_and_commands.sql
Last active October 22, 2019 12:10 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (>= 9.2, < 9.6)
SELECT pid,
age(clock_timestamp(), query_start) AS age,
usename, state, query, waiting,
age(clock_timestamp(), xact_start) AS xact_age
FROM pg_stat_activity
WHERE state != 'idle'
AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY age DESC;
@biinari
biinari / mocha_to_rspec_mocks.sed
Last active December 27, 2018 16:47
Converts mocha expectations to rspec-mocks.
s/\([^.a-zA-Z_-]\)stub\>/\1double/g
s/\([^.a-zA-Z_-]\)mock\>/\1double/g
s/\.returns\>/.and_return/g
s/\.yields\>/.and_yield/g
s/\(\S\+\)\.stubs(/allow(\1).to receive(/g
s/\(\S\+\)\.expects(/expect(\1).to receive(/g
s/at_least_once/at_least(:once)/g
s/at_most_once/at_most(:once)/g
s/\.raises\>/.and_raise/g
s/\(allow\|expect\)(\(\S\+\)\.any_instance).to receive/\1_any_instance_of(\2).to receive/g
@biinari
biinari / lpass_askpass_zenity
Created December 18, 2017 16:19
LastPass lpass backend to password_fill
#!/bin/sh
# Optional accompaniment to password_fill_rc (in case no existing graphical password askpass for lpass to use)
# put in ~/.config/qutebrowse/lpass_askpass_zenity
# and enable in password_fill_rc with need_askpass=1
zenity --title "lpass $*" --password
Ariana Grande - No Tears Left To Cry
Bon Jovi - Wanted Dead Or Alive Karaoke Lyrics
Chuck Berry - 'Johnny B. Goode' Karaoke
Complicated (Radio Version) in the style of Avril Lavigne _ Karaoke with Lyrics
Eagle - Hotel California
Ed Sheeran - Perfect
Green Day - Boulevard Of Broken Dreams
Jessie J - Flashlight
Karaoke Every Breath You Take - The Police
Karaoke House Of The Rising Sun - The Animals