Speed Optimization for your Website make your site fast loading for $8

WordPress website optimization Check My Reviews before purchasing the Gig, Every Single Customer is Happy. Don’t comparison price with work quality..100% satisfaction and Refund Guarantee. Fix Render blocking javascript and CSS filesMinify javascript Minify CSS Configure entity tags (ETags) Gzip compression Optimize images Leverage browser caching Enable Keep-Alive etc,… Improve server response time (Depends upon your Web Hosting) What I will need from you to proceed. Your WordPress Admin loginYour Cpanel login

by: usmanaliakhtar
Created: —
Category: WordPress
Viewed: 131

expect, mpd5 and dynamic config loading

I have a FreeBSD server that’s connected to WAN using PPPoE. Iva esuccessfully set ip the L2TP and PPTP VPN ontop of this PPPoE WAN connection. The problem is that L2TP needs to call ‘set lt2p self ` clause to start listening to the udp/1701 port, so when the WAN PPPoE session is reestablished, I need to dynamically set up the L2TP config part. I’m using an expect script to do this, it connects to the mpd5 network console and loads the config part, and does it like this:

set timeout 2 spawn telnet localhost 5005  expect -re "Username: " {     send myc00ll0g1n\r     exp_continue -continue_timer } expect -re "Password: " {     send myc00lpa$  $  \r     exp_continue -continue_timer }  # destroying the knob send "destroy link l2tplink\r" expect ".+" send "destroy bundle l2tpbundle\r" expect ".+"  # loading the full knob: send "create bundle template l2tpbundle\r" expect ".+" send "set iface idle 1800\r" expect ".+" send "set iface enable tcpmssfix\r" expect ".+" send "set iface group vpn\r" expect ".+" expect ".+" send "set ipcp yes vjcomp\r" expect ".+" send "set ipcp ranges ippool vpn-pool\r" expect ".+" send "set ipcp dns\r" expect ".+" send "set bundle enable compression\r" expect ".+" send "create link template l2tplink l2tp\r" expect ".+" send "set link action bundle l2tpbundle\r" expect ".+" send "set link enable multilink\r" expect ".+" send "set link yes acfcomp protocomp\r" expect ".+" send "set link no pap chap eap chap-md5 chap-msv1 chap-msv2\r" expect ".+" send "set link enable chap\r" expect ".+" send "set link enable pap\r" expect ".+" send "set link enable chap-md5\r" expect ".+" send "set link enable chap-msv1\r" expect ".+" send "set link enable chap-msv2\r" expect ".+" send "set link enable eap\r" expect ".+" send "set eap no md5 radius-proxy\r" expect ".+" send "set eap enable eap\r" expect ".+" send "set eap enable radius-proxy\r" expect ".+" send "set link keep-alive 10 60\r" expect ".+" send "set link mtu 1360\r" expect ".+" send "set link enable incoming\r" expect ".+" send "set l2tp self 384.656.768.272\r" expect ".+" send "set link max-children 50\r" expect ".+" send "set radius server myc00lradiuspa$  $  \r" expect ".+" send "set radius retries 3\r" expect ".+" send "set radius timeout 3\r" expect ".+" send "set radius me\r" expect ".+" send "set auth acct-update 300\r" expect ".+" send "set auth enable radius-auth\r" expect ".+" 

It’s fully working when I invoke it interactively via ssh. So I added it into the ‘set iface up-script and the expect wrapper is calling it likeexpect -f myscript.exp`. But when it does that on PPPoE connection reestablishing, I receive the following bunch of errors in the mpd.log:

Mar 21 17:42:23 ronin mpd[37412]: [wan] IFACE: Up event Mar 21 17:42:23 ronin mpd[37412]: CONSOLE: Connect Mar 21 17:42:23 ronin mpd[37412]: CONSOLE: Allocated new console session 0x802000010 from Mar 21 17:42:23 ronin mpd[37412]: CONSOLE: Failed login attempt from Mar 21 17:42:23 ronin syslogd: last message repeated 34 times Mar 21 17:42:23 ronin mpd[37412]: CONSOLE: Error while reading: Connection reset by peer 

And this is definitely my expect script (because it does send right about 34 lines of commands). Why ? Why does it work when I invoke it by hand and when mpd5 invokes it – it does not ? Okay, I understand that when I invoke it it has a controlling terminal, and when mpd5 invokes it it does not, but does it matter ? How do I solve this ? Or is the root of the problem something else ?

Loading new paths from text with eval file dont update $PATH variable on bash

Having to set a lot of paths on $ PATH then wrote this code to load it from a text file:

  #!/bin/bash   echo '#++++++' >> ./pathlstbkp   cat ./pathlst >> ./pathlstbkp   while read pth; do      cmd='export PATH="'$  pth':$  PATH"'     eval $  {cmd}   done < ./pathlst   echo '' > ./pathlst  

But it dont change the $ PATH variable

Error loading javascript code in content editor webpart in other browser except IE 11

I have added content editor webpart in NewForm.aspx in SP2013 and reading the code to javascript file called HideFields.ps1. The script is working as expected in IE 11 but not in Firefox, Chrome and Edge.

I got this error message in Firefox: enter image description here

So the script as below:

    <script type="text/javascript" src="https://code.jquery.com/jquery-1.10.1.min.js"></script>     <script type="text/javascript" language="javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.SPServices/0.7.1a/jquery.SPServices-0.7.1a.min.js"></script>     <script type="text/javascript">      $  (document).ready(function() {       $  ().SPServices({       operation: "GetGroupCollectionFromUser",       userLoginName: $  ().SPServices.SPGetCurrentUser(),       async: false,       completefunc: function(xData, Status) {       var xml = xData.responseXML.xml;         //If the current User does belong to the group "Test Group"         if (xml.search('Test Group') == -1)          {              $  ('td.ms-formlabel:contains("Description")').parent().hide();             }           }       });      });     </script> 

Websites loading very slowly

I have a problem with WiFi connection for a few days (Ubuntu 18.04, ThinkPad 240, wireless card – Intel Wireless 7260). When I’m connected to WiFi I have a really long delay when entering a website (about 30 seconds). I can connect through WiFi to my NAS without any problem with normal speed. Also when I manage to enter website (after long time of waiting) the download speed is normal. I don’t have this problem when I’m using mobile network modem. WiFi is working fine on other devices (android, apple, old laptop with Ubuntu 14.04) so I assume it’s not correlated with router or internet provider.

Is it a Factory Pattern Usecase, when loading configs in constructor for an API?

I have a class called GatewayAPI, which has to load configs from a file, when used. I first wanted to put the get_config() method in the constructor, but I don’t like this design for testing purposes.

Now I plan to do a factory, which creates this GatewayObject. Is this a typical usecase for the Factory Pattern?

Second question: Is it enough to put a method called “create” in the APIGateway class or should the factory be independent?

enter image description here