Skip to content

Instantly share code, notes, and snippets.

@FFY00
Last active January 8, 2023 01:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FFY00/6a962d3d1624b439b582cc8a0612b22b to your computer and use it in GitHub Desktop.
Save FFY00/6a962d3d1624b439b582cc8a0612b22b to your computer and use it in GitHub Desktop.
Pauta Sistemas Operativos - 1ª Prova Prática
#!/bin/bash
pdftotext -layout "$@" - | sed -e '/^ [0-9][0-9][0-9][0-9][0-9][0-9]/!d' -e 's|,|\.|g'| awk -F '[[:space:]][[:space:]]+' '{print $6}' | R -e 'd <- density(scan(file("stdin"))); plot(d, main="Notas de SO"); polygon(d, col="red")'
#!/bin/bash
# Sample: https://i.imgur.com/orwwOz3.png
pdftotext -layout "$@" - | sed '/^ [0-9][0-9][0-9][0-9][0-9][0-9]/!d' | awk -F '[[:space:]][[:space:]]+' '{print $6}' | gnuplot -p -e 'set term png; set output "notas-so.png"; set style fill solid 1.0 noborder; plot "/dev/stdin" using (0.1 * ( floor($1/0.1) + 0.5 )):(1) smooth frequency with boxes'
#!/bin/bash
pdftotext -layout "$@" - | sed '/^ [0-9][0-9][0-9][0-9][0-9][0-9]/!d' | awk -F '[[:space:]][[:space:]]+' '{print $6}' | gnuplot -p -e 'set style fill solid 1.0 noborder; plot "/dev/stdin" using (0.1 * ( floor($1/0.1) + 0.5 )):(1) smooth frequency with boxes'
#!/bin/bash
pdftotext -layout "$@" - | sed '/^ [0-9][0-9][0-9][0-9][0-9][0-9]/!d' | awk -F '[[:space:]][[:space:]]+' '{print $6 "\t" $1 "\t" $2}' | sort -g -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment