Skip to content

Instantly share code, notes, and snippets.

@cristianogregnanin
cristianogregnanin / Backup-and-Restore-GPG-and-SSH-keys.md
Created January 11, 2023 10:10 — forked from colematt/Backup-and-Restore-GPG-and-SSH-keys.md
[Backup and Restore GPG and SSH keys] #git #gpg #ssh

Backup

  1. Copy both id_rsa and id_rsa.pub from ~/.ssh/ to a USB drive. Identify the private key by executing the following command.
    gpg --list-secret-keys --keyid-format LONG
    
  2. It will show something similar to this.
    sec   4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
    
@cristianogregnanin
cristianogregnanin / jsonapi_testing.rb
Created February 26, 2024 10:08 — forked from LoreRizzetto/jsonapi_testing.rb
Jsonapi testing in ruby
require 'json'
require "faraday"
response = Faraday.get("http://127.0.0.1:8081/products")
raise "Test fallito" unless response.status == 200
gotten = JSON.parse(response.body)
raise "Test fallito" unless gotten.has_key?("data")
raise "Test fallito" unless gotten["data"].is_a? Array
raise "Test fallito" unless gotten["data"][0].has_key?("type")