This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab -e | |
# * * * * * /root/scripts/hdd-wakeup.sh >> /root/logs/hdd-wakeup.log 2>&1 | |
devices=$(mount -l | grep -o '/dev/sd[a-z][0-9]') | |
if [ "$devices" == "" ]; then | |
echo "$(date "+%Y-%m-%d %H:%M:%S") No HDD mounted" | |
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
add=`svn status |\ | |
grep ? |\ | |
grep '\.[a-z]\{2,4\}$' |\ | |
grep -v '\.sql$' |\ | |
grep -v '\.sh$' |\ | |
grep -v '\.gz' |\ | |
grep -v '\.tar' |\ | |
grep -v '\.swp' |\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
del=`svn status | grep ! | grep -v localhost | awk -F' ' '{print $2}'` | |
if [ "$del" != '' ]; then | |
svn del $del | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '' | |
case "$1" in | |
'bootstrap') | |
alias="$1" | |
url='https://github.com/twbs/bootstrap/trunk/dist' | |
;; | |
'fontawesome'|'font-awesome') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Put this file into a folder with PNG pictures with transparent background | |
# ----- Default values ----- # | |
ext='.png' # Original pictures have this extension | |
prefix='frame-' # Final pictures name with this prefix | |
background='white' # Final pictures background color | |
padding=100 # Do not fit to max width/height, leave some padding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add goaccess repository | |
echo "deb http://deb.goaccess.io/ xenial main" > /etc/apt/sources.list.d/goaccess.list | |
# Add repository keys | |
gpg --keyserver keyserver.ubuntu.com --recv-key 742483B7B222C443 | |
gpg -a --export 742483B7B222C443 | apt-key add - | |
# Update apt | |
apt-get update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <EEPROM.h> // libreria para gardar datos na eeprom | |
#include <OneWire.h> // libreria para comunicación do sensor de temperatura | |
#include <DallasTemperature.h> // libreria do sensor de temperatura | |
#include <NewPing.h> // libreria do sensor de ultrasonidos | |
#include <LiquidCrystal.h> // libreria das pantallas lcd | |
#include <Wire.h> // libreria para comunicacións | |
#include "RTClib.h" // libreria do reloxo | |
#define TRIGGER_PIN 7 // pin do Arduino conectado á patilla Trigger do sensor de ultrasonidos | |
#define ECHO_PIN 6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
e() { | |
echo "" | |
echo "$1" | |
echo "" | |
} | |
if [ "$(whoami)" != "root" ]; then | |
e "Only allowed for root" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
setInterval(function() { | |
var formId = ''; // Form ID to send | |
var interval = 120; // Seconds | |
var xhr; | |
function log(message) { | |
console.log(new Date(), message); | |
} | |
function ajax(method, url, data, callback) { |