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
javascript:(function () { | |
var map = document.getElementById('map'); | |
map.width = 1800; // 特に意味のある値ではない。小さいとガビるので、適当にこれぐらい。元々のmapはサイズの指定のないimgなので適当に画面幅とかになっている? | |
var c = document.createElement('canvas'); | |
c.width = map.width; | |
c.height = map.height; | |
var ctx = c.getContext('2d'); | |
ctx.drawImage(map, 0, 0); | |
map.src = c.toDataURL(); | |
})(); |
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
if ENV['MACKEREL_AGENT_PLUGIN_META'] == '1' | |
require 'json' | |
meta = { | |
:graphs => { | |
'dns.querytime' => { | |
:label => 'time', | |
:unit => 'integer', | |
:metrics => [ | |
{ |
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 ( | |
"flag" | |
"fmt" | |
"strconv" | |
) | |
type myVar struct { | |
V int64 |
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 <iostream> | |
#include <array> | |
#include <numbers> | |
#include <cmath> | |
int const N = 10; | |
int prev(int n) { | |
return (N + n - 1) % N; | |
} | |
double const dt = 0.0001; |
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
HOST_ID='xxx' | |
API_KEY='xxx' | |
OUTS=`sudo get-co2` | |
CO2=`echo ${OUTS} | jq ".co2"` | |
TEMP=`echo ${OUTS} | jq ".temperature"` | |
TT=`echo ${OUTS} | jq ".TT"` | |
TIME=`date +%s` | |
JSON=$(cat << EOS | |
[ | |
{ |
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
type: txt | |
help: Encapsulation of this IPv6 tunnel interface [REQUIRED] | |
default: "ip6gre" | |
syntax:expression: $VAR(@) in "ip6gre", "ipip6", "any"; "Must be (ip6gre, ipip6, any)" | |
allowed: echo ip6gre ipip6 any | |
create:expression: "true" | |
update:expression: "false" ; \ | |
"Encapsulation can only be set at tunnel creation for $VAR(../@)" |
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
{ | |
"lifecycle": { | |
"rule": [ | |
{ | |
"action": { | |
"type": "SetStorageClass", | |
"storageClass": "archive" | |
}, | |
"condition": { | |
"age": 30 |
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
default: &default | |
type: slack | |
channel: "#nana-memo" | |
webhook_url: https://hooks.slack.com/services/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 | |
user_name: "zatsu_monitor(torifune)" | |
nna774.net: | |
<<: *default | |
check_url: "https://nna774.net/" | |
nna774.net/blog: |
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
nana@hibiki:~$ sudo id | |
uid=0(root) gid=0(root) groups=0(root) | |
nana@hibiki:~$ sudo -u '#-1' id | |
uid=0(root) gid=1000(nana) groups=1000(nana) | |
nana@hibiki:~$ id | |
uid=1000(nana) gid=1000(nana) groups=1000(nana),4(adm),20(dialout),24(cdrom),25(floppy),27(sudo),29(audio),30(dip),44(video),46(plugdev),108(lxd),114(netdev) |
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 -xe | |
BUCKET='gs://nana-youtube' | |
TEMPDIR=$(mktemp -d) | |
DATE=$(date +%s) | |
./youtube-dl -v -o "${TEMPDIR}/${DATE}-%(title)s-%(id)s.%(ext)s" "$1" | |
./youtube-dl -J "$1" | tee "${TEMPDIR}/${DATE}.json" | |
gsutil cp "${TEMPDIR}/*" ${BUCKET} |
NewerOlder