cryptsetup open --type plain -d /dev/urandom /dev/nvme0n1 to-be-wiped
dd if=/dev/zero of=/dev/mapper/to-be-wiped bs=1M status=progress
cryptsetup close to-be-wiped
wipefs -a /dev/nvme0n1
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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string" | |
}, | |
"realm": { | |
"type": "string" | |
}, |
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/sh | |
# SPDX-FileCopyrightText: 2023 Jakub Jirutka <jakub@jirutka.cz> | |
# SPDX-License-Identifier: MIT | |
set -eu | |
PROGNAME='qm-replace-disk' | |
VERSION='0.1.0' | |
# Defaults | |
DISK='scsi0' |
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
pub(crate) struct ChunksExact<const N: usize, I> { | |
iter: I, | |
} | |
impl<const N: usize, I: Iterator<Item = T>, T> Iterator for ChunksExact<N, I> { | |
type Item = [T; N]; | |
fn next(&mut self) -> Option<Self::Item> { | |
assert_ne!(N, 0); |
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
#include <stdbool.h> | |
typedef char* str; | |
#define GENERATE_OPTION_TYPES(Option) \ | |
Option(int) \ | |
Option(str) | |
#define GENERATE_RESULT_TYPES(Result) \ | |
Result(str, int) \ |
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/sh | |
# SPDX-License-Identifier: MIT | |
# SPDX-FileCopyrightText: 2021 Jakub Jirutka <jakub@jirutka.cz> | |
#---help--- | |
# Usage: radacct-rotate [options] | |
# | |
# Compress and later remove old FreeRADIUS' radacct log files with "-YYYYMMDD" | |
# suffix. | |
# | |
# Options: |
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
{ | |
"poradiCse": [ | |
"004", | |
"248", | |
"008", | |
"012", | |
"016", | |
"850", | |
"020", | |
"024", |
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
create function array_uniq (a anyarray) returns anyarray | |
immutable | |
language sql | |
as $$ | |
select array_agg(distinct x) from unnest(a) x; | |
$$; | |
comment on function array_uniq is | |
'Sorts and deduplicates elements of an array.'; | |
create function trg_person_roles_normalize () returns trigger |
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
------------------------------------------------------------------------------- | |
-- EXAMPLE USAGE | |
-- | |
-- create table specialization ( | |
-- id bigserial, | |
-- name text not null, | |
-- study_plan_codes text[] not null default '{}' | |
-- ) | |
-- | |
-- create constraint trigger study_plan_codes_unique_check |
NewerOlder