Skip to content

Instantly share code, notes, and snippets.

View ftorto's full-sized avatar

ftorto ftorto

  • TOULOUSE, France
View GitHub Profile
@ftorto
ftorto / pi_temperature.sh
Created January 24, 2017 10:25
RaspberryPi temperature
#!/bin/bash
/etc/ppp$ /opt/vc/bin/vcgencmd measure_temp|cut -c6-9
@ftorto
ftorto / chunk.py
Created January 24, 2017 10:24
Split a list in chunk with python
list_to_chunk = [1,2,3,4,5,6,7,8,9,10]
number_of_items_per_chunk = 2
for i in range(0, len(list_to_chunk), number_of_items_per_chunk):
print("CHUNK %s"%i)
chunk = list_to_chunk[i:i + number_of_items_per_chunk]
# Action to perform on each chunk here
@ftorto
ftorto / recurs_git.sh
Created January 24, 2017 10:21
Apply a GIT command to all subfolder
#!/bin/sh
#Git recursive
# Apply a command to all sub git directories
rootpath=.
cmd=$*
CLREOL=$'\x1B[K\033[0m'
@ftorto
ftorto / .bashrc
Created January 24, 2017 10:19
Remove useless docker images
# to add into .bashrc
clean_docker() {
# Delete all stopped container
docker rm $(docker ps -qa --no-trunc --filter "status=exited");
# Delete intermediate images not referenced
docker rmi $(docker images --filter "dangling=true" -q --no-trunc)
}