Skip to content

Instantly share code, notes, and snippets.

View GiovanniBalestrieri's full-sized avatar
🍣
When there is a shell, there is a way

UserK GiovanniBalestrieri

🍣
When there is a shell, there is a way
View GitHub Profile
@GiovanniBalestrieri
GiovanniBalestrieri / append.sh
Last active April 13, 2016 14:03
[Bash] Append labels to file. Appends ,yes to positive and ,no to negative
#!/bin/bash
# Path variables
csvPath="/tmp"
echo Please, enter the initial portion of the filename you want to modify
read filename
echo The following file will be modified:
file=$(ls -t $csvPath | grep -v NEG | grep TEST_POS_$filename | head -1)
echo "Labelled file: ${file}"
@GiovanniBalestrieri
GiovanniBalestrieri / CSV Negative samples for Weka
Created April 13, 2016 12:18
Training set - negative instances
0,"Drammatico","final_cinema_event",748987,475122,412593,0,1,1,0
0,"Commedia","final_cinema_event",778845,784652,787974,0,0,1,0
1,"Biografia","final_cinema_event",998511,475122,143153,0,0,1,0
@GiovanniBalestrieri
GiovanniBalestrieri / CSV Positive Samples for Weka
Created April 13, 2016 12:17
Training set - positive samples
1,"Fantasy","final_cinema_event",612578,784652,412593,1,1,0,0
0,"Animazione","final_cinema_event",665355,765651,412593,1,1,0,1
1,"Commedia","final_cinema_event",326814,448159,456148,1,1,0,1
@GiovanniBalestrieri
GiovanniBalestrieri / Weka - ARFF file
Last active April 13, 2016 16:44
Example of ARFF file
@relation trainingSet-weka.filters.unsupervised.attribute.Remove-R2
@attribute titleAffinity integer
@attribute genre string
@attribute category string
@attribute director integer
@attribute actor1 integer
@attribute actor2 integer
@attribute imageFeature1 integer
@attribute imageFeature2 integer
@GiovanniBalestrieri
GiovanniBalestrieri / Append provided string to file
Created March 1, 2016 17:42
The following script selects the last modified file for which the name matches a string provided. Then appends the second input argument to that file
#!/bin/bash
echo Please, enter the string to append:
read pattern
echo Please, enter the initial portion of the filename you want to modify
read filename
echo The following file will be modified:
ls -t | grep $filename | head -1
ls -t | grep $filename | head -1 | xargs sed "s/$/$pattern/" -i
@GiovanniBalestrieri
GiovanniBalestrieri / Append String to Last Modified File
Created March 1, 2016 14:33
Bash Script to append string to the last modified file
#!/bin/bash
ls -t | head -1 | xargs sed 's/$/,yes/' -i
void setup()
{
Serial.begin(115200);
}
void loop()
{
SerialRoutine();
}
@GiovanniBalestrieri
GiovanniBalestrieri / config file chroot ROS
Created November 3, 2015 14:10
Configuration file for the Chroot to install ROs indigo in Ubuntu 15.10
[indigo_trusty]
description=Ubuntu 15.10 for installing ROS Indigo
directory=/srv/chroot/indigo_trusty
root-groups=root
type=directory
users=YOUR_USERNAME
personality=linux
preserve-environment=false
@GiovanniBalestrieri
GiovanniBalestrieri / Bluetooth.ino
Created November 1, 2015 20:16
Arduino bluetooth example
void setup()
{
Serial.begin(115200);
}
void loop()
{
SerialRoutine();
}
@GiovanniBalestrieri
GiovanniBalestrieri / wp-config.php
Last active October 15, 2015 23:32
Wordpress wp-config.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'wpuser');
/** MySQL database password */
define('DB_PASSWORD', 'YOUR_PASSWORD');