Skip to content

Instantly share code, notes, and snippets.

View eraclitux's full-sized avatar
☁️
scaling all the things

Andrea Masi eraclitux

☁️
scaling all the things
View GitHub Profile

Keybase proof

I hereby claim:

  • I am eraclitux on github.
  • I am eraclitux (https://keybase.io/eraclitux) on keybase.
  • I have a public key ASDNfgWUWAWgnUf5OHWxli-YFaRCiD0hNoPgjDm-wrAH3Ao

To claim this, I am signing this object:

@eraclitux
eraclitux / struct_utils.go
Last active October 13, 2015 08:33
lower case all struct's string fields in Go
// LowerStruct changes to lower case all struct's string fields
// of the passed struct.
func LowerStruct(strPtr interface{}) error {
str := reflect.ValueOf(strPtr)
if str.Kind() != reflect.Ptr {
return errors.New("pointer to struct expected")
#!/bin/sh
# Check for CVE-2014-6271 vulnerability
env x='() { :;}; echo vulnerable' bash -c "Checking..." 2> /dev/null | grep -q vulnerable;
if [ $? -eq 0 ]; then
echo "Vulnerable!"
exit 0
fi
echo "Not vulnerable!"
exit 1
@eraclitux
eraclitux / filecount.sh
Last active November 7, 2022 15:22
Find dirs with many files
#In case of 100% of inode usage you simply copy and paste this snippet to find directories with more files
find / -xdev -type f | cut -d "/" -f 2,3 | sort | uniq -c | sort -n
@eraclitux
eraclitux / py-arduino.py
Last active September 20, 2015 17:05
Simple code to test Arduino to Python serial communication
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Sample code to test Arduino to Python serial communication
"""
import serial
error_message="################ !!! Communication Error !!! ################\n"
@eraclitux
eraclitux / arduino-py.ino
Last active August 29, 2015 14:00
Arduino sample code that sends back received chars.
/*
Arduino sample code that sends back received chars
*/
int rbyte=0;
void setup () {
Serial.begin(9600);
}
void loop () {
if (Serial.available() > 0) {