Deprecated: Return type of WP_Theme::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/class-wp-theme.php on line 554

Deprecated: Return type of WP_Theme::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/class-wp-theme.php on line 595

Deprecated: Return type of WP_Theme::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/class-wp-theme.php on line 533

Deprecated: Return type of WP_Theme::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/class-wp-theme.php on line 542

Deprecated: Return type of WP_REST_Request::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/rest-api/class-wp-rest-request.php on line 920

Deprecated: Return type of WP_REST_Request::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/rest-api/class-wp-rest-request.php on line 940

Deprecated: Return type of WP_REST_Request::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/rest-api/class-wp-rest-request.php on line 952

Deprecated: Return type of WP_REST_Request::offsetUnset($offset) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /home/techcorner/umatechcorner.com/wp-includes/rest-api/class-wp-rest-request.php on line 963

Deprecated: trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/techcorner/umatechcorner.com/wp-includes/class-wp.php on line 173

Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/techcorner/umatechcorner.com/wp-includes/wp-db.php on line 2975

Warning: Cannot modify header information - headers already sent by (output started at /home/techcorner/umatechcorner.com/wp-includes/class-wp-theme.php:9) in /home/techcorner/umatechcorner.com/wp-includes/feed-rss2.php on line 8
Page not found – Uma Anand Ilango https://www.umatechcorner.com Software Consultant & Project Manager Fri, 01 May 2020 19:49:37 +0000 en-US hourly 1 https://wordpress.org/?v=5.4.1 [SOLVED] CodeIgniter – Google Cloud MySQL connect with SSL https://www.umatechcorner.com/solved-codeigniter-google-cloud-mysql-connect-with-ssl/ https://www.umatechcorner.com/solved-codeigniter-google-cloud-mysql-connect-with-ssl/#respond Fri, 01 May 2020 19:48:49 +0000 http://www.umatechcorner.com/?p=227 For one of my projects, the database is hosted in Google Cloud SQL. The connection to this database is available only via SSL. This is the first time I am switching from unsecure connection to secure connection in MySQL.

Below code was written in test.php to make sure that I can connect to the database server via SSL

<?php

$mysqli = mysqli_init();

if (!$mysqli) {
  die("mysqli_init failed");
}


$mysqli -> ssl_set("<<home_dir_user>>/.ssh/client-key.pem", "<<home_dir_user>>/.ssh/client-cert.pem", "<<home_dir_user>>/.ssh/server-ca.pem", NULL, NULL); 

if (!$mysqli -> real_connect("<<google_cloud_public_ip>>","<<dbuser>>","<<dbpassword>>","<<dbname>>")) {
  die("Connect Error: " . mysqli_connect_error());
}

echo "Connected";

?>

The code looks perfectly OK!

But unfortunately, this did not work as expected.

The first error I received was “<<dbuser>>@localip Access denied”. I was 200% sure that the credentials were correct. I had no idea what to do!

Googling did not give any useful result! [That’s the reason for this post too :)]. There were several thoughts made and tried. But the one that worked was to copy the certificate files to a folder within the project folder. For testing purposes, it was kept in the same folder where the connection was established. So, the code was changed to below

<?php

$mysqli = mysqli_init();

if (!$mysqli) {
  die("mysqli_init failed");
}


$mysqli -> ssl_set("client-key.pem", "client-cert.pem", "server-ca.pem", NULL, NULL); 

if (!$mysqli -> real_connect("<<google_cloud_public_ip>>","<<dbuser>>","<<dbpassword>>","<<dbname>>")) {
  die("Connect Error: " . mysqli_connect_error());
}

echo "Connected";

?>

Now, Access denied problem disappeared & I came across another issue.. “Peer certificate CN=[google-project:instance_id] did not match expected CN=[google-cloud-sql-public-ip]

Started googling again.. Client certificates generated in Google Cloud will have instance name. However, we cannot use the instance name to connect to MySQL. Therefore, these certificates become useless. We cannot generate certificates with IP address in Google Cloud. I felt like standing at a dead end!!

