Skip to content

Instantly share code, notes, and snippets.

View davispuh's full-sized avatar

Dāvis davispuh

  • Latvia
View GitHub Profile

Manually fixing bit flips in BTRFS

Somehow my BTRFS file system became corrupted by what appears to be a single bit flip in a metadata field. Rather than copying all the data and reformatting the file system, which would have required another disk at least as large as the original, I decided to try to fix this manually, which appears to have worked. I've documented the procedure I've used here, in case I need it again or someone else runs into a similar issue and finds it useful.

The first thing you should do is run btrfs check. For me this produced the following output:

Opening filesystem to check...
Checking filesystem on /dev/nvme0n1p1
UUID: ec7afe1c-8478-450a-82fc-d17b32d8ca3d
@davispuh
davispuh / channels.sql
Created August 26, 2014 00:08
Most active channels
SELECT count(messageid) as count, buffername as channel
FROM backlog
LEFT JOIN buffer ON buffer.bufferid = backlog.bufferid
WHERE buffername != ''
GROUP BY buffername ORDER BY count DESC
LIMIT 30;
@davispuh
davispuh / steam_console_params.txt
Last active April 2, 2025 03:10
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accesscode -
-all_languages - show longest loc string from any language
-batterytestmode - rapidly cycle battery percentages for testing
-bigpicture - Start in Steam Big Picture mode
-blefw -
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
@willurd
willurd / web-servers.md
Last active March 26, 2025 19:51
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@davispuh
davispuh / array.rb
Last active December 15, 2015 10:29
Equally distribute several array elements across single array. (Ruby)
#!/usr/bin/env ruby
require 'pp'
a = []
a << [:a, :c, :e]
a << [:b, :f, :g, :h, :i, :j]
a << [:d]
# element coefficients
@postmodern
postmodern / comment.md
Last active January 11, 2024 15:37
Crypto Privacy Copy Pasta
@hakre
hakre / DomTree.php
Last active February 22, 2021 11:40
DomTree - Dump DomDocument based documents, suiting debugging needs
<?php
/**
* DomTree
*
* Dump DomDocument based documents, suiting debugging needs
*
* @author hakre <http://hakre.wordpress.com/>
* @link http://stackoverflow.com/questions/26321597/getting-price-from-amazon-with-xpath/26323824#26323824
* @link http://stackoverflow.com/questions/12108324/how-to-get-a-raw-from-a-domnodelist/12108732#12108732
* @link http://stackoverflow.com/questions/684227/debug-a-domdocument-object-in-php/8631974#8631974
@luislavena
luislavena / gist:3251384
Created August 3, 2012 20:49
Testing Ruby 2.0 on Windows

Prepare for Ruby 2.0, today

Ruby 2.0 is around the corner, estimated to be launch February 2013, for its 20th anniversary!

Wouldn't be great to be able to test Ruby 2.0 features and report possible bugs?

Things like Refinements, built-in ANSI coloring for Windows or even better, faster startup

Users of other OS like Linux and OSX already can install upcoming versions of RUby thanks to RVM and rbenv tools, but what about Windows?