Skip to content

Instantly share code, notes, and snippets.

View AlessioGiambrone's full-sized avatar

Alessio Giambrone AlessioGiambrone

View GitHub Profile
@AlessioGiambrone
AlessioGiambrone / decurl.py
Created July 17, 2020 12:10
parse a CURL request string and converts it to Python request
#!/usr/bin/env python3
import json
import requests
from sys import argv
R = {
'headers':{},
'url': None,
'data': None
}
#!/bin/bash
# This scripts pops up a notification in X if your RAM is occupied more
# than a certain value (default: 90%).
# Memory is checked every 3 seconds, alerts pops up every 30 seconds.
checkmemory () {
while
sleep 3
TOTAL=`free -tw | grep Mem | tr -s ' ' | cut -d ' ' -f 2`
USED=`free -tw | grep Mem | tr -s ' ' | cut -d ' ' -f 3`
@AlessioGiambrone
AlessioGiambrone / copy.sh
Last active March 12, 2017 16:37
Copy a big file in a LAN
rsync -avz -P --compress-level=9 $ORIGIN $USER@$HOST:$DESTDIR
#!/bin/bash
# Inutility that speaks all the numbers of a specified countdown
# You can also specify the language (e.g. en, it, da)
if [ -v $@ ]
then
underline=`tput smul`
nounderline=`tput rmul`
echo "Usage: countdown ${underline}SECONDS${nounderline} [${underline}LANGUAGE${nounderline}]"
@AlessioGiambrone
AlessioGiambrone / conkyrc
Created December 22, 2016 20:32
My conkyrc
conky.config={
double_buffer = true,
own_window = true,
own_window_argb_visual = true,
own_window_class = 'Conky',
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
own_window_transparent = true,
own_window_type = 'dock',
update_interval=1,
no_buffers = true,
@AlessioGiambrone
AlessioGiambrone / nvidia_graphic_memory.sh
Last active December 22, 2016 20:39
Nvidia graphic memory
# This is useful for get memory data to use, for example, with conky.
# this is ok, at least, for my graphic card.
free_graphic_memory=`nvidia-smi | sed -n "9p" | cut -d '|' -f 3 | cut -d '/' -f 1 | xargs`
total_graphic_memory=`nvidia-smi | sed -n "9p" | cut -d '|' -f 3 | cut -d '/' -f 2 | xargs`