rails mysql5.0 bug
1 2 SET PASSWORD FOR 3 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); 4 FLUSH PRIVILEGES
13403 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
1 2 SET PASSWORD FOR 3 'some_user'@'some_host' = OLD_PASSWORD('newpwd'); 4 FLUSH PRIVILEGES
1 2 require 'net/http' 3 res = Net::HTTP.get_response(URI.parse('http://www.example.com')) 4 print res.body
1 2 require 'openssl' 3 require 'digest/sha1' 4 c = OpenSSL::Cipher::Cipher.new("aes-256-cbc") 5 c.encrypt 6 # your pass is what is used to encrypt/decrypt 7 c.key = key = Digest::SHA1.hexdigest("yourpass") 8 c.iv = iv = c.random_iv 9 e = c.update("crypt this") 10 e << c.final 11 puts "encrypted: #{e}\n" 12 c = OpenSSL::Cipher::Cipher.new("aes-256-cbc") 13 c.decrypt 14 c.key = key 15 c.iv = iv 16 d = c.update(e) 17 d << c.final 18 puts "decrypted: #{d}\n"