Skip to content

Instantly share code, notes, and snippets.

View MatteoRagni's full-sized avatar
🎱

Matteo Ragni MatteoRagni

🎱
View GitHub Profile
@MatteoRagni
MatteoRagni / Install_LVM.md
Last active August 29, 2015 13:57
Una piccola guida, per installare LVM su 2 hdd e mantenendo tutti i file. Backup a discrezione!

Uprage a LVM

Convenzioni

Di seguito le convenzioni utilizzato in questa piccola guida. Si considerano i seguenti device fisici:

  • /dev/sda: device che contiene la partizione del sistema operativo;
  • /dev/sdb: device che contiene una partizione NTFS, con dati che devono essere importati nell'LVM;
  • /dev/sdc: device senza partizioni, che verrà aggiunto all'LVM.
@MatteoRagni
MatteoRagni / hello_world_arduino.ino
Last active August 30, 2015 15:14
Arduino per la didattica. Sorgenti corretti.
void setup() {
Serial.begin(115200);
}
void loop() {
if (Serial.available()) {
if (Serial.read() == 'a') {
Serial.println("Hello, World!")
}
}
@MatteoRagni
MatteoRagni / laser_scanner.ino
Created August 30, 2015 15:25
Arduino per la didattica. Sorgenti da completare
#include <Servo.h>
Servo servo;
#define SERVO_MIN 5
#define SERVO_MAX 175
#define STEP_SIZE 1
// Definizione della interfaccia:
#define SERIAL_LASER_ON 'l'
#define SERIAL_LIGHTS_ON 'd'
@MatteoRagni
MatteoRagni / rPi_RT5370.markdown
Last active September 24, 2015 07:57
Impostare un access point su Raspberry Pi 2 con scheda wifi RT5370

Raspberry Pi Access point

Aggiornamento

Assolutamento necessario che il dispositivo sia aggiornato, sia come software che come firmware. Di seguito la lista di comandi necessario

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
@MatteoRagni
MatteoRagni / EquationCreator.rb
Last active December 30, 2015 12:03
Simple script to create equations that could be inserted in Github readme files as images.
#!/usr/bin/env ruby
##
# Generates Equations GIF files for readme.
# Equations must be inserted in a YAML file.
# The parts in configuration will be inserted in each file, in header section,
# to allow definitions of new command and so on.
#
# Binary accepts as input:
@MatteoRagni
MatteoRagni / thesaurus.rb
Last active January 18, 2016 12:35
A simple command line thesaurus dictionary. Thesaurus service provided by [words.bighugelabs.com]
#!/usr/bin/env ruby
# Simple thesaurus script
# Thesaurus service provided by [words.bighugelabs.com]
require 'net/http'
require 'getoptlong'
require 'colorize'
require 'yaml'
require 'json'
@MatteoRagni
MatteoRagni / bib.rb
Created January 18, 2016 13:09
Searcher for bibliography. Requires scholar.py
#!/usr/bin/env ruby
require 'colorize'
# Comment a paper using %
$PAPERS = <<-ENDOFLIST
ENDOFLIST
$PAPERS = $PAPERS.chomp.split /\n/
@MatteoRagni
MatteoRagni / LauraKeylogger.md
Last active February 15, 2016 10:47
Laura key-logger explained

Struttura

Il programma è composto di tre elementi principali, che sono necessari al logging dei dati:

  • una chrome application
  • una chrome extension
  • una classe javascript iniettata nelle pagine visitate. Vienne chiamato injeted code o context script

Detto questo, il programma funziona sulla pagina correntemente visualizzata solo se:

@MatteoRagni
MatteoRagni / update_gnome_extensions.rb
Last active April 21, 2016 19:48
Update "shell-variable" in "manifest.json" for Gnome Extensions
#!/usr/bin/env ruby
require "json"
# Changes the shell-version variable for all local active extensions
$EXTENSIONS_LIST = eval(`gsettings get org.gnome.shell enabled-extensions`)
if not $EXTENSIONS_LIST.is_a?(Array)
raise RuntimeError "Cannot read extension list"
end
$SHELL_VERSION = `gnome-shell --version`
@MatteoRagni
MatteoRagni / atlas-lapack.md
Last active April 27, 2016 18:41
Some passage to update `atlas-lapack` AUR package on my intel machine...

atlas-lapack on Arch

Poweroff, on grub screen press e on Arch entry to add on the linux line (after quiet option) the option:

intel_pstate=disable

and boot. Login and run in a terminal: