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 factory | |
class UserFactory(factory.django.DjangoModelFactory): | |
class Meta: | |
model = 'myapp.User' | |
django_get_or_create = ('username',) | |
username = factory.Faker('user_name') | |
first_name = factory.Faker('first_name') |
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 | |
[[ -z "$1" ]] && echo "No given device" && exit 1 | |
[[ -z "$2" ]] && echo "No given mode (read|write)" && exit 1 | |
device=$1 | |
mode=$2 | |
cpu_num=$(cat /proc/cpuinfo | grep proc | wc -l) | |
bytes_to_write=$(fdisk -l $device | grep -E 'Disk .* bytes$' | awk '{print $(NF-1)}') | |
process_num=$((cpu_num*2)) | |
count_by_process=$((bytes_to_write/1024/1024/process_num)) |