Show current weather icon.
- DarkSky API
- post_darksky_to_influxdb.rb
- influxdb
- current_weather.html
# 2019_ncov_json.rb create json format for 2019-nCoV from Google Spread Sheets | |
# Thanks | |
# https://docs.google.com/spreadsheets/d/1wQVypefm946ch4XDp37uZ-wartW4V7ILdg-qYiDXUHM/htmlview?usp=sharing&sle=true | |
# https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6 | |
require 'open-uri' | |
require 'json' | |
require 'pp' | |
module GoogleSpreadSheet |
module Natural_sort | |
def natural_sort | |
zero_length = max_num_length_of(self) | |
number_formated_names = self.map do |data| | |
name_array = data.scan(/(\D*)(\d+)(\D*)/).flatten.reject(&:empty?) | |
name_array = [data] if name_array.empty? | |
number_formated_name_array = name_array.map do |e| | |
e.match(/\d/) ? format("%0#{zero_length}d", e.to_i) : e |
#!/bin/sh | |
# @(#) Reboot aterm router. | |
# @(#) shell script version: 20191202 | |
# @(#) Test router is ATERM-DD3B55 (FW: 1.8.56) | |
user=YOUR_USERNAME | |
pass=YOUR_PASSWORD | |
domain=http://192.168.0.1 | |
path=index.cgi/reboot_main_set |
# How to | |
# Meke video file and comment file and video length | |
# ex. ~/video.mp4 and ~/video.txt | |
# Run `ruby chapter-for-youtube-setlist.rb 1:23:23 video.txt` | |
# Generated ~/video.ini | |
# Run `ffmpeg -i ふろうふしのうた-Zw4bukluYcI.mp4 -i ふろうふしのうた-Zw4bukluYcI.ini -map_metadata 1 -c copy /ふろうふしのうた-Zw4bukluYcI-add-cap.mp4` | |
def to_ms(time) | |
t = time.split(":").map { |e| e.to_i } | |
s, m, h = t.reverse |
# How to | |
# Meke audio file and comment file | |
# ex. ~/audio.wav and ~/audio.txt | |
# Run `ruby cue-for-youtube-setlist.rb artist_name audio.wav` | |
# Generated ~/audio.cue | |
def to_index(time) | |
t = time.split(":").map { |e| e.to_i } | |
s, m, h = t.reverse | |
m = h * 60 + m if h |
# 指定したパブリックな Google Spread Sheet の1列目の値が重複した行を表示します | |
gss_url = "https://docs.google.com/spreadsheets/d/1iq_4d5ECOO6p5c3zJJg_mUMBNTPWbUzxGTxrNwGh8zs/htmlview?usp=sharing&sle=true" | |
def download_ggs(gss_url) | |
gss_html = `curl -# #{gss_url}` | |
ptt = /<div class="row-header-wrapper" style="line-height: 20px;">(\d*?)<\/div><\/th><td class.*?>(.*?)<\/td>/ | |
ggs = gss_html.scan(ptt) | |
end | |
id_and_song = download_ggs(gss_url) |
I hereby claim:
To claim this, I am signing this object:
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] |
# 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+ |