$ cat watch.sh
#!/bin/bash
wget -O - --http-user=admin --http-password=hoge http://192.168.0.1/usr/jp/adm/statistic.asp | gzip -c -9 > "$(date '+%Y%m%d%H%M%S').html.gz"
$ cat switch.sh
{ | |
"config": { | |
"chainId": 15, | |
"homesteadBlock": 0, | |
"eip155Block": 0, | |
"eip158Block": 0 | |
}, | |
"nonce": "0x0000000000000042", | |
"timestamp": "0x0", | |
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", |
module CacheSupport | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def cache_key | |
"#{name}/#{ids.hash}-#{maximum(:updated_at).to_i}" | |
end | |
end | |
end |
#!/usr/bin/env ruby | |
require "pry-byebug" | |
# execute pre-commit hooks | |
class PreCommitRunner | |
def run | |
check_eslint | |
check_rubocop | |
end |
['a', 'b', 'c', 'd'].permutation.to_a[Digest::MD5.hexdigest("hogefuga").to_i(16) % 24] | |
#=> ["a", "b", "d", "c"] |
$ cat watch.sh
#!/bin/bash
wget -O - --http-user=admin --http-password=hoge http://192.168.0.1/usr/jp/adm/statistic.asp | gzip -c -9 > "$(date '+%Y%m%d%H%M%S').html.gz"
$ cat switch.sh
require 'dashed' | |
require 'net/https' | |
# main class | |
class Yamadash | |
USERNAME = 'yamada' | |
ICONURL = '' | |
MACADDRESS = '12:34:56:78:90:ab' | |
DEVICENAME = 'wlp2s0' |
# monthly 25th 18:00(UTC) == 03:00(JTC) renew | |
00 18 25 * * /etc/init.d/nginx stop && /home/iberianpig/certbot/certbot-auto renew --force-renew && /etc/init.d/nginx start |
# ./lib/tasks/db.rake | |
require 'active_record' | |
@logger = Logger.new(STDOUT) | |
namespace :db do | |
desc "Make seed data importable with seed_fu" | |
task :dump_seed_fu, [:model] => :environment do |t, args| | |
model_name = args.model.underscore | |
class_name = args.model.camelize |
#!/bin/bash | |
browser_title="Google Chrome" | |
terminal_title="byobu" | |
current_window_id=$(xdotool getwindowfocus) | |
browser_window_id=$(xdotool search --name --onlyvisible "$browser_title") | |
terminal_window_id=$(xdotool search --name --onlyvisible "$terminal_title") | |
if test $current_window_id -eq $browser_window_id |
# ------------------------------------------------------------------------------ | |
# tlp - Parameters for power save | |
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html | |
# Hint: some features are disabled by default, remove the leading # to enable | |
# them. | |
# Set to 0 to disable, 1 to enable TLP. | |
TLP_ENABLE=1 |