The only option that many had implemented is Google Cloud Proxy SQL. I started reading Google help to implement the same. Then came another thought and wanted to check it out before I start implementing proxy. The idea was to add google-cloud-instance-name in /etc/hosts file. The entry was like this

xx.xx.xx.xx google-cloud-project:instance-name #Added for Google Cloud SQL

Now.. tried to connect again.. and Tada.. It worked!

I would like to also update about other options errors that I faced, and how I fixed them…

MYSQLI_OPT_SSL_VERIFY_SERVER_CERT

$db = mysqli_init();
mysqli_options($db, MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true); 

At some point, I received the error SSL certificate cannot be verified. Therefore, added this option before ssl_set call. Later I removed this & it made no difference

client_flags in mysqli_real_connect – MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT

$mysqli -> real_connect("<<google_cloud_public_ip>>","<<dbuser>>","<<dbpassword>>","<<dbname>>", null, null, MYSQLI_CLIENT_SSL | MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT); 

Remember, you can use MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT option only when it exists in your PHP configuration. I later, removed this code and it still worked.

Good.. Now it works. But the ultimate goal was to setup SSL connection in CodeIgniter project. The config in database.php was written like below

$db['default'] = array(
	'dsn'	=> '',
        'hostname' => '<<google_cloud_ip>>',
	'username' => '<<dbuser>>',
	'password' => '<<dbpassword>>',
	'database' => '<<dbname>>',
        'dbdriver' => 'mysqli',
	'dbprefix' => '',
	'pconnect' => FALSE,
	'db_debug' => (ENVIRONMENT !== 'production'),
	'cache_on' => FALSE,
	'cachedir' => '',
	'char_set' => 'utf8',
	'dbcollat' => 'utf8_general_ci',
	'swap_pre' => '',
	'encrypt' => array(
		'ssl_key' => '<<folder_within_project_folder>>/client-key.pem',
		'ssl_cert' => '<<folder_within_project_folder>>/client-cert.pem',
		'ssl_ca' => '<<folder_within_project_folder>>/server-ca.pem',
		'ssl_verify' => FALSE,
	),
	'compress' => FALSE,
	'stricton' => FALSE,
	'failover' => array(),
	'save_queries' => TRUE
);

Note, although you put it in “encrypt” array, nothing is encrypted in codeigniter. The option MYSQLI_CLIENT_SSL is being set, which takes care of client encryption.

]]>
https://www.umatechcorner.com/solved-codeigniter-google-cloud-mysql-connect-with-ssl/feed/ 0
[SOLUTION] – Oracle APEX – XDB Authentication Popup dialog https://www.umatechcorner.com/solution-oracle-apex-xdb-authentication-popup-dialog/ https://www.umatechcorner.com/solution-oracle-apex-xdb-authentication-popup-dialog/#comments Wed, 13 Aug 2014 11:57:49 +0000 http://www.umatechcorner.com/?p=178 I am facing with “XDB authentication popup dialog” for a long time. This usually happened when I tried to access the apex root url such as http://xxx.xxx.xxx.xx/apex. When I was accessing to the apex login page directly, such as http://xxx.xxx.xxx.xxx/apex/f?p=4550, everything was fine. So, I did not give importance to fix XDB authentication issue for long time.

Since Today morning, this issue popped up for any page that I would tried to access. It became a very annoying problem and I had to fix it immediately or just forget about using APEX until the issue is fixed. I already knew that it has to do with permissions. A little google search took me to apexexplorer.com. I know the admin “Md. Kamam Hossain”. He is an early bird APEX Certified expert. So, I was confident about this solution and wanted to try that instead of searching at other urls.

However, the script which he published has some syntax errors. So, I am publishing the working script here.

Make sure you are connected to SQL Plus with SYSDBA privileges such as using the command “CONNECT SYS AS SYSDBA”


