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
* Build docker compose without cache: | |
docker build --no-cache | |
* Clean all: | |
docker system prune -a | |
* Force docker compose to rebuild: | |
docker compose rm -f | |
* Clean various stuff: |
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 pstats | |
pstats.Stats('prof').strip_dirs().sort_stats("cumulative").print_stats() |
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
float actual = 0.0f; | |
float target = 100.0f; | |
for ( int step=0; step<500; step++ ){ | |
actual += (target - actual)/16 | |
printf("%f\n", actual); | |
} |
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
src = $(wildcard *.c) | |
obj = $(src:.c=.o) | |
LDFLAGS = -lz | |
psf: $(obj) | |
$(CC) -o $@ $^ $(LDFLAGS) | |
.PHONY: clean | |
clean: |
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
{ | |
"FormattingOptions": { | |
"NewLine": "\n", | |
"UseTabs": false, | |
"TabSize": 4, | |
"IndentationSize": 4, | |
"SpacingAfterMethodDeclarationName": false, | |
"SpaceWithinMethodDeclarationParenthesis": false, | |
"SpaceBetweenEmptyMethodDeclarationParentheses": false, | |
"SpaceAfterMethodCallName": false, |
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 | |
# Delete old snapshots except the newest one | |
# Replace product and variant as needed | |
del_product () { | |
read -a FILES <<< `ls -dt $1_BUILD_$2_*` | |
unset FILES[0] # Do not delete newest | |
for dir in ${FILES[*]} | |
do |
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
:%!python -m json.tool |
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
# A very comprehensive document: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html-single/Logical_Volume_Manager_Administration/index.html | |
# Assuming both disks have a partition created already. Think they should be already lvm2 pv? | |
sudo pvcreate /dev/sdc1 /dev/sdd1 | |
sudo vgcreate workvg /dev/sdc1 /dev/sdd1 | |
sudo lvcreate -l 100%FREE -n worklv workvg | |
sudo mkfs.ext4 /dev/workvg/worklv | |
sudo echo '/dev/workvg/worklv /work ext4 defaults 0 2' >> /etc/fstab |
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
static unsigned char commit_ioctl() | |
{ | |
int block_dev = -1; | |
int error_code = 0; | |
int retval = 0; | |
unsigned retry_count = 0; | |
errno = 0; /* Clear errno - successfull function calls might leave old value. */ | |
block_dev = open(block_dev_name, O_RDWR); | |
/* Need to save errno as it might be reset by library calls. */ |
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/python | |
import sys | |
from prettytable import PrettyTable | |
from collections import defaultdict | |
import pprint | |
# Columns | |
HOME_TEAM = 1 | |
AWAY_TEAM = 4 |
NewerOlder