Skip to content

Instantly share code, notes, and snippets.

@izonder
izonder / extending_partition.txt
Created September 16, 2021 10:23
Extending partition
# fdisk -l
Disk /dev/vda: 200 GiB, 214748364800 bytes, 419430400 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xa236c89b
Device Boot Start End Sectors Size Id Type
/dev/vda1 * 2048 201326591 201324544 96G 83 Linux
const sparseMap = {
'O2': {
'ExposureAlarm': {
read: () => _.random(9, 19),
isExposureAlarm: () => true
},
'ExposureWarning': {
read: () => _.random(24, 27),
isExposureWarning: () => true
}
@izonder
izonder / ns.js
Created December 4, 2020 15:04
statuses transitions
import {makeFlag, isBitsOn, isBitsOff, turnBitsOn, turnBitsOff} from '../helpers/bitwise';
/**
* Statuses dictionary
* @type {number}
*/
export const
F_FINALIZED = makeFlag(0), // finalized
F_QUEUED_FOR_FETCHING = makeFlag(1), // marked for queue to be fetched
F_READY_FOR_PROCESSING = makeFlag(2), // marked for processing
@izonder
izonder / bitwise.js
Created December 4, 2020 14:34
Bitwise functions
/* eslint-disable no-bitwise */
export const
/**
* Make bit flag based on number of bit
* @param {number} bit
* @returns {number}
*/
makeFlag = (bit) => {
return 2 ** bit; //eslint-disable-line no-magic-numbers
},
@izonder
izonder / liquibase.sh
Created June 27, 2019 14:42
Install Liquibase
#!/usr/bin/env bash
LIQUIBASE_VERSION=3.6.3
LIQUIBASE_PREFIX=/usr/local/lib
LIQUIBASE_BIN=/usr/local/bin
JDBC_POSTGRES_VERSION=42.2.6
JDBC_MYSQL_VERSION=2.4.2
##############################################################################
# Install Liquibase
@izonder
izonder / IAMCredentials.json
Created March 25, 2019 12:45 — forked from ServerlessBot/IAMCredentials.json
Minimum credential set for Serverless Framework
{
"Statement": [
{
"Action": [
"apigateway:*",
"cloudformation:CancelUpdateStack",
"cloudformation:ContinueUpdateRollback",
"cloudformation:CreateChangeSet",
"cloudformation:CreateStack",
"cloudformation:CreateUploadBucket",
@izonder
izonder / dayswithoutanincident.md
Created March 28, 2018 14:43
dayswithoutanincident.md

Days without an incident

@izonder
izonder / lollipops.md
Created November 21, 2017 15:14
lollipops.md

Lollipops

docker run -d \
--volumes-from rancher-data \
--restart=unless-stopped \
-e CATTLE_PROMETHEUS_EXPORTER=true \
-p 8080:8080 \
-p 9108:9108 \
rancher/server:latest
@izonder
izonder / docker-drop-obsolete.sh
Created April 24, 2017 15:07
Drop obsolete and broken images and intermediate containers
# this will remove almost all obsolete images including broken while building images and accompanied intermediate containers
# remains should be removed manually (which throw exceptions "image has dependent child images")
docker rm `docker ps -a | grep -P '\s+[0-9a-h]{12}\s+' | awk '{print $1}'`;
docker rmi `docker images | grep '<none>' | awk '{print $3}'`;
docker volume prune;