DECLARE
l_configxml XMLTYPE;
l_value VARCHAR2(5) := 'true'; --(true/false)
BEGIN
l_configxml := DBMS_XDB.cfg_get();
IF l_configxml.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') = 0 THEN
-- Add missing element.
SELECT insertChildXML
(
l_configxml,
'/xdbconfig/sysconfig/protocolconfig/httpconfig',
'allow-repository-anonymous-access',
XMLType('<allow-repository-anonymous-access xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">' ||
l_value ||
'</allow-repository-anonymous-access>'),
'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
)
INTO l_configxml
FROM dual;
DBMS_OUTPUT.put_line('Element inserted');
ELSE
-- Update existing element.
SELECT updateXML
(
DBMS_XDB.cfg_get(),
'/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access/text()',
l_value,
'xmlns=”http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
)
INTO l_configxml
FROM dual;
DBMS_OUTPUT.put_line('Element updated.');
END IF;
DBMS_XDB.cfg_update(l_configxml);
DBMS_XDB.cfg_refresh;
END;
/

You can download the script here

Apart from executing the script, you need to also unlock XDB & Anonymous account. Use the command below for it.


SQL > ALTER USER ANONYMOUS IDENTIFIED BY anonymous;
SQL> ALTER USER ANONYMOUS ACCOUNT UNLOCK;
SQL> ALTER USER XDB IDENTIFIED BY xdb;
SQL> ALTER USER XDB ACCOUNT UNLOCK;

]]>
https://www.umatechcorner.com/solution-oracle-apex-xdb-authentication-popup-dialog/feed/ 8
Invalid Hostname – Bad Request https://www.umatechcorner.com/invalid-hostname-bad-request/ https://www.umatechcorner.com/invalid-hostname-bad-request/#respond Mon, 11 Aug 2014 10:24:56 +0000 http://www.umatechcorner.com/?p=174 We could get this error for any HTTP Request. I had this error due my Oracle HTTP Listener. After installing Oracle XE 11g 64 bit version, I was unable to open “Getting Started” link. I installed HTTP Listener on 80 port (instead of the usual 8080 or 8081).

 

 

badrequest

Bad Request Invalid Hostname

 

The error was “Bad Request or Invalid Hostname”. It did not work for address .. meaning, even loopback address did not work. I tried the following

1. Loopback address 127.0.0.1

2. localhost

3. Server IP Address

4. Server Name

“Invalid Hostname” tells me clearly that the hostnames which I am referring to is not found somewhere & therefore it could not resolve it. Many results from google search were centralized on 80 port not visible in TNSListener. For me, it did not sound like the actual problem. Then I had a thought of going to hosts file & check it there. So, I opened hosts file from c:\windows\system32\drivers\etc folder. I added an entry for my server ipaddress with sername as

<<serveripaddress>> <<servername>>

Saved it & to be sure, restarted the server.

After restarting, I tried to browse Oracle Get Help page & it worked. Now moving to my next issue with Oracle installation.. Hope this information was useful to you.

 

]]>
https://www.umatechcorner.com/invalid-hostname-bad-request/feed/ 0
Oracle TNSListener windows service won’t start – SOLVED https://www.umatechcorner.com/oracle-tnslistener-windows-service-wont-start-solved/ https://www.umatechcorner.com/oracle-tnslistener-windows-service-wont-start-solved/#respond Mon, 11 Aug 2014 09:45:33 +0000 http://www.umatechcorner.com/?p=172 Sleepless night. I wanted to shift from 32bit Oracle11g XE to 64bit Oracle11gXE. Started this yesterday evening and still not finished the move successfully. Got stuck with small issues but with big impact. Here is one such small issue.

I downloaded & installed Oracle11g XE 64 bit on my 64bit virtual server. Installation was successful. But Oracle TNSListener windows service is not starting. Through Windows Service (services.msc), I do not get a proper error message. Initially it was “TNSListener is configured as interactive service. The dependent service is not started”. So I started “Interactive Services”. But still, this issue was not solved.

