Skip to content

Instantly share code, notes, and snippets.

View doublemarket's full-sized avatar

Hayato Matsuura doublemarket

View GitHub Profile
@doublemarket
doublemarket / certcheck.sh
Created September 1, 2024 07:33
SSL certificate expiration check script
#!/bin/bash
# ./certcheck.sh [domain name]
DOMAIN=$1
notAfter=$(echo -n Q | openssl s_client -connect ${DOMAIN}:443 -servername ${DOMAIN} 2>/dev/null | openssl x509 -noout -enddate | grep notAfter | sed 's/notAfter=//')
notAfterEpic=$(date -d "${notAfter}" +\%s)
twoWeeksLaterEpic=$(date -d 'now + 2 weeks' +\%s)
nowEpic=$(date +\%s)
@doublemarket
doublemarket / bagel.md
Last active April 28, 2021 08:43
ベーグル屋さん
@doublemarket
doublemarket / collectd.go
Last active March 12, 2018 16:32
Small Go server getting metrics from Collectd and dumping into stdout
package main
import (
"context"
"log"
"net"
"os"
"collectd.org/format"
"collectd.org/network"
@doublemarket
doublemarket / restaurants.md
Created June 8, 2017 06:11
Restaurants around the Tokyo office
@doublemarket
doublemarket / index.html
Last active December 6, 2017 05:06
Welcome
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Welcome to GitHub Japan</title>
@doublemarket
doublemarket / rrd.go
Created January 11, 2017 09:07
Sample program to fetch data from an RRD file using ziutek/rrd
package main
import (
"fmt"
"path/filepath"
"strings"
"time"
"github.com/ziutek/rrd"
)
@doublemarket
doublemarket / wifirestart.sh
Created August 23, 2016 07:12
Restarting wifi interface on Mac
alias wr='/usr/sbin/networksetup -setairportpower en0 off && sleep 1 && /usr/sbin/networksetup -setairportpower en0 on'