[root@btrfs-testdrive] # btrfs qgroup create 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup assign 0/276 1/100 /mnt/btrfs
[root@btrfs-testdrive] # btrfs qgroup show /mnt/btrfs
qgroupid rfer excl
-------- ---- ----
0/5 16384 16384
0/256 2864136192 2864136192
0/258 833703936 833703936
0/259 52510720 52510720
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
#!/bin/bash | |
function clean_up { | |
# Perform program exit housekeeping | |
rm $TEMP_FILE | |
exit | |
} | |
trap clean_up SIGHUP SIGINT SIGTERM | |
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
# FBTFT xorg config file | |
# | |
# startx -- -layout TFT | |
# startx -- -layout HDMI | |
# | |
# startx | |
# When -layout is not set, the first is used: TFT | |
# | |
Section "ServerLayout" |
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 Control.Monad.State | |
import Text.Printf | |
initiallyRequired = 0.3 | |
maintenanceRequired = 0.15 | |
takerFee = 0.002 | |
type Amount = Double | |
type Price = Double |
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
#!/usr/bin/env python | |
import subprocess | |
import re | |
from collections import namedtuple | |
import binascii | |
import time | |
import json | |
IGNORE = """ | |
nm-applet |
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
#!/bin/bash | |
if [ -r USB.vmdk ]; then | |
VBoxManage storageattach "BootFromUSB" --storagectl "SATA" --port 0 --device 0 --medium none | |
VBoxManage closemedium disk USB.vmdk --delete | |
fi | |
sudo chown $USER /dev/disk1* | |
VBoxManage internalcommands createrawvmdk -filename USB.vmdk -rawdisk /dev/disk1 -partitions 1,2 |
How to download, import, and analyze San Francisco restaurant inspection data using SQLite3 and csvkit from the command-line.
A quick example of doing data wrangling from the command-line, as well as getting to know one of San Francisco's data sets: the San Francisco restaurant inspections, courtesy of the SF Department of Public Health. I don't normally do database work from the command-line, but importing bulk data into SQLite is pretty frustrating using the available GUIs or just the shell.
So thank goodness for Christopher Groskopf's csvkit, a suite of Unix-like tools that use Python to robustly handle CSV files. There's a lot of great tools in csvkit, but for this gist, I just use csvsql, which can parse a CSV and turn it into properly-flavored SQL to pass directly into your database app of choice.
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 archlinux:20200205 AS arch-ghc-build-env | |
RUN pacman -Syu --noconfirm | |
RUN pacman -S --noconfirm git base-devel go python python-sphinx libedit numactl exa | |
# use all possible cores for subsequent package builds | |
RUN sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf | |
# don't compress the packages built here | |
RUN sed -i "s,PKGEXT='.pkg.tar.xz',PKGEXT='.pkg.tar',g" /etc/makepkg.conf | |
# set up the packager user |
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
# Run container Nginx | Debian | |
docker run -it -v /var/www/:/var/www/ --name webserver-nginx-debian -p 80:80 culturagovbr/web-nginx-debian:0.1 | |
# Run container Nginx | PHP 5 | Debian | |
docker run -it -v /var/www/:/var/www/ --name webserver-nginx-debian -p 80:80 --add-host local.salic:127.0.0.1 culturagovbr/web-nginx-php5-debian | |
# Run container Nginx | PHP 7 | Debian | |
docker run -it -v /var/www/:/var/www/ --name webserver-nginx-debian -p 80:80 culturagovbr/web-nginx-php7-debian:0.1 | |
# Run container Apache | Debian |
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
use std::io::stdin; | |
use std::io::prelude::*; | |
use std::iter::*; | |
use std::str::SplitWhitespace; | |
fn main() { | |
let mut inp = InRead::new(); | |
let t = inp.int(); | |
for _ in 0..t { | |
let n = inp.int(); |
OlderNewer