Skip to content

Instantly share code, notes, and snippets.

View jorgecasas's full-sized avatar

Jorge Casas jorgecasas

View GitHub Profile
<?php
$intervals = ["1h","30m","15m","5m","1m"];
$timestamp_start = strtotime('-2 days');
//get list of symbols
$xinfo = json_decode(file_get_contents("https://api.binance.com/api/v1/exchangeInfo"), true);
$symbols = [];
foreach($xinfo["symbols"] as $sym) {
$symbols[] = $sym["symbol"];
@jorgecasas
jorgecasas / touchpad-disable.sh
Created October 13, 2016 06:32
Touchpad disable / enable detecting if USB mouse is present
#!/bin/bash
list=`xinput --list | grep -i 'mouse'`
if [ ${#list} -eq 0 ]; then
exec `synclient touchpadoff=0`
notify-send "Touchpad on" "Mouse not present"
else
exec `synclient touchpadoff=1`
notify-send "Touchpad off" "Mouse present"
fi
@jorgecasas
jorgecasas / gearman-jobs.sh
Last active May 4, 2016 09:48
Gearman jobs monitoring using console
#!/bin/bash
# Get args.
reload=false
while [ "$1" != "" ]; do
case $1 in
-r | --reload ) reload=true
;;
-h | --help ) echo ""
@jorgecasas
jorgecasas / 02updatehosts
Created March 1, 2016 08:35
Linux - Change hosts file automatically depending on WiFi
#!/bin/sh
# Script to change hosts file when your router does not allow ip loopback
#
# Save it in /etc/NetworkManager/dispatcher.d
wifi=`iwgetid -r`;
if [ $wifi = 'ESSID_WIFI' ];
then
cat /etc/hosts.common /etc/hosts.in > /etc/hosts