There was also no useful information in Event Log (eventvwr).

After some thinking, I decided to start listener service from command prompt. So, go to command prompt & type “lsnrctl start”. Now here, I could see the proper error message

 

With “No Message” data, I made a google search & found this link  http://pavandba.com/tag/no-message-file-for-productnetwork/. Here, he is referring to Solaris server. But that doesn’t matter. What was more important was the Environment Variables “ORACLE_HOME” & “ORACLE_SID” that he was referring to.

I created them as System Environment Variables.

ORACLE_HOME=C:\oraclexe\app\oracle\product\11.2.0\server

ORACLE_SID=xe

Now, closed command prompt & opened a new instance and tried the same command – “lsnrctl start”. BINGO. IT WORKED

 

 

]]>
https://www.umatechcorner.com/oracle-tnslistener-windows-service-wont-start-solved/feed/ 0
Implement jQuery glow effect in Firefox https://www.umatechcorner.com/implement-jquery-glow-effect-in-firefox/ https://www.umatechcorner.com/implement-jquery-glow-effect-in-firefox/#respond Thu, 03 Jul 2014 21:53:26 +0000 http://www.umatechcorner.com/?p=163 .glow is another unsupported / partially supported jquery method in different browsers. Chrome supports it & the website looks wonderful with this effect. IE however, doesn’t support & I had issues with Firefox. My code was like below


$('.yellow').on('mouseenter', function () {
$(this).glow({ radius: "20", color: "#D7CD3A" });
})
.on('mouseout', function () {
$(this).glow({ radius: "20", color: "#D7CD3A", disable: true });
});


$('.purple').on('mouseenter', function () {
$(this).glow({ radius: "20", color: "#a354bb" });
})
.on('mouseout', function () {
$(this).glow({ radius: "30", color: "#a354bb", disable: true });
});

$('.green').on('mouseenter', function () {
$(this).glow({ radius: "30", color: "#538b73" });
})
.on('mouseout', function () {
$(this).glow({ radius: "20", color: "#538b73", disable: true });
});

I basically have 2-5 products in each category. Every category products are in a specific color. For ex, yellow, green, blue and purple. I used JQuery Plugin (https://github.com/MisterDr/JQuery-Glow) to implement this glow effect for my different products in my website. This worked like a charm in Chrome. However, in Firefox there was an issue. The glow color was permanently set to the first product which I would hover. For ex, if I do, mouseenter event for a yellow product & then do mouseenter for a green product, the glow color for green product would be yellow.

Though, I was setting “disable: true” in mouseout event, it was not considered. I checked out several options and it did not work out. Thanks to Keshav Pandit, who took some time to look into Glow JQuery Plugin api code & he told me that the code refers to “id” and not “class” attribute value to identify an element. I was just wondering, if it is so, how it is working in Chrome & also in Firefox, glow in & out was also working. Just that the specified color was not used.

Anyway, I took his comment, added “id” attribute to all products and also changed the above code to reference to “id” rather than “class”. Viola!!! It worked. Though I have duplicate content now, the expected feature is there & I am happy..

If you look at plugin example, they have also used only “id” attribute. I didn’t think about trying it that way at all, until Keshav suggested me to check it. By this time, I was out-of-energy and couldn’t think. I just did what he said & again Thanks to him.. it worked.. Now the code looks like below

$('#yellow1').on('mouseenter',function(){
   $(this).glow({ radius:"20", color:"#D7CD3A"});}).on('mouseout',function(){//$(this).glow({ radius: "20", color: "#D7CD3A", disable: true });
   $(this).glow({ disable:true});});


]]>
https://www.umatechcorner.com/implement-jquery-glow-effect-in-firefox/feed/ 0
Underscore.js jQuery plugin for scroll functionality https://www.umatechcorner.com/underscore-js-jquery-plugin-for-scroll-functionality/ https://www.umatechcorner.com/underscore-js-jquery-plugin-for-scroll-functionality/#respond Tue, 24 Jun 2014 20:30:00 +0000 http://www.umatechcorner.com/?p=155 For a website, I had to implement a parallax page with scrolling. Initially, I used onmousewheel event and set timeout to control scrolling. But this had different behavior in different devices. The initial code was like below


