This file contains hidden or 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 | |
exit false unless %{ondemand powersave performance}.index(ARGV[0]) | |
(0..3).each do |i| | |
system "sudo su -c 'echo #{ARGV[0]} > /sys/devices/system/cpu/cpu#{i}/cpufreq/scaling_governor'" | |
end | |
puts "set #{ARGV[0]}" |
This file contains hidden or 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 | |
def sudo str | |
system "sudo sh -c \"#{str}\"" | |
end | |
# USB の自動サスペンド | |
sudo "echo 1 > /sys/bus/usb/devices/usb1/power/autosuspend" | |
sudo "echo 1 > /sys/bus/usb/devices/usb2/power/autosuspend" | |
sudo "echo 1 > /sys/bus/usb/devices/usb3/power/autosuspend" | |
# WiFi の省電力設定 |
This file contains hidden or 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
set-option -g default-terminal screen-256color | |
set-option -g prefix C-f | |
set-option -g history-limit 10000 | |
set-window-option -g mode-key vi | |
set-option -g status-left "x-f" | |
set-option -g status-right "#(date +'%Y/%m/%d %H:%M:%S')" | |
set-option -g status-interval 1 | |
set-window-option -g utf8 on |
This file contains hidden or 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
require 'aws/s3' | |
AWS_ID = 'ネームスペース' | |
AWS_KEY = 'コンソールでみられる KEY' | |
s3 = AWS::S3.new(access_key_id: AWS_ID, secret_access_key: AWS_KEY, s3_endpoint: "b.storage.sakura.ad.jp", use_ssl: false) | |
ARGV.each{|a| | |
obj = s3.buckets[AWS_ID].objects[a] | |
obj.write(file: a) | |
puts obj.public_url.to_s |
This file contains hidden or 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 'fileutils' | |
require 'digest/md5' | |
require 'tmpdir' | |
pwd = Dir.pwd | |
ARGV.dup.select{|x| x =~ /.azw3$/}.each{|book| | |
puts "Convert #{book}" | |
temp = Dir.mktmpdir |
This file contains hidden or 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
require 'celluloid/io' | |
require 'ircp' | |
require 'thread' | |
require 'sinatra/base' | |
require 'json' | |
$q = Queue.new | |
class Client | |
include Celluloid::IO |
This file contains hidden or 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
// ==UserScript== | |
// @name crossbike navi with AdBlock | |
// @namespace http://ssig33.com | |
// @version 0.1 | |
// @description test browser : chrome | |
// @include http://crossbike-navi.com/* | |
// @copyright ssig33 | |
// ==/UserScript== | |
var f = function(){ | |
setTimeout(function(){ |
This file contains hidden or 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
// ==UserScript== | |
// @name rate1 only on kakaku.com's review | |
// @include http://review.kakaku.com/review/* | |
// @description 価格.comのレビューで満足度が 1 のものだけ表示 | |
// ==/UserScript== | |
jQuery(function(){ | |
jQuery.each(['2','3','4','5'], function(k,v){ | |
jQuery.each(jQuery('#mainLeft div div div div div div div div table.total tr td.rate'+v), | |
function(k,v){ | |
jQuery(v).parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().parent().hide(); |
This file contains hidden or 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
// ==UserScript== | |
// @name TOUAHANTEN | |
// @namespace gyuque | |
// @include http://gigazine.net/* | |
// @version 1 | |
// ==/UserScript== | |
location.href = "http://xvideos.jp" |
This file contains hidden or 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
require 'user-stream-receiver' | |
require 'json' | |
require 'rest_client' | |
HOST = '' | |
API_KEY = '' | |
UserStreamReceiver.new.run{|chunk| | |
begin | |
chunk = JSON.parse(chunk) |