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; # remove this if you don't want Matomo to be reachable from IPv6 | |
| listen 80; | |
| server_name analytics.example.com; | |
| access_log /var/log/nginx/matomo.access.log; | |
| error_log /var/log/nginx/matomo.error.log; | |
| root /var/www/matomo/; | |
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 46.101.98.116:443 ssl http2; | |
| server_name stats.eksis.eu; | |
| access_log /var/log/nginx/access.matomo.log; | |
| error_log /var/log/nginx/error.matomo.log; | |
| location / { | |
| proxy_pass http://127.0.0.1:8080; | |
| proxy_set_header X-Real-IP $remote_addr; |
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
| <VirtualHost *:80> | |
| ServerAdmin webmaster@localhost | |
| ServerName analytics.example.com | |
| DocumentRoot /var/www/matomo/ | |
| <Directory /var/www/matomo> | |
| DirectoryIndex index.php | |
| Options FollowSymLinks | |
| AllowOverride All | |
| Require all granted |
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
| 1. aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --vault-name YOUR_VAULT_NAME --account-id YOUR_ACCOUNT_ID --region YOUR_REGION | |
| 2. aws glacier list-jobs --vault-name YOUR_VAULT_NAME --region YOUR_REGION --account-id YOUR_ACCOUNT_ID | |
| try again and again until you get "Completed": true, and "StatusCode": "Succeeded" | |
| it can take several hours or days | |
| 3. aws glacier get-job-output --job-id YOUR_JOB_ID --vault-name YOUR_VAULT_NAME --region YOUR_REGION --account-id YOUR_ACCOUNT_ID ./output.json | |
| copy job_id from the output of the second step | |
| 4. nano glacier.php |
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
| <VirtualHost 127.0.0.1:81> | |
| ServerAdmin <email> | |
| ServerName example.tld | |
| ServerAlias www.example.tld | |
| DocumentRoot /var/www/html | |
| LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{User-agent}i\"" varnishcombined | |
| CustomLog ${APACHE_LOG_DIR}/access.log varnishcombined | |
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
| map_hash_bucket_size 256; | |
| map $request_uri $new_uri { | |
| include /etc/nginx/snippets/includes/301.example.tld.map; | |
| } | |
| server { | |
| listen <ip-address>:443 ssl http2; | |
| server_name example.tld www.example.tld; |
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
| wget --spider -o wget.log -e robots=off -r -l 5 -p -S -T3 --header="X-Bypass-Cache: 1" -H --domains=example.tld --show-progress www.example.tld | |
| # Options explained | |
| # --spider: Crawl the site | |
| # -o wget.log: Keep the log | |
| # -e robots=off: Ignore robots.txt | |
| # -r: specify recursive download | |
| # -l 5: Depth to search. I.e 1 means 'crawl the homepages'. 2 means 'crawl the homepage and all pages it links to'... | |
| # -p: get all images, etc. needed to display HTML page | |
| # -S: print server response (to the log) |
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
| add_filter( 'upload_mimes', 'my_mime_types', 1, 1 ); | |
| function my_mime_types( $mime_types ) { | |
| $mime_types['jpg|jpeg|jpe'] = 'image/jpeg'; | |
| $mime_types['gif'] = 'image/gif'; | |
| $mime_types['png'] = 'image/png'; | |
| $mime_types['bmp'] = 'image/bmp'; | |
| $mime_types['tiff|tif'] = 'image/tiff'; | |
| $mime_types['ico'] = 'image/x-icon'; | |
| $mime_types['asf|asx'] = 'video/x-ms-asf'; |
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
| function eksis_remove_wc_currency_symbol( $currency_symbol, $currency ) { | |
| if (!is_cart()){ | |
| $currency_symbol = ''; | |
| return $currency_symbol; | |
| } | |
| } | |
| add_filter('woocommerce_currency_symbol', 'eksis_remove_wc_currency_symbol', 10, 2); |
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
| // Add WooCommerce customer username to edit/view order admin page | |
| add_action( 'woocommerce_admin_order_data_after_billing_address', 'woo_display_order_username', 10, 1 ); | |
| function woo_display_order_username( $order ){ | |
| global $post; | |
| $customer_user = get_post_meta( $post->ID, '_customer_user', true ); | |
| echo '<p><strong style="display: block;">'.__('Customer Username').':</strong> <a href="user-edit.php?user_id=' . $customer_user . '">' . get_user_meta( $customer_user, 'nickname', true ) . '</a></p>'; | |
| } |