//Scrolling Event
if (document.addEventListener) {
// IE9, Chrome, Safari, Opera
document.addEventListener("mousewheel", ScrollBegin, false);
// Firefox
document.addEventListener("DOMMouseScroll", ScrollBegin, false);
}
// IE 6/7/8
else document.attachEvent("onmousewheel", ScrollBegin);

ScrollBegin function was like below


function ScrollBegin(e) {
if (document.removeEventListener) {
// IE9, Chrome, Safari, Opera
document.removeEventListener("mousewheel", ScrollBegin, false);
// Firefox
document.removeEventListener("DOMMouseScroll", ScrollBegin, false);
}
// IE 6/7/8
else document.detachEvent("onmousewheel", ScrollBegin);
// cross-browser wheel delta
var e = window.event || e; // old IE support
var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));
//if the delta value is negative, the user is scrolling down
if (delta < 0) {
timer = setTimeout(function () {
MoveScreen('down');
clearTimeout(timer);
if (document.addEventListener) {
// IE9, Chrome, Safari, Opera
document.addEventListener("mousewheel", ScrollBegin, false);
// Firefox
document.addEventListener("DOMMouseScroll", ScrollBegin, false);
}
// IE 6/7/8
else document.attachEvent("onmousewheel", ScrollBegin);
}, 800);
}
else {
timer = setTimeout(function () {
MoveScreen('up');
clearTimeout(timer);
if (document.addEventListener) {
// IE9, Chrome, Safari, Opera
document.addEventListener("mousewheel", ScrollBegin, false);
// Firefox
document.addEventListener("DOMMouseScroll", ScrollBegin, false);
}
// IE 6/7/8
else document.attachEvent("onmousewheel", ScrollBegin);
}, 800);
}
}

On a windows PC with scrollable mouse, the function was working perfect. But on a Mac with Apple MagicMouse it was too fast. So, then I started thinking about controlling mouse speed. One option was to retrieve mousespeed in eventhandler and reduce it. After some research and with help from stackoverflow.com, I came across underscore.js jQuery Plugin. This plugin is cool.

Now, I changed my function to be like below

<script src="http://underscorejs.org/underscore-min.js"></script>

$(document).on("mousewheel", _.debounce(MouseWheelHandler, 150, false));

function MouseWheelHandler(event, delta) {
if(delta<0)
{
direction='down';
}
else
{
direction='up';
}
MoveScreen(direction);
};

The second parameter in _.debounce function is time interval in milliseconds to wait after event has ended. The default value is 1000ms. But this was too slow for me. So, I set it to 150ms.

The most important point to note is that it has the same behavior across browsers and mouse devices. Super cool plugin.

 

]]>
https://www.umatechcorner.com/underscore-js-jquery-plugin-for-scroll-functionality/feed/ 0
WordPress – Request exceeded the limit of 10 internal redirects https://www.umatechcorner.com/wordpress-request-exceeded-the-limit-of-10-internal-redirects/ https://www.umatechcorner.com/wordpress-request-exceeded-the-limit-of-10-internal-redirects/#respond Tue, 10 Jun 2014 08:39:24 +0000 http://www.umatechcorner.com/?p=119 I came across this issue yesterday midnight in one of my wordpress sites. Initially, I was shocked. Becoz I haven’t done any changes to this wordpress site for more than a month and it is not working suddenly. What happened????

The first problem was that any URL that you click will always show all the posts. For ex, Post URL, Specific Page URL, Specific Category, Specific Tag – everything was showing me the same response with all the recent posts. In the beginning, I never thought about permalinks. I understood that there was some redirection happening and since it failed, the default response with recent posts was displayed. I could not track the redirects using HTTP Analyzer. So this is happening within WordPress. This is when I opened the ERROR Log File & found the below log.

