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
# Copyright 2019 Google LLC. | |
# SPDX-License-Identifier: Apache-2.0 | |
# This snippet shows you how to use Blob.generate_signed_url() from within compute engine / cloud functions | |
# as described here: https://cloud.google.com/functions/docs/writing/http#uploading_files_via_cloud_storage | |
# (without needing access to a private key) | |
# Note: as described in that page, you need to run your function with a service account | |
# with the permission roles/iam.serviceAccountTokenCreator | |
import os, google.auth | |
from google.auth.transport import requests |
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
const GLib = imports.gi.GLib; | |
const Gio = imports.gi.Gio; | |
let [res, out, err, status] = GLib.spawn_command_line_sync('ls -la'); | |
print(out); | |
let [res, out] = GLib.spawn_command_line_sync('ls -la'); | |
print(out); | |
let [res, out] = GLib.spawn_sync(null, ['/bin/ls', '-la'], null, 0, null); |