Skip to content

Instantly share code, notes, and snippets.

View michaelgrifalconi's full-sized avatar

Michael Grifalconi michaelgrifalconi

View GitHub Profile

Paste text on VNC terminal that don't allow copy-paste

  • Prepare script on terminal
  • Copy data
  • Run script
  • Move focus to destination target
  • Script will 'type' for you
func newDropletUploadRequest(uri string, path string, uuid string) (*http.Request, error) {
file, err := os.Open(path)
if err != nil {
return nil, err
}
checksum, err := filesha256(file)
uri = uri + "/droplets/" + uuid + "/" + checksum
@michaelgrifalconi
michaelgrifalconi / query.sql
Created May 29, 2017 12:21
Remove a deployment from a bosh director DB
BEGIN;
DELETE FROM rendered_templates_archives as RT
WHERE RT.instance_id IN (
SELECT I.id FROM instances AS I INNER JOIN deployments AS D ON I.deployment_id = D.id
WHERE D.name = [$deploymentName]);
DELETE FROM records as R WHERE R.name IN (