[Tue Jun 10 09:56:09 2014] [error] [client 130.75.69.111] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/category/mediathek/gallerie-uk-videos/
[Tue Jun 10 09:56:09 2014] [error] [client 130.75.69.111] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/category/mediathek/gallerie-uk-videos/
[Tue Jun 10 10:01:18 2014] [error] [client 66.249.67.47] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 10 10:01:18 2014] [error] [client 66.249.67.47] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 10 10:01:51 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 10 10:01:51 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 10 10:01:51 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 10 10:01:51 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 10 10:02:37 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:02:37 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:02:42 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:02:42 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:03:05 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:03:05 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:03:12 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:03:12 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:03:15 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/
[Tue Jun 10 10:03:15 2014] [error] [client 93.220.45.28] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://www.hechtundbarsch.de/

I started googling & also checked in WordPress support. Everyone were discussing about .htaccess file. I did not see any strange settings in .htaccess file. So was sure that there is no problem with it. Now the idea clicked, I went into wp-admin & permalinks section. Here I figured out that the permalink structure couldn’t be saved in .htaccess file since the file has lost write permission. Cool.. Found the root cause.

 

Solution
Edit permission settings of .htaccess file & give write permission to it. Go back to permalink structure & refresh it. Now you can see everything is saved and it works fine.

 

Related Links:

http://wordpress.org/support/topic/all-url-is-showing-all-posts

http://stackoverflow.com/questions/24130146/all-url-is-showing-all-posts

 

]]>
https://www.umatechcorner.com/wordpress-request-exceeded-the-limit-of-10-internal-redirects/feed/ 0
Paging shown twice in .dataTable() during localization https://www.umatechcorner.com/paging-shown-twice-in-datatable-during-localization/ https://www.umatechcorner.com/paging-shown-twice-in-datatable-during-localization/#respond Mon, 03 Sep 2012 12:11:23 +0000 http://www.umatechcorner.com/?p=72 I develop a PHP Zend Framework website. The table rows are displayed in table format using dataTables (www.datatables.net). The API is great and works wonderfully. My site is implemented in 2 languages currently – English(default) & German. So I tried implementing localization like given in http://www.datatables.net/examples/advanced_init/language_file.html

I added this code in my .phtml file

[PHP CODE - CHECK IF $_COOKIE['lang_code'] IS SET]
[SCRIPT CODE START]
$(document).ready(function(){
oTable = $('#example, #subscribed_docs_table, #changed_subscribed_docs_table').dataTable({
"oLanguage": {
"sUrl": "baseUrl();?>/media/language/.txt"
},
"bJQueryUI": true,
"sPaginationType": "full_numbers"
});
});
[SCRIPT END]
[PHP CONDN BLOCK END]

It was simply loading for unlimited time. I couldn’t figure the issue and did not do what to do. I moved this code to the bottom after

generation code. But that also did not help.

Then I started changing the order of parameters passed to oTable and set it like below.

$(document).ready(function(){
oTable = $('#example, #subscribed_docs_table, #changed_subscribed_docs_table').dataTable({

"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sUrl": "baseUrl();?>/media/language/.txt"
}
});
});

Now you will not believe me.. IT WORKED.

Now it is perfectly showing the content properly with localization.

]]>https://www.umatechcorner.com/paging-shown-twice-in-datatable-during-localization/feed/0 [SOLVED] ImageMagick Convert command high memory usage issue https://www.umatechcorner.com/solved-imagemagick-convert-command-high-memory-usage-issue/ https://www.umatechcorner.com/solved-imagemagick-convert-command-high-memory-usage-issue/#respond Thu, 09 Aug 2012 13:36:33 +0000 http://www.umatechcorner.com/?p=68 Everybody using ImageMagick’s convert command would be facing this issue. And this could be breaking your head also forcing you to choose other options.

I am using ImageMagick to extract thumbnails of pdf documents. This script is running as a cron job & it is called almost every minute.

