Notepad++ Append Text To Every Line

Notepad++ Append Text To Every Line

It is actually really simple, enter notepad++ with the file you want to edit and hit the key combination CTRL+F and a search window appears. Change the tab to  ‘Replace’. At the bottom left corner, change the search mode to ‘Regular expression’. Now under ‘Find what’, enter ^(.*)$, and under ‘Replace with’, enter $1whatevertextyouwantnotepad++texttoappend

The $1 will be the existing text found in the line, and so technically you could do more complex modifications such as (texttoprepend)$1(texttoappend)

It’s that simple !

Enjoyed the content ? Share it with your friends !

WordPress Code To Improve Bulk Insert Or Update Post Speed

WordPress Code To Improve Bulk Insert Or Update Post Speed

When you hit tens of thousands of posts in WordPress, the speed of wp_insert_post or wp_update_post gets significantly slower. To improve the speed, you simply add the following code and you will see that the speed improves significantly.

Add these two lines of code before your insert or update loop

wp_defer_term_counting(true); 
wp_defer_comment_counting(true);

And add these two lines after your insert or update loop

wp_defer_term_counting(false);
wp_defer_comment_counting(false);

By adding these few lines of code, you are temporarily disabling the term counts until all posts have been inserted or updated to speed up the process

Enjoyed the content ? Share it with your friends !

Best Paid cPanel Alternatives

Best PAID cPanel Alternatives

With the recent changes to cPanel pricing structure, both providers and individuals are scrambling to look for alternative solutions to cPanel. Here are some of the better paid alternatives to cPanel that are affordable with reasonable pricing structure.

Direct Admin

DirectAdmin is touted as the closest comparable panel to cPanel. Although it is still lacking in some areas as compared to cPanel, such as in available plugins, it is probably the next best panel after cPanel. With the changes in the cPanel pricing structure, you can expect that many providers to be flooding over to DirectAdmin. Eventually, that means that development for DirectAdmin will be sped up in many ways.

The pricing for DirectAdmin is as shown below

DirectAdmin pricing structure
DirectAdmin pricing structure

Centos Web Panel (CWP)
Centos Web Panel is a relatively new panel as compared to other panels. It offers a free version, as well as a paid version CWP Pro. Its paid version, compared to other panels, is much more affordable. It has all the basic features a web panel needs and more, and is definitely great if you are an individual looking for a cPanel alternative. However, if you are a provider, it may not be the best solution for you.

The pricing for CWP Pro is as shown below

CWP pricing structure

Interworx

Interworx is an alternative solution to cPanel that works for providers. However, it is known to be quite buggy in the past, and I am not sure how this has changed. Nonetheless, it should have hopefully improved over the years.

The pricing structure for Interworx is as follow

Interworx pricing structure
Interworx pricing structure

 

If you are looking for free alternatives to cPanel, you may look here

 

Enjoyed the content ? Share it with your friends !

Virtualmin How To Change PHP Execution Time Limit

Virtualmin How To Change PHP Execution Time Limit

In order to change the execution time limit of your scripts, you will need to change 2 options in Virtualmin. First, which you should probably already know is the PHP max_execution_time variable. Secondly, you will need to change the Maximum PHP Script Run Time option.

Changing the PHP maximum_execution_time variable
  1. Assuming you have already entered Virtualmin and selected the domain you want to manage, click on the Services category.
  2. It will then open up to more options. Click either PHP 5 Configuration or PHP 7.0 Configuration according to what your domain is using (by default domains use PHP 7.0)1. change php 5 or 7 timeout limit
  3. Finally, change the timeout you want accordingly as shown below. Use the value 0 for unlimited or infinite execution time

Changing the Maximum PHP Script Run Time Option
  1. Click on the Server Configuration category
  2. Click the sub-category Website Options
  3. You should see the Maximum PHP Script Run Time option. Change it to whatever you wish. Use the value 0 for unlimited or infinite execution time2. change website options timeout limit

If you require any assistance, please feel free to ask in the comments below.

Enjoyed the content ? Share it with your friends !

PHP PhantomJS Change User Agent String

PHP PhantomJS Change User Agent String

Noticed that google isn’t really useful in this case (there’s no copy and paste answer). Google for me only shows a bunch of people having issues and no easy solution when in fact the solution is quite simple

First things first, you have to check to see if your PHP-PhantomJs library version is 3.x or 4.x

If it is 3.x, to change the user-agent string, you just have to do this

$request->addSetting('userAgent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0');

If it is 4.x, to change the user-agent string, you just have to do this

$request->addHeader('User-Agent', 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0');

Of course, feel free to change the new value of your user-agent to whatever you want it to be.

To verify that it is working, if your testing locally, then you can use tools such as Fiddler to check the headers. Alternatively, you can dump out the $request and $response variables, like so,

var_dump($request); // $request is the return value of either createRequest or createCaptureRequest function
var_dump($response); // $response is the return value of createResponse function

If you have any questions feel free to let me know in the comments below.

 

 

Enjoyed the content ? Share it with your friends !