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 | |
# Copyright 2023 Takuma Nakajima | |
# This software is released under the MIT license. | |
# https://opensource.org/license/mit/ | |
# This shell script finds the maximum MTU size to the destination IP address by binary search. | |
# | |
# Example: | |
# $ ./find_max_mtu.sh 1.1.1.1 |
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'highline' | |
def ac_status | |
print "AC: " | |
if open("/sys/class/power_supply/AC/online", 'r').read.to_i == 1 | |
puts "Online" | |
else |
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 | |
if [ "x$1" = "x" -o "x$2" = "x" ]; then | |
echo Usage: `basename "$0"` "<input.pdf>" "<output.pdf>" >&2 | |
exit 1 | |
fi | |
# change 'ps2write' to 'pswrite' if errors | |
gs -sDEVICE=ps2write -dNOCACHE -sOutputFile=- -q -dbatch \ | |
-dNOPAUSE -dQUIET "$1" -c quit | ps2pdf - "$2" |
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
# coding: utf-8 | |
Plugin.create :masquerade_curry_ukiuki do | |
Thread.new { | |
loop do | |
Plugin.call(:update, nil, [Message.new(:message => "マスカレード・カレー・ウキウキ", :system => true)]) | |
sleep 120 | |
end | |
} | |
end |
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
#!/usr/bin/env ruby | |
#-*- coding: utf-8 -*- | |
require 'net/http' | |
require 'uri' | |
require 'json' | |
require 'pp' | |
require 'optparse' | |
PRINT_CREDENTIALS = false |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
require 'clipboard' | |
require 'cgi' | |
require 'sqlite3' | |
dbname = File.join(ENV['HOME'], '.toast-alc.db') | |
table_name = 'query_result' |
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
#-*- coding: utf-8 -*- | |
Plugin.create :disable_rayban_spam do | |
filter_show_filter do |messages| | |
messages.reject! do |message| | |
message.to_s =~ /^@|^RT/ and | |
message.to_s.include? "レイバンのサングラス" and | |
message.to_s =~ /\d+円/ | |
end | |
[messages] |
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
#-*- coding: utf-8 -*- | |
Plugin.create :auto_favorite_sushi514_shio do | |
@target_username = "sushi514" | |
@regexp = /しお|塩|sh?io|salt/ | |
on_appear do |messages| | |
messages.each do |m| | |
next unless m.user.to_s == @target_username |
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 | |
# | |
# ssh (concatenating split config file) | |
# | |
# Copyright (c) 2014 Takuma Nakajima | |
# | |
# This software is released under the MIT License. | |
# http://opensource.org/licenses/mit-license.php | |
# |
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
# -*- coding: utf-8 -*- | |
Plugin.create :auto_retweet_previous_tweet do | |
tweet_before = {} | |
on_appear do |ms| | |
ms.each do |m| | |
if tweet_before[m.user] | |
tweet_before[m.user].retweet if m.to_s == "いまのなし" |
NewerOlder