-
~/reconnect.sh
に置く -
1分おきに実行するように crontab -e して次を貼り付け
# disalble syslog from cron '(CRON) info (No MTA installed, discarding output)'
MAILTO=""
#!/bin/sh | |
# output by `figlet Pi zero' | |
# try `showfigfonts Pi zero' to choose another font! | |
echo "\e[33m | |
____ _ \e[1m\e[32mYou've logged into:\e[33m | |
| _ \(_) _______ _ __ ___ | |
| |_) | | |_ / _ \ '__/ _ \ | |
| __/| | / / __/ | | (_) | | |
|_| |_| /___\___|_| \___/ |
#!/bin/sh | |
base=192.168.1 | |
#beg=1 | |
#end=254 | |
# Mac (Mac's ping command has some different options (e.g. -i) than that of Linux?) | |
echo ${base}.{1..254} | xargs -P999 -n1 ping -c1 -t1 -i2| grep ttl |
CUIでSlackに草画像を投稿します。
投稿先のワークスペースはこちら → 招待リンク
$ cd /usr/local/bin # とか PATH の通ったところに移動
class BaseMixin: | |
"""ミックスインなので自身のインスタンス化を禁止""" | |
def __init__(self): | |
raise Exception('This is Mixin, thus cannot be instantiated itself.') | |
class SpeakMixin(BaseMixin): | |
"""発言用のspeakメソッドを定義""" | |
def speak(self, s): | |
print(f'{self.name}: {s}'); |
'use strict'; | |
import Hoge from './default-sub.js'; | |
let hoge = new Hoge(); | |
hoge.print(); |
################################################ | |
# unnbind key C-s, C-q in terminal | |
if [[ -t 0 ]]; then | |
stty stop undef | |
stty start undef | |
fi | |
# bind key Alt-h <- backward-kill-word | |
stty werase undef |
#!/usr/bin/sh | |
ubuntu_version() { | |
echo `cat /etc/lsb-release |grep -oP '(?<=").+(?=")'` | |
} | |
echo `ubuntu_version` |