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
<?php | |
curl_setopt_array($curl, array( | |
CURLOPT_URL => "API_ENDPOINT", | |
CURLOPT_RETURNTRANSFER => true, | |
CURLOPT_ENCODING => "", | |
CURLOPT_MAXREDIRS => 10, | |
CURLOPT_TIMEOUT => 0, | |
CURLOPT_FOLLOWLOCATION => true, | |
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, |
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 ( | |
"io" | |
"log" | |
"net" | |
"bytes" | |
"bufio" | |
"strings" | |
"time" |
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
<?php | |
// Function that checks whether the data are the on-screen text. | |
// It works in the following way: | |
// an array arrfailAt stores the control words for the current state of the stack, which show that | |
// input data are something else than plain text. | |
// For example, there may be a description of font or color palette etc. | |
function rtf_isPlainText($s) { | |
$arrfailAt = array("*", "fonttbl", "colortbl", "datastore", "themedata"); | |
for ($i = 0; $i < count($arrfailAt); $i++) |
NewerOlder