- reboot
- sudo btrfs rescue zero-log /dev/sdf1
- sudo btrfs check -s 1 -b /dev/sdf1
- sudo mount -o ro,rescue=all /mnt/d1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_sparse_file | |
set actual_size (du --block-size=1 "$argv" | awk '{print $1}') | |
set apparent_size (du --block-size=1 --apparent-size "$argv" | awk '{print $1}') | |
if test $actual_size -eq $apparent_size | |
return 1 | |
else | |
return 0 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aaliyah | |
abbatis | |
abbrevs | |
abditos | |
abdominousness | |
abductee | |
abductees | |
abductive | |
aber | |
abest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Hide Seen Rows | |
// @namespace http://tampermonkey.net/ | |
// @version 0.31 | |
// @description Remember and hide unique rows based on URL | |
// @author Jacob Chapman | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tag target commits as demo-start, demo-end | |
# move to the start of your presentration with `git checkout demo-start` | |
# use to `git next`, `git prev` to jump between "slides" | |
git config --global alias.next '!git checkout `git rev-list HEAD..demo-end | tail -1`' | |
git config --global alias.prev 'checkout HEAD^' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudoedit /etc/security/limits.conf | |
# 9223372036854775807 LOL ulimit -n unlimited ?! the max might be 1048576 or 1073741816 but you should just leave this file blank unless you have multiple users that access the system | |
oops... | |
sudo: pam_open_session: Permission denied | |
sudo: policy plugin failed session initialization | |
Segmentation fault (core dumped) | |
... terminated by signal SIGSEGV (Address boundary error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fractions import Fraction | |
def f(y, z): | |
return 108 - (815 - 1500 / z) / y | |
# Initialize exact values using Fraction for exact arithmetic | |
xExact = {0: Fraction(4), 1: Fraction(17, 4)} | |
# Initialize floating point values | |
xFloat = {0: 4.0, 1: 4.25} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from pathlib import Path | |
def rglob_no_xdev(path, pattern): | |
start_dev = os.stat(path).st_dev | |
def _rglob_no_xdev(path, pattern, start_dev): | |
for p in path.glob(pattern): | |
if p.is_dir(): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/rfjakob/earlyoom/blob/c759f1bef2b50d0e0b249bff650e730655c98c0e/contrib/oomstat/overload.txt | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
from xklb.utils import processes | |
df = pd.read_csv(StringIO(processes.cmd('cb').stdout.replace('|',' ')), delim_whitespace=True) | |
df.set_index('Time', inplace=True) | |
df = df.apply(pd.to_numeric) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import pytest | |
from io import StringIO | |
class MockStdin: | |
def __init__(self, input_text): | |
self.input_text = input_text | |
self.original_stdin = None |
NewerOlder