I hereby claim:
- I am coro365 on github.
- I am coro365 (https://keybase.io/coro365) on keybase.
- I have a public key ASCKp7DefhT8lYmVe96KS0HhAzp8ZrnTjKfwbhAQMKBxxAo
To claim this, I am signing this object:
path = ARGV[0] | |
Dir.glob("#{path}/*") do |file| | |
next unless file.index(/jpeg$|jpg$|png$/) | |
# get image pixel size | |
width, hight = `identify -format "%w %h" #{file}`.split(" ") | |
new_file = File.basename(file) + "-trimed" + File.extname(file) | |
# trim |
#!/bin/sh | |
# @(#) This script will turn on / off the screen of the Mac or run the screen saver. | |
# @(#) Argument:on, off, saver and display_status. Support macOS Mojave version.20181016 | |
if [ -z "$1" ]; then | |
echo "Argument is missing!" | |
exit 1 | |
elif [ "$1" == "on" ]; then | |
caffeinate -u -t 1 |
require "influxdb" | |
def current_value(field,location,device="none") | |
host = 'hostname.local' | |
database = 'home-sensor' | |
influxdb = InfluxDB::Client.new database,:host => host | |
# query | |
result = influxdb.query "select value from #{field} where location='#{location}' order by desc limit 1 tz('Japan')" |
# Please take the time to finish this file as described in | |
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/ | |
# and make it available to others by sending it to | |
# <lirc@bartelmus.de> | |
# | |
# This config file was automatically generated | |
# using lirc-0.9.4c(default) on Mon Jun 25 16:59:39 2018 | |
# Command line used: -n -d /dev/lirc0 | |
# Kernel version (uname -r): 4.14.42-v7+ |
# Please take the time to finish this file as described in | |
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/ | |
# and make it available to others by sending it to | |
# <lirc@bartelmus.de> | |
# | |
# This config file was automatically generated | |
# using lirc-0.9.4c(default) on Sat Sep 8 00:33:03 2018 | |
# Command line used: -n -d /dev/lirc0 | |
# Kernel version (uname -r): 4.14.52-v7+ |
require "pp" | |
def arp | |
result = `arp -a` | |
lines = result.split("\n") | |
address_table = Array.new | |
lines.each do |line| | |
ip = line[/\((.*?)\)/,1] | |
mac = line[/at\ (.*?)\ on/,1] |
def initialize_state | |
$mode_state_file = "#{__dir__}/mode_state_file" | |
$power_state_file = "#{__dir__}/power_state_file" | |
update_mode_state(1) unless FileTest.exist?($mode_state_file) | |
update_power_state(1) unless FileTest.exist?($power_state_file) | |
$mode_state = File.read($mode_state_file).to_i | |
$power_state = File.read($power_state_file).to_i | |
$mode_name = ["low", "mid", "high", "auto"] | |
end |
def initialize_state | |
$color_state_file = "#{__dir__}/color_state_file" | |
$brightness_state_file = "#{__dir__}/brightness_state_file" | |
update_color_state(10) unless FileTest.exist?($color_state_file) | |
update_brightness_state(10) unless FileTest.exist?($brightness_state_file) | |
$color_state = File.read($color_state_file).to_i | |
$brightness_state = File.read($brightness_state_file).to_i | |
end |
I hereby claim:
To claim this, I am signing this object: