Skip to content

Instantly share code, notes, and snippets.

@ryu1kn
ryu1kn / README.md
Last active June 25, 2024 10:50
Getting GCP access token from a service account key JSON file

Getting GCP access token from a service account key

Use your service account's key JSON file to get an access token to call Google APIs.

Good for seeing how things work, including the creation of JWT token.

To create a JWT token, you can replace create-jwt-token.sh script with tools like step.

If you just want to get an access token for a service account,

\ParameterConfigRepository::shouldReceive('findOneByParameterCodeAndPartner')
->once()
->andReturnUsing(function ($code) {
$params = [
'ftp' => '127.0.0.1',
'user' => 'fernandinho',
'password' => '1234'
];
return $params[$code];
@pierophp
pierophp / get_pid_by_port.sh
Last active December 11, 2017 15:14
Pegando pid pela porta do MySQL
ps aux | grep $(sudo lsof -i tcp -nP | grep "15245 (" | head -n 1 | awk '{print $2}')
@lichti
lichti / parallel_import.rb
Created November 3, 2015 16:44
MySQL LOAD DATA parallel import
require 'thread'
require 'fileutils'
procs=8
host=""
user=""
pass=""
db=""
path=""
@danburzo
danburzo / README.md
Last active July 29, 2021 08:41
Get all event listeners on the page in Google Chrome