Skip to content

Instantly share code, notes, and snippets.

View evgalak's full-sized avatar

Evgen Galakhov evgalak

View GitHub Profile
@evgalak
evgalak / aws-quicksight-embed-dashboard.php
Last active March 13, 2024 12:38
PHP code snippet to generate signed URL of the AWS QuickSight embed dashboard
<?php
// In addition to explanations from:
// https://stackoverflow.com/questions/53773313/how-to-get-generate-aws-quicksight-secure-dashboard-url/54052069#54052069
use Aws\Sts\StsClient;
use Aws\Credentials\Credentials;
use Aws\QuickSight\QuickSightClient;
use Aws\CognitoIdentity\CognitoIdentityClient;
use Aws\QuickSight\Exception\QuickSightException;
<?php
exec('mysqldump --user=dbuser --password=dbpass --host=127.0.0.1 dbuser > /root/mysql_backups/'.date("d-m-Y").'.sql');
$conn_id = ftp_connect("lepus.ip");
$login_result = ftp_login($conn_id, "storage", "password");
if (ftp_put($conn_id, date("d-m-Y").".sql", "/root/mysql_backups/".date("d-m-Y").".sql", FTP_ASCII))
{
// Put this file in Program Files\Adobe\Photoshop\Presets\Scripts\
// In PhotoShop menu File > Automate > Scripts: layersToSprite.js
// Arrange layers into a sprite sheet.
if (documents.length > 0)
{
// --------------------------
docRef = activeDocument;