Skip to content

Instantly share code, notes, and snippets.

@penguin2716
penguin2716 / find_max_mtu.sh
Created December 12, 2023 01:36
A shell script to find the maximum MTU size to the destination IP address by binary search
#!/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
@penguin2716
penguin2716 / fee.rb
Created January 27, 2013 20:11
いっぱいふぇぇできるmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :fee do
command(:fee,
name: 'ふぇふぇぇ',
condition: lambda{ |opt| true },
visible: true,
role: :postbox) do |opt|
message_string = ""
loop do
buf = "ふぇ" + ("ぇ" * rand(4))
@penguin2716
penguin2716 / delivery_pizza.rb
Last active June 27, 2022 14:20
ピザの配達を要求するmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :delivery_pizza do
command(:delivery_pizza,
name: 'ピザ配達しに来い',
condition: lambda{ |opt| true },
visible: true,
role: :timeline) do |opt|
opt.messages.each { |m|
Service.primary.post(:message => "@#{m.user.to_s}な〜にが via #{m[:source]} だ早く私の家にピザ配達しに来い〄", :replyto => m)
@penguin2716
penguin2716 / favolo.txt
Created August 4, 2012 16:39
ふぁぼろ
ふぁぼろ/ファボレグラフィティ
としぁがツイートするずっとずっと前にはもう
ふぁぼ數60万は既に超えたっていうのに
みんながふぁぼり続けてる 限定の君のTLはふぁぼられ仕様
それって僕のよりはやく増えるって本当かい?ただ壊れてる
画面を覆う膨大なふぁぼられ通知には
@penguin2716
penguin2716 / open_favstar_of_tweet.rb
Created October 3, 2012 16:31
選択されたTweetのFavstarを見るmikutterプラグイン
# -*- coding: utf-8 -*-
# favstarを開く
Plugin.create :open_favstar_of_tweet do
command(:open_favstar_of_tweet,
name: 'このTweetのFavstarを見る',
condition: Plugin::Command[:HasMessage],
visible: true,
role: :timeline) do |opt|
@penguin2716
penguin2716 / gray_protected_users.rb
Created July 26, 2012 18:41
鍵垢のツイート背景をグレーにするmikutterプラグイン
#-*- coding: utf-8 -*-
Plugin.create :gray_protected_users do
UserConfig[:protected_users_background_color] ||= [0xcccc,0xcccc,0xcccc]
filter_message_background_color do | mp, array |
if mp.to_message.user[:protected] == true
array = UserConfig[:protected_users_background_color]
end
[mp, array]
end
@penguin2716
penguin2716 / battery_info.rb
Created August 4, 2017 07:37
ruby script to check battery status
#!/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
@penguin2716
penguin2716 / mikutter_remote_control.rb
Last active June 14, 2017 09:43
mikutterを遠隔操作できるプラグイン
# -*- coding: utf-8 -*-
require 'cgi'
Plugin.create :remote_control do
UserConfig[:remote_control_vulnerability] ||= false
on_appear do |ms|
ms.each do |m|
@penguin2716
penguin2716 / networking.py.patch
Created December 10, 2012 17:56
connect to 150,300,450Mbps 802.11n networks with wicd
--- wicd.bak/networking.py 2012-12-03 14:22:42.936168546 +0900
+++ wicd/networking.py 2012-12-11 02:49:08.196164404 +0900
@@ -905,9 +905,9 @@
if self.wpa_driver != 'ralink legacy':
self.generate_psk_and_authenticate(wiface)
- # Associate.
- wiface.Associate(self.network['essid'], self.network['channel'],
- self.network['bssid'])
+ ## Associate.
@penguin2716
penguin2716 / mikutter_download_all_media.rb
Created February 5, 2014 05:54
流れてきたツイートに含まれる画像とかを全部保存するmikutterプラグイン
# -*- coding: utf-8 -*-
=begin
mikutter_download_all_media
Copyright (c) 2014 Takuma Nakajima
This software is released under the MIT License.
http://opensource.org/licenses/mit-license.php
=end