Skip to content

Instantly share code, notes, and snippets.

View lucazpf's full-sized avatar
🎯
Focusing

Luca Scalvi lucazpf

🎯
Focusing
View GitHub Profile
@lucazpf
lucazpf / python-pid_controller
Last active January 28, 2018 15:05 — forked from chaosmail/python-pid_controller
Simple PID Controller
def pid_controller(y, yc, h=1, Ti=1, Td=1, Kp=1, u0=0, e0=0):
"""Calculate System Input using a PID Controller
Arguments:
y .. Measured Output of the System
yc .. Desired Output of the System
h .. Sampling Time
Kp .. Controller Gain Constant
Ti .. Controller Integration Constant
Td .. Controller Derivation Constant
@lucazpf
lucazpf / gtk.css
Created January 25, 2018 17:52
Fix for dashed border in Cinnamon windows
/* Create this file in ~/.config/gtk-3.0 */
.undershoot.top, .undershoot.right, .undershoot.bottom, .undershoot.left { background-image: none; }
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@lucazpf
lucazpf / gist:1dc18b5f3664bae36394ffb800f61788
Created July 13, 2017 18:07
NZXT Kraken X52 temp control
while true
do
var=$(sensors | grep Physical | cut -c18-19)
sudo camctl -f $var
sleep 5
done
@lucazpf
lucazpf / Create RAID 1 array
Last active March 1, 2017 17:58
Create RAID 1 array
sudo apt-get install mdadm
fdisk /dev/sda
sudo fdisk /dev/sda
sudo mdadm --zero-superblock /dev/sda /dev/sdb
fdisk /dev/sda
sudo fdisk /dev/sda
sudo fdisk /dev/sdb
mdadm -E /dev/sd[a-b]
sudo mdadm -E /dev/sd[a-b]
sudo mdadm --create /dev/md0 --level=mirror --raid-devices=2 /dev/sd[a-b]1
@lucazpf
lucazpf / SDBC-MySQL-Drivers
Created August 1, 2016 13:40
SDBC-MySQL-Drivers
sudo apt-get install libreoffice-sdbc-hsqldb
sudo apt-get install libreoffice-mysql-connector
@lucazpf
lucazpf / next.sh
Created July 26, 2016 18:14
Audacious control tool
export DISPLAY=:0 && audtool --playlist-advance
@lucazpf
lucazpf / Install LAMP (PHP 7.0) and downgrade to 5.6
Last active March 1, 2017 17:59
Install LAMP (PHP 7.0) and downgrade to 5.6
sudo apt-get install apache2 php7.0 mysql-server-5.7 phpmyadmin
sudo xed /etc/apache2/sites-available/000-default.conf
sudo service apache2 restart
sudo apt-get install -y libapache2-mod-
sudo apt-get install -y libapache2-mod-php7.0
sudo service apache2 restart
sudo apt-get install php7.0-mysql php7.0-curl php7.0-gd php7.0-intl php7.0-mcrypt
sudo service apache2 restart
sudo apt-get install php7.0-mbstring
sudo service apache2 restart
@lucazpf
lucazpf / fix-razer-mouse-sensitivity.sh
Created July 27, 2015 17:27
Fix for Razer Mouse sensitivity on Linux
#!/bin/sh
xinput --set-prop "Razer DeathAdder" "Device Accel Constant Deceleration" 5
xinput --set-prop "Razer DeathAdder" "Device Accel Velocity Scaling" 1
xinput --set-prop "Razer DeathAdder" "Device Accel Profile" -1
@lucazpf
lucazpf / RGB to HTML converter
Created February 6, 2015 08:52
RGB to HTML converter
#!/bin/bash
#Stampa il menù iniziale
clear
echo "===HTML to RGB converter==="
echo ""
echo "1.      HTML -> RGB"
echo "2.      RGB -> HTML"
echo ""
echo "==========================="
#Salva la scelta fatta dall'utente nella variabile menu