Skip to content

Instantly share code, notes, and snippets.

View sharl's full-sized avatar
🐰

Sharl Morlaroll sharl

🐰
View GitHub Profile
@sharl
sharl / sslexpire
Last active August 29, 2015 14:01
#!/bin/bash
#
# usage: $0 domain[:port] [alert days] [timeout]
# ex)
# $0 yahoo.com 365
#
server=${1//:*/}
port=${1/*:/}
test "$server" = "$port" && port=443
@sharl
sharl / gist:79d6b9d0d4b1358d5f6c
Last active August 29, 2015 14:02
git-clone-alter result
$ git clone-alter --name hoge --email "hoge@hoge" [email protected]:uricle/tiarra-modules.git
Cloning into 'tiarra-modules'...
remote: Counting objects: 41, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 41 (delta 22), reused 40 (delta 22)
Receiving objects: 100% (41/41), 21.26 KiB, done.
Resolving deltas: 100% (22/22), done.
$ tail -3 tiarra-modules/.git/config
[user]
name = hoge
@sharl
sharl / git-clone-alter
Last active August 29, 2015 14:02
git-clone-alter
#!/bin/bash
function usage() {
prog=$(basename $0)
cat <<EOF
Usage: $prog [option] [--] [git clone command]
-n, --name <name>
-e, --email <email>
class MentionWithURLQuoteCommand(TypableMapCommand): # {{{2
''' 最近対応したインライン引用をする発言を行います '''
def __init__(self, manager, processor, msg, status, args):
TypableMapCommand.__init__(self, manager, processor, msg, status, args)
self.include_user = False
def process(self):
text = '%s ' % self.args if self.args else ''
url = 'https://twitter.com/%s/status/%s' % (self.status.User.ScreenName, self.status.Id)
update_text = '%s\n%s' % (text, url)
$ date; for h in twitter.com:443 smtp.spmode.ne.jp:465 imap.spmode.ne.jp:993 imap2.spmode.ne.jp:993 smtp.ezweb.ne.jp:465 imap.ezweb.ne.jp:993 smtp.softbank.jp:465 imap.softbank.jp:993; do (openssl s_client -connect $h -ssl3 -no_tls1 < /dev/null > /dev/null) 2>&1 | grep -q "handshake failure" && echo OK $h || echo NG $h; done
Thu Oct 16 10:49:39 JST 2014
OK twitter.com:443
NG smtp.spmode.ne.jp:465
NG imap.spmode.ne.jp:993
NG imap2.spmode.ne.jp:993
NG smtp.ezweb.ne.jp:465
NG imap.ezweb.ne.jp:993
NG smtp.softbank.jp:465
NG imap.softbank.jp:993
@sharl
sharl / gist:604e05180fbd158c5555
Last active August 29, 2015 14:07
POODLE test revised
$ date; for h in twitter.com:443 smtp.spmode.ne.jp:465 imap.spmode.ne.jp:993 imap2.spmode.ne.jp:993 smtp.ezweb.ne.jp:465 imap.ezweb.ne.jp:993 smtp.softbank.jp:465 imap.softbank.jp:993; do for c in $(openssl ciphers -v | egrep "RC4|CBC" | cut -d" " -f1); do (openssl s_client -connect $h -ssl3 -cipher $c < /dev/null > /dev/null 2>&1) && echo NG $h $c; done; done
Thu Oct 16 13:25:21 JST 2014
NG smtp.spmode.ne.jp:465 DES-CBC3-SHA
NG imap.spmode.ne.jp:993 DES-CBC3-SHA
NG imap2.spmode.ne.jp:993 DES-CBC3-SHA
NG smtp.ezweb.ne.jp:465 DES-CBC3-SHA
NG smtp.ezweb.ne.jp:465 RC4-SHA
NG imap.ezweb.ne.jp:993 DES-CBC3-SHA
NG imap.ezweb.ne.jp:993 RC4-SHA
NG smtp.softbank.jp:465 DES-CBC3-SHA
@sharl
sharl / gist:bd7049761b4bb70d391fc65e41b1c211
Last active October 2, 2016 14:42
future-architect/vuls で gopkg.in/gomail.v2 で詰まったので解決した
$ go get github.com/go-gomail/gomail
$ cd $GOPATH/github.com/go-gomail/gomail/
$ git fetch origin v2:v2
$ git checkout v2
$ mkdir -p $GOPATH/gopkg.in
$ cp -a $GOPATH/github.com/go-gomail/gomail $GOPATH/gopkg.in/gomail.v2
$ go get gopkg.in/gomail.v2
$ go get github.com/future-architect/vuls
@sharl
sharl / AirPods.md
Last active December 14, 2016 08:41
AirPodsを最速で予約する

#ssmjp参加者 Advent Calendar 2016 - Adventar 13日目です。

普段は「どうやったら監視できるか」「どうやったら運用が楽になる監視ができるか」ということを考えながら内製の監視システムを作成しています。

AirPodsを最速で予約する

どーしても発売後すぐ予約したかったので、ふにふにとスクリプトを書いた。

#!/bin/bash
@sharl
sharl / wsl-sshd-startup.md
Last active June 29, 2020 07:57
WSL sshd startup

WSL1向け

/etc/ssh/ssh_host_rsa_key

ホストキーがないので生成

$ sudo ssh-keygen -t rsa -N '' -f /etc/ssh/ssh_host_rsa_key
@sharl
sharl / SHIROBAKO.pl
Created February 1, 2018 06:26
SHIROBAKO
#!/usr/bin/perl -l
# -*- coding: utf-8 -*-
use strict;
use warnings;
my $word = $ARGV[0];
exit unless $word;
use NKF;
use LWP::UserAgent;