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
#!/bin/bash | |
# Set your AWS region and S3 bucket name | |
REGION=eu-central-1 | |
BUCKET=bucket-name | |
# List all objects in the bucket and change the storage class to Standard | |
aws s3api list-objects --region "$REGION" --bucket "$BUCKET" --query "Contents[?StorageClass=='GLACIER'].[Key]" --output text | while read -r line; do | |
# Skip directories | |
if [[ "$line" == */ ]]; then |
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
#SELinux is blocking the read/write operations | |
chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/ (if you want to allow full web root) | |
chcon -Rv --type=httpd_sys_rw_content_t /var/www/html/uploads/ (Or just uploads folder) |
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
package main | |
import ( | |
"compress/gzip" | |
"context" | |
"crypto/sha256" | |
"encoding/hex" | |
"fmt" | |
"github.com/aws/aws-sdk-go-v2/aws" | |
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"time" | |
) | |
var globalResult []int |
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
type field struct { | |
Key string `json:"key"` | |
Value string `json:"value"` | |
} | |
func Post(url string, fields []field) error { | |
var b bytes.Buffer | |
w := multipart.NewWriter(&b) |
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
package main | |
import ( | |
"crypto/tls" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strings" | |
) |
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
// main.go | |
package main | |
import ( | |
"context" | |
"fmt" | |
"github.com/aws/aws-sdk-go-v2/aws" | |
v4 "github.com/aws/aws-sdk-go-v2/aws/signer/v4" | |
"github.com/aws/aws-sdk-go-v2/config" | |
"github.com/aws/aws-sdk-go-v2/credentials" |
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
DELIMITER $$ | |
CREATE TRIGGER on_items_update | |
AFTER INSERT | |
ON order_items FOR EACH ROW | |
BEGIN | |
UPDATE orders SET total_photos=total_photos+1 WHERE id=new.order_id; | |
END$$ | |
DELIMITER ; |
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
postData('notes/update_note_date', { | |
id: element.parentElement.getAttribute("data-id"), | |
lead_id: element.parentElement.getAttribute('data-lead'), | |
note_type: element.parentElement.getAttribute('data-type'), | |
field: element.parentElement.getAttribute('data-field'), | |
value: element.value | |
}).then(data => { | |
console.log(data); // JSON data parsed by `data.json()` call | |
}); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Sandbox</title> | |
<meta charset="UTF-8" /> | |
</head> | |
<body> | |
<div class="editable date" data-id="6">2021-09-23</div> | |
<div class="editable date" data-id="1">2011-08-11</div> |
NewerOlder