Uncategorized

Asterisk: Fail2ban & IP Tables

Posted on

https://www.voip-info.org/fail2ban-with-iptables-and-asterisk/ /etc/init.d/fail2ban restart /etc/init.d/fail2ban reload /etc/init.d/iptables-persistent restart When you reload or restart fail2ban all the bans are removed.    One problem with this wonderful solution (which is related to iptables, not fail2ban), is that when you reboot your server all the rules and blocked IPs are deleted. On my case I want all this IPs […]

Uncategorized

Prestashop: Remove Manufacturer List Scroll

Posted on

theme folder -> manufacturer-list.tpl To remove top scrool, around line 70, delete the following: <div class="top-pagination-content clearfix bottom-line"> {include file="$tpl_dir./pagination.tpl" no_follow=1} </div>   For the bottom one,    Delete around line 153   <div class="content_sortPagiBar"> <div class="bottom-pagination-content clearfix"> {include file="$tpl_dir./pagination.tpl" no_follow=1 paginationId='bottom'} </div> </div>     To disable Sortibar Delete around line 51:   <div […]

Prestashop

Prestashop: Manufacturer Page Slow

Posted on

-> Classes-> Manufacturer.php   /* $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT p.`id_manufacturer`, COUNT(DISTINCT p.`id_product`) as nb_products FROM `'._DB_PREFIX_.'product` p USE INDEX (product_manufacturer) '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) WHERE p.`id_manufacturer` != 0 AND product_shop.`visibility` NOT IN ("none") '.($active ? ' AND product_shop.`active` = 1 ' : '').' '.(Group::isFeatureActive() && $all_group ? '' : […]

Uncategorized

Talend Studio: Allocate Memory

Posted on

https://community.talend.com/t5/Migration-Configuration-and/Allocating-more-memory-to-Talend-Studio/ta-p/21642   Locate the .ini file inside the Talend installation folder.  With 8 GB of memory available on 64-bit system, the optimal settings can be: -vmargs -Xms1024m -Xmx4096m -XX:MaxPermSize=512m -Dfile.encoding=UTF-8 After this, you need to configure this same variables on the Advanced Settings of the Run Tab.

OpenBravo

Openbravo: Custom Query to find Invoice's Product Account

Posted on

SELECT c_invoice.documentno, c_invoiceline.linenetamt, --m_product_acct.m_product_id, --m_product_acct.ad_org_id, m_product_acct.p_expense_acct, c_elementvalue.name FROM c_invoice LEFT JOIN c_invoiceline ON c_invoice.c_invoice_id = c_invoiceline.c_invoice_id LEFT JOIN m_product_acct ON c_invoiceline.m_product_id = m_product_acct.m_product_id LEFT JOIN c_elementvalue ON c_elementvalue.c_elementvalue_id = m_product_acct.p_expense_acct WHERE dateinvoiced > '2017-01-01 00:00:00' AND dateinvoiced < '2017-12-31 00:00:00' AND issotrx = 'N' AND m_product_acct.c_acctschema_id = '092273C810444B4086ED18612E3F5833' ORDER BY --c_invoice.dateinvoiced ASC p_expense_acct asc

Uncategorized

Excel: Create Random 40 character string

Posted on

=CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(10,99)&RANDBETWEEN(10,99)&CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))

Uncategorized

Java Version

Posted on

I have java 6 installed, and decided to install java 7. But even after I installed java 7 the system recognized java 6.  To select java 7 as default: sudo update-alternatives --config java

Prestashop

Prestashop: Remove undefined from Product List

Posted on

When you switch the view from Manufacturer's Product List you get an undefined Character.  To remove this go to  /var/www/html/XXXXXXX/themes/default-bootstrap/js/global.js: Comment the following lines: Line 284: html += '<h5 itemprop="name">'+ $(element).find('h5').html() + '</h5>';   Line 324: html += '<h5 itemprop="name">'+ $(element).find('h5').html() + '</h5>';

Uncategorized

IPTables

Posted on

To have the tables load after reboot sudo apt-get install iptables-persistent Then after you edit the iptables, if you want to update the initial file you should sudo /etc/init.d/iptables-persistent save   To enable the log, you need to: iptables -N LOGGING iptables -A INPUT -j LOGGING iptables -A LOGGING -m limit --limit 10/min -j LOG […]

Uncategorized

Excel: VBA Script to Clean Text

Posted on

Function StripAccent(thestring As String) Dim A As String * 1 Dim B As String * 1 Dim i As Integer Const AccChars= "ŠŽšžŸÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖÙÚÛÜÝàáâãäåçèéêëìíîïðñòóôõöùúûüýÿ" Const RegChars= "SZszYAAAAAACEEEEIIIIDNOOOOOUUUUYaaaaaaceeeeiiiidnooooouuuuyy" For i = 1 To Len(AccChars) A = Mid(AccChars, i, 1) B = Mid(RegChars, i, 1) thestring = Replace(thestring, A, B) Next StripAccent = thestring End Function

Mautic

Mautic: Bounces Retrieval not working

Posted on

Error: [Symfony\Component\Debug\Exception\ClassNotFoundException] Attempted to load class "Type" from namespace "Mautic\EmailBundle\MonitoredEmail\Processor\Bounce". Did you forget a "use" statement for e.g. "JMS\Serializer\Annotation\Type", "Doctrine\DBAL\Types\Type", "Aws\DynamoDb\Enum\Type", "Symfony\Component\Validator\Constraints\Type" or "Mautic\Emai lBundle\MonitoredEmail\Processor\Bounce\Definition\Type"?   Best way to solve this is by adding the verbose option to the fetch command.  php app/console mautic:emails:fetch -v