This file contains hidden or 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 os | |
import sys | |
import fitz | |
def extract_images(pdf_path, output_folder): | |
doc = fitz.open(pdf_path) | |
for page_num in range(len(doc)): | |
page = doc[page_num] | |
image_list = page.get_images(full=True) | |
for img_index, img in enumerate(image_list): |
This file contains hidden or 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 bash | |
cpus=$(cat /proc/cpuinfo | grep processor | wc -l) | |
governor="powersave" | |
i=0 | |
while [[ $i -ne $cpus ]]; do | |
echo "${governor}" >/sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor | |
# get max frequency |
This file contains hidden or 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 bash | |
for f in *.heic; do | |
out=$(echo $f | sed -e s/\.heic/\.jpg/g) | |
heif-convert -q 92 $f $out | |
done |