$ cozy-stack instances client-oauth cozy.tools:8080 http://localhost/ test-event github.com/cozy/cozy-stack
cfb477f48683e0468549abab6501ef47
$ export CLIENT_ID=cfb477f48683e0468549abab6501ef47
$ cozy-stack instances token-oauth cozy.tools:8080 $CLIENT_ID "io.cozy.jobs io.cozy.triggers io.cozy.queues"
eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhY2Nlc3MiLCJpYXQiOjE0OTAzNDIwODYsImlzcyI6ImNvenkubG9jYWw6ODA4MCIsInN1YiI6ImNmYjQ3N2Y0ODY4M2UwNDY4NTQ5YWJhYjY1MDFlZjQ3Iiwic2NvcGUiOiJpby5jb3p5LmpvYnMgaW8uY296eS50cmlnZ2VycyBpby5jb3p5LnF1ZXVlcyJ9.dwAAxCmrOsOHI0b9GFM8txGzaHI5YxmyjanGd_Vxpz9B4p_TTc7Ft5KTCMSbPibgYc3pbl2H6JVAWWjpO6qdrw
$ export ACCESS_TOKEN=eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJhY2Nlc3MiLCJpYXQiOjE0OTAzNDIwODYsImlzcyI6ImNvenkubG9jYWw6ODA4MCIsInN1YiI6ImNmYjQ3N2Y0ODY4M2UwNDY4NTQ5YWJhYjY1MDFlZjQ3Iiwic2NvcGUiOiJpby5jb3p5LmpvYnMgaW8uY296eS50cmlnZ2VycyBpby5jb3p5LnF1ZXVlcyJ9.dwAAxCmrOsOHI0b9GFM8txGzaHI5YxmyjanGd_Vxpz9B4p_TTc7Ft5KTCMSbPibgYc3pbl2H6JVAWWjpO6
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
#!/usr/bin/env ruby | |
require "redis" | |
redis = Redis.new | |
redis.keys("*").each do |key| | |
val = case redis.type(key) | |
when "string" | |
redis.get key | |
when "list" |
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
{ | |
"took" : 3, | |
"timed_out" : false, | |
"_shards" : { | |
"total" : 1, | |
"successful" : 1, | |
"failed" : 0 | |
}, | |
"hits" : { | |
"total" : 2, |
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
#!/usr/bin/env ruby | |
require 'net/http/persistent' | |
require 'uri' | |
require 'thread' | |
USAGE = <<EOS | |
Parse a Rails log file and send metrics to stathat | |
export EMAIL=email |
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
#!/usr/bin/env ruby | |
require "openssl" | |
class BF < Struct.new(:key, :pad_with_spaces) | |
def encrypt(str) | |
cipher = OpenSSL::Cipher.new('bf-ecb').encrypt | |
if pad_with_spaces | |
str += " " until str.bytesize % 8 == 0 | |
cipher.padding = 0 |
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
~ ❯ curl 'http://localhost:5984/aaa/bbb?revs_info=true' | |
{"_id":"bbb","_rev":"4-753875d51501a6b1883a9d62b4d33f91","foo":4,"_revs_info":[{"rev":"4-753875d51501a6b1883a9d62b4d33f91","status":"available"},{"rev":"3-efc54218773c6acd910e2e97fea2a608","status":"available"},{"rev":"2-2ee767305024673cfb3f5af037cd2729","status":"available"},{"rev":"1-4a7e4ae49c4366eaed8edeaea8f784ad","status":"available"}]} | |
~ ❯ curl -X POST 'http://localhost:5984/aaa/_revs_diff' -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"bbb": ["1-4a7e4ae49c4366eaed8edeaea8f784ad", "2-2ee767305024673cfb3f5af037cd2729"]}' | |
{} | |
~ ❯ curl -X POST 'http://localhost:5984/aaa/_revs_diff' -H 'Accept: application/json' -H 'Content-Type: application/json' -d '{"bbb": ["1-4a7e4ae49c4366eaed8edeaea8f784ad", "3-efc54218773c6acd910e2e97fea2a608", "4-ccc", "5-ddd"]}' | |
{"bbb":{"missing":["4-ccc","5-ddd"],"possible_ancestors":["4-753875d51501a6b1883a9d62b4d33f91"]}} | |
~ ❯ curl -X POST 'http://localhost:5984/aaa/_revs_diff' -H 'Accept: |
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
#!/usr/bin/env ruby | |
# gem install faker rest-client | |
# ./fake-contacts.rb 100 | |
require 'faker' | |
require 'json' | |
require 'rest-client' | |
Faker::Config.locale = :fr |
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
/bug-rename-swift | |
/random | |
/vendor |
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
cozy@cozy-stack-v2:~$ ./cozy-stack instances add test.bruno.fr | |
INFO[0000] Instance created with success for domain test.bruno.fr | |
INFO[0000] Registration token: "37cddf40d7724988860fa0e03efd30fe" |
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
package main | |
import ( | |
"fmt" | |
proj "github.com/pebbe/go-proj-4/proj" | |
) | |
const ( | |
// Epsg = "+init=epsg:27572" | |
Epsg = "+proj=lcc +lat_1=46.8 +lat_0=46.8 +lon_0=2.33722917 +k_0=0.99987742 +x_0=600000 +y_0=2200000 +a=6378249.2 +pm=paris +units=m +no_defs no_defs <>" |
NewerOlder