See http://docs.ansible.com/intro_installation.html
$ ansible-playbook -K -k servers.yml
See https://github.com/mislav/git-deploy
$ git push production master
See http://docs.ansible.com/intro_installation.html
$ ansible-playbook -K -k servers.yml
See https://github.com/mislav/git-deploy
$ git push production master
| # A Mechanize based Sidekiq Worker that reports on new bid announcements in Norway | |
| # | |
| # This is used in a Rails app with a Bid model for storing known bids, | |
| # and a BidMailer to send bid announcements to an email. | |
| # | |
| class BidWorker | |
| include Sidekiq::Worker | |
| sidekiq_options unique: true | |
| def perform |
| def mama | |
| csv = open("lookahere") | |
| qtys=[] | |
| fail=[] | |
| csv.each_line do |l| | |
| # Replace comma with period for float value | |
| ln = l.gsub(/((?<=,"\d)(,)(?=\d",))/,".") | |
| # Split line on comma | |
| dt = ln.split(",") | |
| b = Biditem.find_by_tu_no(dt[0]) |
| privkey = OpenSSL::PKey::RSA.new(2048) | |
| pubkey = privkey.public_key | |
| # Return BrowserID Identity JSON | |
| def to_json | |
| { | |
| "public-key" => { "algorithm"=> "RS", "n" => public_key.n.to_s, "e" => public_key.e.to_s }, | |
| "authentication" => "/sign_in", | |
| "provisioning" => "/provision" | |
| }.to_json |
| { | |
| "pubkey" : | |
| { | |
| "algorithm":"DS", | |
| "y":"62b0ea6936a7ab30c95d8ffbbc77438a342faed99b6fc643a58f28d9ed2017177354f9f1d1d7e6b9e1c543780c3517953a124e66bc409fcaaa671d87a39cf897b32f47aaaffb7a3d297b89f9e116870a2182e2b2f84d68a7bc21a3f7934727e45e50a083e71a965d0cc320062598e407463f0c31cc2c20ed74d9bda98b21c902", | |
| "p":"ff600483db6abfc5b45eab78594b3533d550d9f1bf2a992a7a8daa6dc34f8045ad4e6e0c429d334eeeaaefd7e23d4810be00e4cc1492cba325ba81ff2d5a5b305a8d17eb3bf4a06a349d392e00d329744a5179380344e82a18c47933438f891e22aeef812d69c8f75e326cb70ea000c3f776dfdbd604638c2ef717fc26d02e17", | |
| "q":"e21e04f911d1ed7991008ecaab3bf775984309c3", | |
| "g":"c52a4a0ff3b7e61fdf1867ce84138369a6154f4afa92966e3c827e25cfa6cf508b90e5de419e1337e07a2e9e2a3cd5dea704d175f8ebf6af397d69e110b96afb17c7a03259329e4829b0d03bbc7896b15b4ade53e130858cc34d96269aa89041f409136c7242a38895c9d5bccad4f389af1d7a4bd1398bd072dffa896233397a" | |
| }, |
| # @private_key is an OpenSSL private key | |
| # params is Rack request params, or Rails params | |
| expiration = (Time.now.strftime("%s").to_i + params["duration"].to_i) * 1000 | |
| issue = { "iss" => "example.org", | |
| "exp" => expiration, | |
| "public-key" => params["pubkey"], | |
| "principal" => { "email"=> "mormor@example.org" } | |
| } | |
| jwt = JSON::JWT.new(issue) |
| { | |
| "log": { | |
| "version": "1.2", | |
| "creator": { | |
| "name": "WebInspector", | |
| "version": "536.11" | |
| }, | |
| "pages": [], | |
| "entries": [ | |
| { |
| $ sudo gluster volume info | |
| Volume Name: data | |
| Type: Replicate | |
| Volume ID: 7ac35911-b9c2-4f20-a226-65a6173dafb3 | |
| Status: Started | |
| Number of Bricks: 1 x 2 = 2 | |
| Transport-type: tcp | |
| Bricks: | |
| Brick1: gluster1:/data |
| # Then this in Exchange Management Shell | |
| $Location = "\\server\pstexport" | |
| New-Item -path $Location -name "migrate.txt" -type File -force | |
| Add-Content "$Location\migrate.txt" "datasourceuser,destinationuser" | |
| # Create a hash table of Exchange mailboxes | |
| $mailboxes = @{} | |
| Get-Mailbox | Select-Object name, alias | | |
| ForEach-Object { $mailboxes.Add($_.name, $_.alias) } |
| $timeout = 300 | |
| $message = "Please save your work. You will be logged off in "+ $timeout/60 +" minutes" | |
| $sessions = @() | |
| # Collect session IDs and warn users | |
| query session | select-string "wdica" | | |
| %{$_ -replace " {2,27}"," "} | | |
| foreach {$_.ToString().split(" ")[3]} | | |
| foreach { | |
| $sessions += $_ |