Skip to content

Instantly share code, notes, and snippets.

@poppen
poppen / Rakefile
Last active August 29, 2015 14:01
Rakefile for Docker
builder_name = ''
image_name = ''
publish_port = ''
expose_port = ''
tag = "#{builder_name}/#{image_name}"
if ENV['version']
tag += ":#{ENV['version']}"
end
@poppen
poppen / yamaha-dns-cache-clear.rb
Created July 7, 2014 00:38
clear dns cache script for yamaha routers
# -*- encoding: utf-8 -*-
# vim: set filetype=ruby expandtab tabstop=4 shiftwidth=4 autoindent smartindent:
require 'net/telnet'
require 'yaml'
routers = YAML.load_file(ARGV[0])
routers.each do |router|
begin
class Person
def has_holiday_in?(year, month)
calendar = new Calendar(year, month)
calendar.has_holiday? ? true : false
end
end
class Person
def has_holiday_in?(calendar)
calendar.has_holiday? ? true : false
#!/bin/bash
IP_ADDR=$1
while true; do
sleep 1
result=`/sbin/ping -q -c 1 $IP_ADDR 2>&1`
if [ $? -eq 2 ]; then
echo $result
terminal-notifier -message "packet to ${IP_ADDR} is lost!"
@poppen
poppen / wassr2twitter.yaml
Created January 6, 2009 04:19
config yaml of plagger for wassr2twitter
plugins:
- module: CustomFeed::Simple
- module: Subscription::Config
config:
feed:
- url: http://api.wassr.jp/user_timeline.rss?id=YOUR_ID
- module: Filter::Rule
rule:
" proxy.js
javascript <<EOM
liberator.globalVariables.proxy_settings = [
{
conf_name: 'disable',
conf_usage: 'direct connection',
settings: [{label: 'type', param: 0}]
},
{
conf_name: 'polipo',
@poppen
poppen / 1.txt
Created February 11, 2009 14:03
"" autoproxychanger.js
javascript <<EOM
liberator.globalVariables.autochanger_proxy_enabled = true;
liberator.globalVariables.autochanger_proxy_settings = [
{
name: 'disable',
usage: 'direct connection',
proxy: { type : 0 }
},
{
@poppen
poppen / suspend-vm-default.patch
Created March 6, 2009 06:22
a patch for /etc/vmware-tools/suspend-vm-default to enable suspend on FreeBSD 7.x
--- suspend-vm-default.orig 2009-03-06 14:12:19.000000000 +0900
+++ suspend-vm-default 2009-03-06 14:14:01.000000000 +0900
@@ -20,7 +20,7 @@
# Release the IP if DHCP is used.
case "`uname -r`" in
-6.*) # 'PID dhclient: em0' => 'em0'
+[67].*) # 'PID dhclient: em0' => 'em0'
for intf in `pgrep -fl dhclient | cut -d" " -f3 | sort | uniq`; do
ifconfig "$intf" down
=== amazon_cross_book_check.user.js
==================================================================
--- amazon_cross_book_check.user.js (revision 440)
+++ amazon_cross_book_check.user.js (local)
@@ -34,7 +34,7 @@
},
{
label: 'eBOOKOFF',
- url: 'http://www.ebookoff.co.jp/cmdtysearch?Ctgry=1002&hdnSearchFlg=1&chkOld=1&txtISBNCode=',
+ url: 'http://www.ebookoff.co.jp/cmdtyallsearch/hdnAllSearchFlg/1/Ctgry/home/LRack/*/SetFlg/?Ctgry=home&LRack=*&chkAllSearchOldH=1&chkAllSearchStockH=1&hdnEndIndex=0&hdnFormId=cmdtyalllist&hdnPage=1&hdnStartIndex=0&selAscDesc=1&txtAllSearchBoxH=',
--- kojii_net.yaml.orig 2006-08-19 12:30:33.000000000 +0900
+++ kojii_net.yaml 2009-03-10 18:13:00.000000000 +0900
@@ -5,5 +5,5 @@
handle: http://www\.kojii\.net/\w+/\w+\d+\.html$
extract_xpath:
# title: /html/head//title
- body: /html/body//table
+ body: /html/body//table//table//td[1]
#extract_after_hook: $data->{title} =~ s|</?TITLE>||ig