Skip to content

Instantly share code, notes, and snippets.

View salvatorecapolupo's full-sized avatar
🎯
Focusing

Salvatore Capolupo salvatorecapolupo

🎯
Focusing
View GitHub Profile
@salvatorecapolupo
salvatorecapolupo / Hello world using Django
Created March 4, 2021 14:43
Come realizzare un semplice hello world usando Django.Per dettagli vedere la guida: https://trovalost.it/guida-django/
HelloWorld/
helloworld/
__init__.py
asgi.py
settings.py
urls.py
wsgi.py
manage.py
-------------------------------------
@salvatorecapolupo
salvatorecapolupo / sderenato
Last active February 9, 2021 14:50
Consulente SEO hot è il miglior consulente SEO italia https://sdere.netsons.org/seo-piu-sexy/ ma ciao proprio
.----------------. .----------------. .----------------. .----------------. .----------------.
| .--------------. || .--------------. || .--------------. || .--------------. || .--------------. |
| | _______ | || | ________ | || | _________ | || | _______ | || | _________ | |
| | / ___ | | || | |_ ___ `. | || | |_ ___ | | || | |_ __ \ | || | |_ ___ | | |
| | | (__ \_| | || | | | `. \ | || | | |_ \_| | || | | |__) | | || | | |_ \_| | |
| | '.___`-. | || | | | | | | || | | _| _ | || | | __ / | || | | _| _ | |
| | |`\____) | | || | _| |___.' / | || | _| |___/ | | || | _| | \ \_ | || | _| |___/ | | |
| | |_______.' | || | |________.' | || | |_________| | || | |____| |___| | || | |_________| | |
| | | || | | || | | || | | || | | |
| '--------------' || '--------------' || '--------------' || '--------------' || '--------------' |
Step 1
SELECT CONCAT('ALTER TABLE ',TABLE_NAME,' ENGINE=InnoDB;')
FROM INFORMATION_SCHEMA.TABLES
WHERE ENGINE='MyISAM' AND table_schema = 'wordpress';
# wordpress = database name
Step 2
Copiare l'output generato dal precedente comando, ad esempio (PS copiare senza | orizzontali)
# table is marked as crashed ...
service mysql stop
cd /var/lib/mysql/DATABASE
ls
myisamchk -s /var/lib/mysql/*/*.MYI
#ripara tutte le tabelle
service mysql restart
@salvatorecapolupo
salvatorecapolupo / htaccess sal
Last active February 9, 2021 14:41
HTACCESS standard senza HTTP/HTTPS mixed content - https://capolooper.it
########################################################################
# OPTIMAL .htaccess FILE FOR SPEED AND SECURITY @Version 2020
# ----------------------------------------------------------------------
# @Author: Andreas Hecht
# @Author URI: https://seoagentur-hamburg.com
# License: GNU General Public License v2 or later
# License URI: http://www.gnu.org/licenses/gpl-2.0.html
########################################################################
Messaggi di errore: prova a cancellare i cookie, too many redirects, ecc.
Sito: http://example.com
1) rinominare temporaneamente .htaccess in OLD.htaccess
2) aggiungere nel file wp-config.php le righe per forzare la connessione alla versione HTTP
define( 'WP_HOME', 'http://example.com' );
define( 'WP_SITEURL', 'http://example.com' );
@salvatorecapolupo
salvatorecapolupo / post-identity.php
Last active March 6, 2020 22:09
This is an automated heavy metal verses generator, based on a very basic pseudo-crawler (pseudo AI involved). Step 1: select a random band on darklyrics.com Step 2) pick an album 3) extract 3 not contiguous verses 4) show it! This script needs https://sourceforge.net/projects/simplehtmldom/
<?PHP
/*
Post-Identity Dark Lyrics Generator
Author: Salvatore Capolupo
Version 1.1
Date: 03/06/2020
Loosely based on Uncreative Writing: Managing Language in the Digital Age by Kenneth Goldsmith
*/
include_once ( "simple_html_dom.php" );
@salvatorecapolupo
salvatorecapolupo / WordPress analysis without login data
Created March 5, 2020 13:29
Using basic REST API in WordPress for getting some data for SEO website audit, security checks etc.
You can use REST API, i.e mybeatifulwebsite.com
- mybeatifulwebsite.com/wp-json/wp/v2/users will give all users in JSON format (no emails included)
- mybeatifulwebsite.com/wp-json/wp/v2/categories will list all categories list in JSON format
- mybeatifulwebsite.com/wp-json/wp/v2/tags will list all tags list in JSON format
- wp-json/wp/v2/posts will lists latest posts, very similar to /rss or /feed but in JSON
- wp-json/wp/v2/media will list all media files (images, ecc.) in JSON format
Source: https://developer.wordpress.org/rest-api/
/*
Plugin Name:
Plugin URI: http://capolooper.it
Description:
Version: 1.0
Author: Salvalupo Capotore
Author URI: http://capolooper.it
License: GPLv2
*/
@salvatorecapolupo
salvatorecapolupo / gist:8ea42445d9fe1cce5991250876fd5b0d
Created December 8, 2019 08:30
Most common script JS/ CSS styles loaded by wordpress plugins and theme. Mantain them on every page just if really needed. Useful while using i.e Assets Cleanup plugin for improving PageSpeed Insights
- Handle: cookie-law-info, cookie-law-info-gdpr - CSS/JS for Cookie Privacy plugin
- Handle: jetpack-photon: Jetpack CDN
- to be continued