This file contains hidden or 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 | |
# Configuration | |
WEBSITE_PATH="/var/www/jeitaly.org" | |
BACKUP_DIR="$HOME/backup" | |
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") | |
BACKUP_FOLDER="$BACKUP_DIR/$TIMESTAMP" | |
DB_DUMP_FILE="jeitaly_db_$TIMESTAMP.sql" | |
WEBSITE_ARCHIVE="jeitaly_website_$TIMESTAMP.tar.gz" |
This file contains hidden or 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
version: "4.0" | |
services: | |
# MySQL Database | |
database: | |
image: mysql:latest | |
volumes: | |
- database_data:/var/lib/mysql | |
restart: always | |
environment: |
This file contains hidden or 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
CREATE DATABASE wordpress; | |
CREATE USER wordpress@localhost IDENTIFIED BY '<your-password>'; | |
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER ON wordpress.* TO wordpress@localhost; | |
FLUSH PRIVILEGES; | |
quit |
This file contains hidden or 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
# Create VM istance and log into it | |
multipass launch --name jetop-wordpress | |
multipass shell jetop-wordpress | |
# Update packages | |
sudo apt update && sudo apt upgrade -y | |
# Install nginx and net-tools | |
sudo apt install nginx net-tools |
This file contains hidden or 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
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:geoflutterfire2/geoflutterfire2.dart'; | |
class LocationHelper { | |
static Map<String, dynamic> geoFirePointToJson(final GeoFirePoint? geoFirePoint) { | |
return geoFirePoint?.data; | |
} | |
static GeoFirePoint? geoFirePointFromJson(final Map<String, dynamic>? json) { | |
if (json == null) { |
This file contains hidden or 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
from os import walk | |
from os.path import exists | |
directories: list = walk(".") | |
key_properties_files: dict = {} | |
for directory in directories: | |
# Check if it is a flutter project | |
if "pubspec.yaml" in directory[2]: | |
# Check if key.properties exists |
This file contains hidden or 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 | |
rm -rf wp-includes | |
rm -rf wp-admin | |
wp core download --skip-content --force --allow-root | |
wp plugin install $(wp plugin list --field=name --allow-root) --force --allow-root | |
wp theme install $(wp theme list --field=name --allow-root) --force --allow-root | |
find wp-content/uploads -name "*.php" -delete |
This file contains hidden or 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
# Server per il debug di Climax | |
LoadModule php_module /usr/local/lib/httpd/modules/libphp.so | |
<VirtualHost *:8080> | |
# TODO: Sostituire con il percorso alla cartella del progetto nel proprio computer | |
DocumentRoot /Users/emiliodallatorre/Documents/GitHub/climax-webapp-php | |
ErrorLog /Users/emiliodallatorre/Documents/GitHub/climax-webapp-php/error.log | |
CustomLog /Users/emiliodallatorre/Documents/GitHub/climax-webapp-php/access.log combined | |
Options Indexes FollowSymLinks Multiviews Indexes |
This file contains hidden or 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
// https://stackoverflow.com/questions/46483949/how-to-get-current-route-path-in-flutter | |
String? currentPath; | |
navigatorKey.currentState?.popUntil((Route<dynamic> route) { | |
currentPath = route.settings.name; | |
return true; | |
}); |
This file contains hidden or 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
# server { | |
# listen 80; | |
# server_name yourhostname.it www.yourhostname.it; | |
# return 301 https://yourhostname.it$request_uri; | |
# } | |
server { | |
# listen 443 ssl; # managed by Certbot | |
# ssl_certificate /etc/letsencrypt/live/yourhostname.it/fullchain.pem; # managed by Certbot | |
# ssl_certificate_key /etc/letsencrypt/live/yourhostname.it/privkey.pem; # managed by Certbot |
NewerOlder