Skip to content

Instantly share code, notes, and snippets.

View Alfakom-MK's full-sized avatar

Alphacom IT Solutions - Macedonia Alfakom-MK

View GitHub Profile
@Alfakom-MK
Alfakom-MK / blockip.txt
Created March 7, 2023 11:39
IP Block list
This file has been truncated, but you can view the full file.
1.0.1.21/32
1.0.78.0/32
1.0.218.19/32
1.0.218.230/32
1.0.242.26/32
1.1.109.151/32
1.1.109.250/32
1.1.136.123/32
1.1.187.152/32
1.2.131.181/32
@Alfakom-MK
Alfakom-MK / wordpress-export-csv-drupal.sql
Created October 10, 2022 07:47
Wordpress universal post export to CSV. Use it in other CMS import (Wordpress to Drupal example with CSV Importer module). You must copy/rsync the /wp-content/uploads images and documents folder to the new server previously.
SET SESSION group_concat_max_len = 5000; # Larger Group Concat, adjust if having larger galleries or body texts
SELECT "" AS 'nid' # Destination ID
, 'en' AS 'langcode' # Destination language
, wp1.`post_title` AS 'title' # Destination Title
, 'full_html' AS 'body|format' # Format HTML for the destination body
, CONCAT(IFNULL(nullif(LEFT(wp1.`post_content`,150),''),wp1.`post_title`),'...') AS 'body|summary' # First 150 chars from body as destination excerpt or using title if empty body
, CONCAT('<p style="padding-bottom:',GREATEST(ROUND(280-(POSITION('['IN `post_content`) + char_length(`post_content`))/2/56*20,0),0),'px">',IFNULL(nullif(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(wp1.`post_content`,'[','<'),']','>'),'\n','<br>'),'<div','<p'),'/div','/p'),'<table','<div class="table-responsive"><table class="table table-bordered table-hover table-striped"'),'</table>','</table></div>'),'UNHEX('C2A0'), '&nbsp;'),''),wp1.`post_title`),(SELECT CONCAT('<div class="a-ingal">\n<h3>GALLERY</h3>
@Alfakom-MK
Alfakom-MK / helo_access
Created December 28, 2021 07:10
Postfix HELO Access override, reject own and accept external friendly mail servers
# REJECT OWN MAIL SERVER FQDN AND IP ADDRESS
#/^mail\.domain\.com$/ REJECT
#/^\[?1\.2\.3\.4\]?$/ REJECT
# ACCEPT EXTERNAL MAIL SERVERS
#/^mail\.domain\.com$/ OK
@Alfakom-MK
Alfakom-MK / rbl_override
Last active October 10, 2022 07:50
Postfix RBL OverRide
# White list company
sub.domain.com OK
sub.domain.net OK
domain.net OK
@Alfakom-MK
Alfakom-MK / mk-subnets.txt
Last active January 11, 2021 15:04
Macedonian Subnets
5.32.176.0/21
31.3.88.0/21
31.7.168.0/21
31.11.64.0/18
31.12.16.0/20
31.210.11.152/30
37.25.80.0/21
37.26.96.0/21
38.19.1.28/30
38.28.1.36/32