Skip to content

Instantly share code, notes, and snippets.

View gnuton's full-sized avatar
:shipit:

Antonio Aloisio gnuton

:shipit:
View GitHub Profile
@gnuton
gnuton / gist:3ba6dca3ce27d13833da
Created December 3, 2015 23:09
Python script which switch Huawey hilink e3372 to debug mode, then sends some command to its serial console.
import urllib2
# retrieve token
url="http://192.168.8.1/api/webserver/token"
response = urllib2.urlopen(url)
xml=response.read()
token=xml[59:-23]
print "Got token %s" % token
@gnuton
gnuton / Mixamo.js
Last active January 22, 2024 07:29
Script which downloads all mixamo animations for one character.
// Mixamo Animation downloadeer
//
// Author: Antonio Aloisio <gnuton@gnuton.org>
// Contributions: kriNon
//
// The following script make use of mixamo2 API to download all anims for a single character that you choose.
// The animations are saved with descriptive long names instead of the short ones used by default by mixamo UI.
//
// This script has been written by gnuton@gnuton.org and the author is not responsible of its usage
//
@gnuton
gnuton / slowprint.py
Created February 14, 2016 09:17
Python slow print
import sys
import time
def slowprint(s):
for c in s + '\n':
sys.stdout.write(c)
sys.stdout.flush()
time.sleep(1./10)
if __name__ == "__main__":
@gnuton
gnuton / gist:6a02225b0cbff6547b78723564aee63c
Created November 22, 2019 11:38
AWS SES send file with attachment in bash
function sendCSVviaEmail {
echo "Sending file via email..."
AWS_CLI="/usr/bin/aws"
SENDER=${EMAIL_SENDER}
RECIPIENT=${EMAIL_RECIPIENT}
SUBJECT=${EMAIL_SUBJECT}
BODY=${EMAIL_BODY}
ATTACHMENT_TYPE="text/plain"
ATTACHMENT_FILE_NAME="report.csv"
#!/bin/ash
# This script filters the logs and send it via mail
# Installation on openwrt
#- opkg update && opkg install diffutils
#- install and setup ssmtp (https://fleshandmachines.wordpress.com/2014/09/14/openwrt-automatic-email-sending/)
#- add it to crontab
# Rules
RULES="grep -v info"
postgres=# SELECT TO_DATE('2020-W53','YYYY-XWW');
-[ RECORD 1 ]-------
to_date | 2020-12-30
May 5 05:05:21 kernel: klogd started: BusyBox v1.25.1 (2020-08-24 13:10:55 CST)
May 5 05:05:21 kernel: Linux version 2.6.36.4brcmarm (root@asus) (gcc version 4.5.3 (Buildroot 2012.02) ) #1 SMP PREEMPT Mon Aug 24 13:18:01 CST 2020
May 5 05:05:21 kernel: CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c53c7f
May 5 05:05:21 kernel: CPU: VIPT nonaliasing data cache, VIPT nonaliasing instruction cache
May 5 05:05:21 kernel: Machine: Northstar Prototype
May 5 05:05:21 kernel: Ignoring unrecognised tag 0x00000000
May 5 05:05:21 kernel: Memory policy: ECC disabled, Data cache writealloc
May 5 05:05:21 kernel: Built 1 zonelists in Zone order, mobility grouping on. Total pages: 60416
May 5 05:05:21 kernel: Kernel command line: root=/dev/mtdblock2 console=ttyS0,115200 init=/sbin/preinit earlyprintk debug
May 5 05:05:21 kernel: Memory: 255504k/255504k available, 6640k reserved, 0K highmem
@gnuton
gnuton / fadeout.xml
Created June 16, 2013 07:10
Android Infinite rotation animation
<?xml version="1.0" encoding="UTF-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate
xmlns:android="http://schemas.android.com/apk/res/android"
android:fromDegrees="0"
android:toDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:duration="2000"
mips-linux-uclibc-gcc -mips32r2 -msoft-float -pipe -Wall -I. -I./asp -I../../shared/ -I/build/apps/private/utils -I/build/apps/public/json-c -I../../libdisk/ -I/build/apps/private/access_log -I/build/apps/public/networkmap -G0 -fshort-wchar -DTRENDCHIP -O2 -DLINUX26 -DTCSUPPORT_CPU_MT7510 -DTCSUPPORT_CPU_RT63365 -DTC3262 -DTCSUPPORT_MT7510_FE -DTCSUPPORT_ADDR_MAPPING -DTCSUPPORT_WAN_ITF_LIMIT -DTCSUPPORT_HWNAT_LED -DTCSUPPORT_WLAN_MT7592_PCIE -DTCSUPPORT_2_6_36_KERNEL -DTCSUPPORT_WAN_ATM -DTCSUPPORT_WAN_PTM -DTCSUPPORT_WAN_ETHER -DTCSUPPORT_QDMA_BUFMGR -DTCSUPPORT_BB_NAND -DTCSUPPORT_NAND_BMT -DTCSUPPORT_SQUASHFS_ADD_YAFFS -DTCSUPPORT_YAFFS_FS -DTCSUPPORT_YAFFS_BLOCK=400 -DTCSUPPORT_DDR_CALI -DTCSUPPORT_BOOTROM_LARGE_SIZE -DSTART_ADDR=0x80002000 -DTCSUPPORT_FREE_BOOTBASE -DTR068_LED -DTCSUPPORT_WLAN -DWSC_AP_SUPPORT -DLED_WPSSPEC_COMPLY -DIGMP_SNOOP_SUPPORT -DMT7592 -DBBUTOWBU -DMT7612E -DBBUTOWBU -DTCSUPPORT_DUAL_WLAN -DTCSUPPORT_WLAN_AC -DVHT_SUPPORT -DTCSUPPORT_USBHOST -DRTCONFIG_USB -DTCSUPPORT_USB_NTFS
@gnuton
gnuton / gist:5d4a2cb921ce9e34f5269d4145e794a8
Last active February 29, 2020 22:09
Chimera version 0.1
def leggi_file(nome_file):
file = open(nome_file, 'r')
lineee = file.read()
file.close()
return linee
def calcola_percentuali(linee):
diz={}
for line in linee:
x = line.strip().split(" ")