Now you can imagine that I would have gone crazy becoz of it. Yes, my memory usage is always 100%, diallowing me to do anything else in the server.

I am using a VPS linux server with a domain hosted. The domain will be accessed by public users. Now, since this cron job is using 100% memory, the site never responds. It takes about 1 min to load each page.

I started thinking for other options and decided to use ghostscript gs command. But this was not delivering output in the same quality as convert command. So I had to go back to convert command and find a solution to memory issue.

-limit command option was like a good solution for me. Refer: http://www.imagemagick.org/script/command-line-options.php#limit. So the command was like


convert -limit area 1GiB -limit disk 5EiB -limit memory 1GiB -limit map 2GiB -density 500 "' . $fullpath . '" -resample ' . $dpi . ' "' . $destFolder . '/%d.jpg"'

I looked at the process memory usage using top command in console.

top

But it was the same. It occupied full memory. The site was not responding.

Finally, I found this link http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=10847

I used the below command

nice -n 19 convert -density 500 "' . $fullpath . '" -resample ' . $dpi . ' "' . $destFolder . '/%d.jpg"'

Note that using ‘nice’ will not prevent a command from using 100% CPU. What it does do is say that if any other process needs CPU, it will get a higher priority than the ‘nice’ processes. At nice 19, that means the niced process will generally not run unless no other process needs the CPU, that it it uses ‘idle’ time.

Now the memory usage is still shown as 99.9% for convert command. But my site is responsive. It responds in a second, like normal.

I am now fine with convert command using 99.9%, as long as the site is responsive and end users don’t find a difference.

Hope this is helpful for others too… !!!

]]>
https://www.umatechcorner.com/solved-imagemagick-convert-command-high-memory-usage-issue/feed/ 0
How to include app.config file of a DLL plugin in EXE build https://www.umatechcorner.com/how-to-use-include-app-config-file-of-a-dll-plugin-in-exe-build/ https://www.umatechcorner.com/how-to-use-include-app-config-file-of-a-dll-plugin-in-exe-build/#respond Tue, 02 Aug 2011 12:49:12 +0000 http://www.umatechcorner.com/?p=54 My application references several DLL’s. Some of these DLL’s get their data from Web service. You might already know that the WebRefrence URI will be saved in config file. This config file will also be available in DLL’s bin folder. But when we add reference to the DLL in EXE, these DLL specific config files are lost. Therefore, before you build & send the EXE, you need to make sure that the given WebService Url is reachable by the target PC.

Recently, I had a problem with this. I package my application and deliver it to an external user. The user’s webservice url is different from what I configured which building. Practically, it is not possible for us to build the app for every customer. So, there needs to be a way to fix this issue. Yes. there are several ways of course. When I googled, I could find 2 possible solutions.

1. Copy DLL.config file from DLL’s bin folder to EXE bin folder.

2. Merge the content of DLL.config file in EXE.config file.

The former approach is simple. But we should never forget it. The later approach is complex but a programmer can do it easily.

My deep thought is “why Microsoft forgot to think about this issue while upgrading VS versions?”, “Is this by design?”, “There could be many with similar issue. Is there no other way to automatically add DLL.config file in EXE folder.?”

Yes. There is a third workaround. Why not use Pre-Build events of your project? It’s quite simple and removes all the hassles. Here is the way to use it.

1. Open your EXE project properties & switch to “Build Events” tab

Pre Build Events - Properties Window

Pre Build Events - Properties Window

2. Write the below copy command in it.

copy $(SolutionDir)<>\bin\Debug\<>.dll.config   $(TargetDir)

3. Save it & Build the project. Viola.. you can now see your DLL.config file automatically included in your EXE bin folder. Now your customers can be advised to change the reference url in these config files on their own. Isn’t it simple & easy to do?

Enjoy !!!!.

]]>
https://www.umatechcorner.com/how-to-use-include-app-config-file-of-a-dll-plugin-in-exe-build/feed/ 0