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
<html> <head> <title> Color </title> <link rel="shortcut icon" href="data:image/vnd.microsoft.icon;base64,AA =="></link> | |
<script> var HttpRequestObject = false; | |
if (window.XMLHttpRequest) { HttpRequestObject = new XMLHttpRequest(); } else if (window.ActiveXObject) { HttpRequestObject = new ActiveXObject('Microsoft.XMLHTTP'); } | |
function changeColor() { if(HttpRequestObject) { HttpRequestObject.open('GET', 'http://nuru.local/setcolor?red=' + document.options.red.value + '&green=' + document.options.green.value +'&blue=' + document.options.blue.value, true); HttpRequestObject.send(); } } | |
</script> </head> <body> | |
<form name='options'> | |
Red <input type=range min=0 max=255 step=1 value=0 name='red' onchange='changeColor();'> <br> | |
Green <input type=range min=0 max=255 step=1 value=0 name='blue' onchange='changeColor();'> <br> | |
Blue <input type=range min=0 max=255 step=1 value=0 name='green' onchange='changeColor();'> <br> |
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 | |
avconv -r 15 -f image2 -i ./links/imageSequence%08d.jpg -s svga -vcodec libx264 -crf 16 video1.mp4 |
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
/interface bridge | |
add name=br-vlan2 protocol-mode=none | |
/interface ethernet switch port | |
set 1 default-vlan-id=2 vlan-header=add-if-missing | |
set 2 default-vlan-id=2 | |
set 3 default-vlan-id=2 | |
set 4 default-vlan-id=2 | |
/interface bridge filter | |
add action=set-priority chain=forward new-priority=3 passthrough=yes | |
/interface bridge port |
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 | |
# | |
# Author: Carlos Vargas (ContainerKing.Ninja) | |
# Script: centos4mesos.sh | |
echo "Configure Hostname Script" | |
curl https://gitlab.com/carlosvargas/devops/raw/master/CentOS/hostname>/tmp/hostname && chmod +x /tmp/hostname && sudo cp /tmp/hostname /etc/init.d/ | |
ln -s /etc/init.d/hostname /etc/rc3.d/S11hostname | |
# |
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
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
import requests | |
from datetime import datetime | |
import time | |
#https://stackoverflow.com/questions/1969240/mapping-a-range-of-values-to-another | |
def translate(sensor_val, in_from, in_to, out_from, out_to): | |
out_range = out_to - out_from | |
in_range = in_to - in_from |
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
#!/usr/bin/python | |
import RPi.GPIO as GPIO | |
from datetime import datetime | |
import time | |
#https://stackoverflow.com/questions/1969240/mapping-a-range-of-values-to-another | |
def translate(sensor_val, in_from, in_to, out_from, out_to): | |
out_range = out_to - out_from | |
in_range = in_to - in_from | |
in_val = sensor_val - in_from |
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 | |
# The script configures simultaneous AP and Managed Mode Wifi on Raspberry Pi Zero W (should also work on Raspberry Pi 3) | |
# Usage: curl https://gist.githubusercontent.com/lukicdarkoo/6b92d182d37d0a10400060d8344f86e4/raw | sh -s WifiSSID WifiPass APSSID APPass | |
# Licence: GPLv3 | |
# Author: Darko Lukic <lukicdarkoo@gmail.com> | |
# Special thanks to: https://albeec13.github.io/2017/09/26/raspberry-pi-zero-w-simultaneous-ap-and-managed-mode-wifi/ | |
MAC_ADDRESS="$(cat /sys/class/net/wlan0/address)" | |
CLIENT_SSID="${1}" | |
CLIENT_PASSPHRASE="${2}" |
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
#!/usr/bin/python3 | |
import requests | |
import base64 | |
import json | |
import string | |
import csv | |
import datetime | |
import os | |
header = ["data_id","Date","calendar_enabled","remote_start_enabled","vehicle_id","display_name","color","backseat_token","notifications_enabled","vin","backseat_token_updated_at","id","tokens","id_s","state","user_charge_enable_request","time_to_full_charge","charge_current_request","charge_enable_request","charge_to_max_range","charger_phases","battery_heater_on","managed_charging_start_time","battery_range","charger_power","charge_limit_soc","charger_pilot_current","charge_port_latch","battery_current","charger_actual_current","scheduled_charging_pending","fast_charger_type","usable_battery_level","motorized_charge_port","charge_limit_soc_std","not_enough_power_to_heat","battery_level","charge_energy_added","charge_port_door_open","max_range_charge_counter","charge_limit_soc_max","ideal_battery_range","managed_charging_active","charging_state","fast_charger_present","trip_charging","managed_char |
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
sudo k3s kubectl --namespace teslamate exec -it postgresql-0 -- /bin/bash -c "psql -U teslamate -d teslamate -c '\pset pager off' -c ' select id, date, date - lag(date, 1) over (order by date) delta from positions order by date desc limit 1000;'" >teslamate |
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
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/sha256" | |
"fmt" | |
"encoding/hex" | |
"strconv" | |
) |
OlderNewer