Skip to content

Instantly share code, notes, and snippets.

View piffy's full-sized avatar
💭
Getting ready for school restart (hopefully)

Marcello Missiroli piffy

💭
Getting ready for school restart (hopefully)
  • IIS Corni Liceo e Tecnico
  • Modena, Italy
View GitHub Profile
@piffy
piffy / ANSI.md
Created October 4, 2022 06:23 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
P=(' ' █ ░ ▒ ▓)
while :;do printf "\e[$[RANDOM%LINES+1];$[RANDOM%COLUMNS+1]f${P[$RANDOM%5]}";done
@piffy
piffy / gource-commands.txt
Created December 6, 2020 13:38 — forked from rafi/gource-commands.txt
Gource command
################################
gource commands
################################
# basic command for big and long projects
gource --max-user-speed 500 --seconds-per-day 0.05 --file-idle-time 10 -e 0.005 -f --max-files 300 --hide-files
# some easy to understand commands
# for output file
--output-ppm-stream ~/ppm/ppm-kohana
$ git commit -m "Una cosa orrenda"
$ git reset HEAD~
<< Modifica file >>
$ git add ...
$ git commit -c ORIG_HEAD
git push origin master --force #Opzionale
sudo mount -t "ntfs" -o "ro,uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000" "/dev/sdc4" /mnt
sudo mount -o loop /home/user/cd.iso /media/iso
dd if=/dev/zero of=fat.fs bs=1024 count=SIZE
mkfs.vfat fat.fs
mount -o loop fat.fs /mnt
https://www.maketecheasier.com/proc-filesystem-examine-linux-inner-working/
#!/bin/bash
gitinspector --grading -L --format html > ../docs/statistics.html
gitinspector --format=html -f="coffee,rb,js,json,feature,haml,erb,html" -r > report.html
gitinspector --grading -L --format html > doc/statisticsS2.html
gitinspector --grading -L --format html -f="docx,txt,odt,json,haml,doc,html" > doc/statisticsS2doc.html
git shortlog -sne > doc/gitshortlog.txt
@piffy
piffy / gourcevid
Last active November 30, 2020 16:44
Script per gourcevid (linux)
# installare gource
# crea il video a partire dai commit di Github
# mettere lo script nella cartella con il progetto, git pull e poi eseguire ./gourcevid.
#LOW RES
gource -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libvpx -b 10000K gource.webm
#HIRES
gource -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
#!/bin/bash
current_directory=$( pwd )
#remove spaces
for i in *.wma; do mv "$i" `echo $i | tr ' ' '_'`; done
#remove uppercase
for i in *.[Ww][Mm][Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
@piffy
piffy / rotate.sh
Created December 8, 2015 08:38
rotare iphone videos 90° degrees (ubuntu)
#!/bin/bash
for a in *.MOV; do
avconv -i "$a" -vf "transpose=1" "ROT_$a"
done
@piffy
piffy / flactomp3.sh
Created December 8, 2015 08:37
Convert flac to mp3 (ubuntu)
#!/bin/bash
for a in *.flac; do
avconv -i "$a" -qscale:a 0 "${a[@]/%flac/mp3}"
done