tag:blogger.com,1999:blog-75585015192953549102024-02-20T00:32:43.634-08:00tech blogMuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-7558501519295354910.post-35539006331160761722022-11-13T20:25:00.000-08:002022-11-13T20:25:15.456-08:00How to access SSH of AWS EC2 Instance without keypair/pem file<p style="text-align: left;"></p><ul style="text-align: left;"><li><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"><span style="font-size: medium;"> Login into your instance with the .pem file</span></span></li><li><span style="font-size: medium;"><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">sudo su</strong></span></li><li><span style="font-size: medium;"><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">cd /</strong><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> (just incase)</span></span></li><li><span style="font-size: medium;"><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> Edit, </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">vim /etc/ssh/sshd_config</strong><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> and edit or do the equivilent of uncommenting these lines:</span></span></li></ul><p></p><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;"><p style="text-align: left;"><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: medium;">Port 22</span></strong></p><p style="text-align: left;"><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: medium;">PasswordAuthentication yes</span></strong></p><p style="text-align: left;"><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;"><span style="font-size: medium;">PermitRootLogin yes</span></strong></p></blockquote><p style="text-align: left;"></p><ul style="text-align: left;"><li><span style="font-size: medium;"><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;">Restart sshd service, </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">service sshd restart</strong><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> or </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">systemctl restart sshd</strong><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;"> or equivilent</span></span></li><li><span style="font-size: medium;"><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;">Set password, </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">passwd</strong></span></li><li><span style="font-size: medium;"><span style="background-color: white; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif;">Log out and log back in without .pem file </span><strong style="background-color: white; border: 0px; box-sizing: inherit; color: #232629; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI Adjusted", "Segoe UI", "Liberation Sans", sans-serif; font-stretch: inherit; font-variant-east-asian: inherit; font-variant-numeric: inherit; line-height: inherit; margin: 0px; padding: 0px; vertical-align: baseline;">ssh root@12.345.67.890</strong></span></li></ul><p></p>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-840176855626079072019-02-04T01:21:00.003-08:002019-02-04T01:24:17.919-08:00How to access mysql installed on your EC2 instance from your local mysql client (sqlyog ..) [ssh tunnelling]<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
<h4 style="text-align: left;">
Assumptions:</h4>
- You have access to EC2 instance with ssh key pair (.pem)<br />
- Mysql server is installed on you EC2 instance which is up and running<br />
- You should have one mysql user with all necessary privileges<br />
<ol style="text-align: left;">
</ol>
<div>
<br /></div>
<div>
<br />
<h2 style="text-align: left;">
</h2>
<h3 style="text-align: left;">
Create a ssh tunnel on Mac os or linux:</h3>
<br />
<div style="text-align: left;">
<span style="font-size: small; font-weight: normal;">Open command prompt and run</span> <span style="font-size: small;"><span style="font-weight: normal;">below command from your terminal:</span><br /><i><br /><span style="font-weight: 400;">ssh -i "</span>My-key</i><span style="font-weight: 400;"><i>.pem" ubuntu@ec2-13-23--123.us-east-2.compute.amazonaws.com -L 3307:127.0.0.1:3306 -N</i></span></span><br />
<span style="font-size: small;"><span style="font-weight: 400;"><i><br /></i></span></span>
<span style="font-size: small;"><span style="font-weight: 400;"><i><br /></i></span></span>
<span style="font-size: small;"><span style="font-weight: 400;"><i><br /></i></span></span>
<span style="font-size: small;"><span style="font-weight: 400;"><i><br /></i></span></span><span style="font-size: small;">[My-key] - <span style="font-weight: normal;">Point where your key pair is located</span></span><br />
<span style="font-size: small;"><span style="font-weight: 400;"><br /></span></span><span style="font-size: small;"><span style="font-weight: 400;">[3307] - Changed the port from 3306 to 3307, in case if you have mysql server already running locally on default port</span><br /><br />[L]</span><span style="font-size: small; font-weight: 400;"> - Binds local port to remote host port</span></div>
<div style="text-align: left;">
<span style="font-size: small; font-weight: 400;"><br /></span></div>
<div style="text-align: left;">
<span style="font-size: small;">[N] </span><span style="font-size: small; font-weight: 400;">- Means forwarding ports</span><span style="font-size: small;"><span style="font-weight: normal;"><br /></span></span><br />
<h3 style="text-align: left;">
Connect to remote mysql using client:</h3>
<div>
<br /></div>
<div>
Here I am connecting with sql yog:</div>
<div>
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2dhd0T7EXjzS_2c6FF0PuZabLGMRVwkizyAb5IDg8yxwW3Fg6Emc_a0mYXTul3N7DtO4-H5cYENmxwtMA1leOCcMHDpJTOrKOiuGC3tibsKkw71xRhNVgYcMx_DnArY1T_NVn5rDnCDhy/s1600/Selection_072.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="369" data-original-width="469" height="251" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2dhd0T7EXjzS_2c6FF0PuZabLGMRVwkizyAb5IDg8yxwW3Fg6Emc_a0mYXTul3N7DtO4-H5cYENmxwtMA1leOCcMHDpJTOrKOiuGC3tibsKkw71xRhNVgYcMx_DnArY1T_NVn5rDnCDhy/s320/Selection_072.png" width="320" /></a></div>
</div>
</div>
</div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-23265966990249645742015-06-09T01:07:00.000-07:002015-06-09T01:07:17.358-07:00Search a file with matching a pattern under directory in linux, unix ..<div dir="ltr" style="text-align: left;" trbidi="on">
Run this command<br />
<blockquote>
grep -H -r [<span style="color: red;">pattern</span>] [<span style="color: red;">directory</span>]</blockquote>
<br />
<span style="color: red;">pattern</span> - Replace this with your custom patter<br /> <span style="color: red;">directory</span> - Replace this with your custom patter<br />-H : means to print the filename for each match.<br />
-r : Read all files under each directory, recursively;</div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-46906745707568828932015-02-24T11:01:00.000-08:002015-02-24T11:01:25.119-08:00Javascript closure simple example snippet<div dir="ltr" style="text-align: left;" trbidi="on">
<script src="https://gist.github.com/anonymous/d35e0b4e0164ddb49d19.js"></script>
<b><span style="font-size: large;">Demo</span></b>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
Counting with a local variable.<br />
<button onclick="myFunction()" type="button">Count!</button>
<button onclick="setFunction()" type="button">set!</button>
<br />
<div id="demo">
0</div>
<script>
var add = (function () {
var counter = 0;
return {
get:function(){ return counter += 1},
set:function(x){ counter = x; return counter;}
}
})();
function myFunction(){
document.getElementById("demo").innerHTML = add.get();
}
function setFunction(){
document.getElementById("demo").innerHTML = add.set(5);
}
</script></div>
</div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-23028014387004056602015-01-07T10:45:00.000-08:002015-01-07T10:45:01.908-08:00How to make triangles or arrows using css border width<div dir="ltr" style="text-align: left;" trbidi="on">
<style>
h2.entry-title {
position: relative;
}
h2.entry-title:after {
content: "";
border-width: 15px;
position: absolute;
left: 179px;
top: -4px;
border-style: solid;
border-left-width: 0;
border-right: 15px solid green;
border-left: 15px solid yellow;
}
h2.left-triangle:after {
border:15px solid transparent;
border-right: 15px solid green;
}
h2.right-triangle:after {
border:15px solid transparent;
border-left: 15px solid green;
}
h2.top-triangle:after {
border:15px solid transparent;
border-bottom: 15px solid green;
}
h2.down-triangle:after {
border:15px solid transparent;
border-top: 15px solid green;
}
</style>
<br />
<blockquote>
h2.entry-title {
position: relative;
}
</blockquote>
<blockquote>
h2.entry-title:after {
content: "";
border-width: 15px;
position: absolute;
left: 179px;
top: -4px;
border-style: solid;
border-left-width: 0;
border-right: 15px solid green;
border-left: 15px solid yellow;
}
</blockquote>
<h2 class="entry-title entry-title">
with all borders </h2>
<br /><br />
<blockquote>
h2.left-triangle:after {
border:15px solid transparent;
border-right: 15px solid green;
}</blockquote>
<h2 class="entry-title left-triangle">
left triangle</h2>
<br /><br />
<blockquote>
h2.right-triangle:after {
border:15px solid transparent;
border-left: 15px solid green;
}</blockquote>
<h2 class="entry-title right-triangle">
right triangle </h2>
<br /><br />
<blockquote>
h2.top-triangle:after {
border:15px solid transparent;
border-bottom: 15px solid green;
}</blockquote>
<h2 class="entry-title top-triangle">
top triangle </h2>
<br /><br />
<blockquote>
h2.down-triangle:after {
border:15px solid transparent;
border-top: 15px solid green;
}</blockquote>
<h2 class="entry-title down-triangle">
down triangle</h2>
</div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-77972485626463567672014-09-01T11:59:00.001-07:002014-09-02T22:28:43.970-07:00Barchart using css and angularjs<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="separator" style="clear: both; text-align: center;">
</div>
Recently, I came across situation like generating a dynamic graph shown in screen-shot below. I have searched a lot for any javascript api to generate graph/chart like google chart, chartJs etc. But failed. Later decided to develop it with myself using css and angularJs, here is the github code, fork it and contribute :) happy coding!! ( <a href="https://github.com/munawer-t/bar-chart-using-pure-css3-and-angularjs">https://github.com/munawer-t/bar-chart-using-pure-css3-and-angularjs</a> )<br />
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/munawer-t/bar-chart-using-pure-css3-and-angularjs/master/screenshots/two-column.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://raw.githubusercontent.com/munawer-t/bar-chart-using-pure-css3-and-angularjs/master/screenshots/two-column.png" width="640" /></a></div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://raw.githubusercontent.com/munawer-t/bar-chart-using-pure-css3-and-angularjs/master/screenshots/four-column.png.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="241" src="https://raw.githubusercontent.com/munawer-t/bar-chart-using-pure-css3-and-angularjs/master/screenshots/four-column.png.png" width="640" /></a></div>
<br /></div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-22070102670408482012013-07-12T02:01:00.001-07:002013-11-05T21:59:59.751-08:00How turn on sql_mode to stric in mysql<div dir="ltr" style="text-align: left;" trbidi="on">
1) Edit my.cnf<br />
For Debian :<br />
located at /etc/mysql/my.cnf , add to my.cnf<br />
<blockquote class="tr_bq">
[mysqld]<br />
sql_mode="STRICT_ALL_TABLES"</blockquote>
If you want strict mode with full group by use this <br />
<blockquote class="tr_bq">
[mysqld]<br />sql_mode="STRICT_ALL_TABLES,ONLY_FULL_GROUP_BY" </blockquote>
<br />
2) Restart mysql<br />
<br />
3) Check it by running this query <br />
<blockquote class="tr_bq">
SELECT @@GLOBAL.sql_mode;</blockquote>
Note: If you want turn off strict mode on run time just run this query <br />
<blockquote class="tr_bq">
SET @@global.sql_mode='STRICT_ALL_TABLES'<br />OR<br />SET @@session.sql_mode='STRICT_ALL_TABLES'<br /></blockquote>
Thats it.<br /><br />
<br />
<br /></div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-48100806542066539562013-03-27T00:31:00.000-07:002013-03-27T00:31:55.937-07:00Working with GhostScript : Convert PDF to images using ghostscript<div dir="ltr" style="text-align: left;" trbidi="on">
<br />
Ghostscript is an interpreter for PostScript™ and (PDF) files, lets see how we can use it convert PDF to images.<br />
<br />
-Install Ghostscript (I am using ubunutu, so I can perform)<br />
<blockquote>
<b>sudo apt-get install ghostscript</b></blockquote>
<br />
- run these script via console to make images from pdf <br />
<blockquote class="tr_bq">
<b><br /></b>
<b>gs -dUseCropBox -dTextAlphaBits=4 -dGraphicsAlphaBits=4 -dAdjustWidth=0 -dNOPROMPT -sDEVICE=jpeg -dSAFER -dBATCH -dNOPAUSE -r140 -dJPEGQ=80 -dFirstPage='1' -dLastPage='8' -sOutputFile=/tmp/output/image-%d.jpg /tmp/downloads/sample.pdf</b></blockquote>
<br />
You can see output like this : <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7YhUdeLT8Zj9xMei4upEdjqmgMoYhbeNXZv_37KfFde428nGiQ1BvzvV-SxGURea6z9tF3MKwE1bR3m3AEpBVXla8qTBG_e7rudwqKyZW_4Xavn4Bf0hT_JmD9Ijl-Sf61Ip_0HeVrTW/s1600/Selection_006.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="262" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM7YhUdeLT8Zj9xMei4upEdjqmgMoYhbeNXZv_37KfFde428nGiQ1BvzvV-SxGURea6z9tF3MKwE1bR3m3AEpBVXla8qTBG_e7rudwqKyZW_4Xavn4Bf0hT_JmD9Ijl-Sf61Ip_0HeVrTW/s1600/Selection_006.png" width="320" /></a></div>
<br />
and your output folders will list your images :<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMa9snsNPc_P-cBbVieFgiSVPL1pYmnq7cxYK_hfjviEc-5kaLcjzwucCR4FDqulRhDB4nFuXp9QGt5GHtuIDx5VEAnvcRiM4C9iDYCED7GrkP1bdhPVoP_alenia_JzYya2eZQCph_sQT/s1600/Selection_007.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="193" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMa9snsNPc_P-cBbVieFgiSVPL1pYmnq7cxYK_hfjviEc-5kaLcjzwucCR4FDqulRhDB4nFuXp9QGt5GHtuIDx5VEAnvcRiM4C9iDYCED7GrkP1bdhPVoP_alenia_JzYya2eZQCph_sQT/s1600/Selection_007.png" width="320" /></a></div>
<br />
<br />
<br />
FYI - Params :<br />
-dFirstPage and -dLastPage specifies page limits , which is optional<br />
-sOutputFile [output file] [input file]<br />
<br />
<br />
<br />
<br />
<div style="text-align: center;">
<output file="">:)</output></div>
</div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-79580679709907557512013-03-06T02:22:00.000-08:002013-03-09T07:15:50.313-08:00How to add force quit option in ubutnu 12.04 <div dir="ltr" style="text-align: left;" trbidi="on">
Just got updated my ubuntu version to 12.04 , One of my favorite tool was missing there -Force Quit .<br />
Followed these step and I restored it there in panel <br />
<br />
1- create a file named 'Force_Quit.desktop' and contents should be like this <br />
<br />
[Desktop Entry]<br />
Name=Force Quit<br />
Comment=Force Kill an Unresponsive Running Application or Window<br />
Exec=xkill<br />
Icon=gnome-panel-force-quit<br />
Terminal=false<br />
Type=Application<br />
StartupNotify=true<br />
<br />
2- Place it applications folder , you can open application folder directly using these command<br />
nautilus ~/.local/share/applications/<br />
3- Drag and drop 'Force_Quit.desktop' file in to Unity launcher.<br />
<br />
Thats it !<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_b9q9dn9m9R8djWl2Tsn2v6lwdh5R20V629KoCliy8Azgg9DQoOJRf5p-Ntmr1UuKQCe3aSwXpY1mII_6Rf6dni99NijjY5QkzqEJAN-EGWQx_3aYX-78i-gXrxoCy4jeM-koXL7XNsaB/s1600/Selection_003.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /><br /><br /><br /><img border="0" height="150" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_b9q9dn9m9R8djWl2Tsn2v6lwdh5R20V629KoCliy8Azgg9DQoOJRf5p-Ntmr1UuKQCe3aSwXpY1mII_6Rf6dni99NijjY5QkzqEJAN-EGWQx_3aYX-78i-gXrxoCy4jeM-koXL7XNsaB/s1600/Selection_003.png" width="320" /></a></div>
<br />
<br /></div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-50267848994947445492012-05-08T04:13:00.000-07:002013-05-07T00:30:23.843-07:00How to check if a controller exists using Zend Framework<div dir="ltr" style="text-align: left;" trbidi="on">
Have you ever wondered how to check if a controller/action exist in zend FM from any side of app ? Here is the code <br />
<br />
<blockquote class="tr_bq">
$front = Zend_Controller_Front::getInstance();<br />
$dispatcher = $front->getDispatcher();<br />
<br />
$test = new Zend_Controller_Request_Http();<br />
$test->setParams(array(<br />
'action' => 'index',<br />
'controller' => 'content',<br />
<br />
)<br />
);<br />
<br />
if($dispatcher->isDispatchable($test)) {<br />
echo "yes-its a controller";<br />
//$this->_forward('about-us', 'content'); // Do whatever you want<br />
} else {<br />
echo "NO- its not a Controller";<br />
}</blockquote>
<br /></div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-34395590514649244682012-03-20T23:23:00.002-07:002012-03-20T23:27:03.419-07:00cool js beautifierHi,<br /><br />Just fond a good js beautifier at <a href="http://jsbeautifier.org/">http://jsbeautifier.org/</a> , you can use it for extracting minified js too ,<br />NjoyMuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-86462887265084734102012-02-15T23:04:00.000-08:002012-02-15T23:07:18.344-08:00facebook heatmapHere is how facebook heat-map look like ..<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://5.mshcdn.com/wp-content/gallery/social-media-profiles-eye-tracking-study/facebook1.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 840px; height: 576px;" src="http://5.mshcdn.com/wp-content/gallery/social-media-profiles-eye-tracking-study/facebook1.jpg" alt="" border="0" /></a><br /><br />more on -<br /><br /><a href="http://mashable.com/2011/11/30/social-profile-eye-tracking/">http://mashable.com/2011/11/30/social-profile-eye-tracking/</a>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-69978219265704391262012-02-13T22:07:00.000-08:002012-02-15T23:03:49.189-08:00WordPress Plugins that Boost up your BlogSearch Regex<br />Redirection<br />Bing 404<br />WordPress SEO<br />Hyper Cache<br />FB Open Graph<br />404 Email Notifier<br />SlideShare<br />Smart YouTube<br />YARRP<br />WP Optimize<br />WP-DBManager<br />Debug Queries<br />Auto Post Thumbnail<br />Regenerate Thumbnails<br />Google XML Sitemaps<br />XML Video Sitemap<br />Date in a Nice Tone<br /><br />.. more you can find on -- <a href="http://www.labnol.org/software/must-have-wordpress-plugins/14034/">http://www.labnol.org/software/must-have-wordpress-plugins/14034/</a>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-53202618002699320772012-02-03T01:19:00.000-08:002012-02-03T01:21:05.780-08:00Add custom domains to Your openshift account<p><br />Hurray !!<br /><br /><br />It is now possible to use rhc-ctl-app -a appname -c add-alias --alias <a href="http://www.mydomain.com/" title="www.mydomain.com">www.mydomain.com</a><br /></p> <p>and then in your DNS management for mydomain.com you can add a cname to point <a href="http://www.mydomain.com/" title="www.mydomain.com">www.mydomain.com</a> to app-namespace.rhcloud.com.</p><p><br /></p><p><br /><br /></p>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-7246125194929566142012-01-11T08:30:00.000-08:002012-01-11T08:38:21.869-08:00A cool audio player for ubuntu "Clementine"Hey Ubuntu lovers ,<br /><br /><div>Just got my attention on one cool audio player "<span style="background-color: rgb(0, 0, 0); color: rgb(0, 82, 163); font-family: Verdana, sans-serif; font-size: 17px; font-weight: bold; line-height: 20px; ">Clementine</span>" which can be installed on ubuntu .<br />Check it out , no more descriptions ;)<br />command :<br /><span style="color: red; background-color: rgb(0, 0, 0); font-family: 'Courier New', Courier, Verdana, sans-serif; font-size: 13px; line-height: 1.385em; ">sudo apt-get install clementine</span><br /><br /></div><div><br /></div><div>Enjoy .<br /><br />Cheers ...<br /><br />Credits : <a href="http://www.jobinjoseph.in/2011/11/best-audio-player-for-ubuntu-11041010.html">http://www.jobinjoseph.in/2011/11/best-audio-player-for-ubuntu-11041010.html</a></div>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-25958944469173860792011-12-15T01:51:00.000-08:002011-12-15T04:48:09.907-08:00Hey , now you can run PHP from Google apps Engine (GAE)Now you can run PHP on GAE using <a href="http://www.caucho.com/resin-3.0/quercus/">Quercus</a><br />1) Register a <a rel="nofollow" href="http://appengine.google.com/">free account</a>.<br />2) <a href="http://phponair.appspot.com/download/phponair.zip">Download this file</a> to your computer.<br />3) Edit application XML tag in the file war\WEB-INF\appengine-web.xml to the name of the application you have registered.<br />4) Finally <a href="http://code.google.com/appengine/docs/java/gettingstarted/uploading.html">upload your application</a>. I downloaded Google App Engine <strong>SDK for Java</strong> and use the following command in windows.<br />appcfg.cmd update C:\projects\phpwithjava\war<br /><br />To see this in action just visit:<br /><br /><a href="http://phponair.appspot.com/my.php">http://phponair.appspot.com/my.php</a>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-14276836412961104042011-08-11T22:31:00.000-07:002011-08-11T22:36:46.104-07:00How to save MySQL query results into a text or CSV fileBelow query writes resultsset to .txt file :-
<br />
<br /><blockquote>SELECT order_id,product_name,qty
<br />FROM orders
<br />INTO OUTFILE '/tmp/orders.txt'
<br /></blockquote>
<br />
<br />
<br />To make csv , try this one :-
<br />
<br /><blockquote>SELECT order_id,product_name,qty
<br />FROM orders
<br />INTO OUTFILE '/tmp/orders.csv'
<br />FIELDS TERMINATED BY ','
<br />ENCLOSED BY '"'
<br />LINES TERMINATED BY '\n' ;
<br />
<br /></blockquote>
<br />
<br />phewww...
<br />MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-72132027854645925242011-05-17T02:18:00.000-07:002013-03-18T22:50:00.959-07:00How to enable secure http (https) in your localmachine<div dir="ltr" style="text-align: left;" trbidi="on">
To enable https in your local machine is not a tough game , its simple .<br />
I have performed only few steps in my ubuntu ,just check it out<br />
<br />
<ul>
<li>openssl genrsa -out yourX.key 1024</li>
</ul>
<ul>
<li>openssl req -new -key yourX.key -out yourX.csr</li>
</ul>
<ul>
<li>openssl req -new -key yourX.key -x509 -out yourX.crt -days 365</li>
</ul>
<br />
Run these 3 commands inside a folder , 'yourX' should be replaced with your application name .These commands will generate 3 files , here they are <span style="font-weight: bold;">yourX.key</span>,<span style="font-weight: bold;">yourX.csr</span>,<span style="font-weight: bold;">yourX.crt</span> .<br />
<br />
After finishing the above task add virtualhost within your httpd.conf (or httpd-vhosts.conf on some systems)<br />
<br />
<blockquote>
<br />
<VirtualHost my.localhost:443><br />
DocumentRoot "/PATH TO YOUR APP/"<br />
ServerName my.localhost<br />
SetEnv APPSTAGE development<br />
<Directory /PATH TO YOUR APP/><br />
DirectoryIndex index.php<br />
AllowOverride All<br />
Order allow,deny<br />
Allow from all<br />
</Directory><br />
SSLEngine On<br />
SSLCertificateFile /PATH TO CRT FILE/yourX.crt<br />
SSLCertificateKeyFile /PATH TO KEY FILE/yourX.key<br />
</VirtualHost></blockquote>
<br />*NOTE: sometimes you may get error like this "<span style="color: red;">Invalid command 'SSLEngine', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed</span>"<br />In that case please make sure ssl is enabled ,please run '<span style="color: #38761d;">a2enmod ssl</span>' to get it working.<br /><br /><br />
<br />
Hope it will help you guys :)<br />
<br />
-cheers</div>
MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-64391620313894336632010-05-19T03:36:00.001-07:002010-05-19T03:37:14.043-07:00How to Add the Facebook Like button in blogger<p>1. Login to your Blogger Account and go to <strong>Layout</strong> > <strong>Edit HTML</strong> and click on the check box which says “<strong>Expand Widget Templates</strong>” </p><p>2. Look for <strong><em><data:post.body/></em></strong> and immediately after that place the following code.</p><pre class="code"><span style="color: rgb(255, 0, 0);"><b:if cond='data:blog.pageType == &quot;item&quot;'></span><br /><iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.url + &quot;&amp;layout=standard&amp;show_faces=false&amp;width=100&amp;action=<span style="color: rgb(0, 128, 64);"><strong>like</strong></span>&amp;font=arial&amp;colorscheme=light&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:40px;'/><br /><span style="color: rgb(255, 0, 0);"></b:if></span></pre><p>This code will show the Like Button on Post pages only. <strong><em>If you want to display it everywhere, then remove the two lines of code in red.</em></strong></p><p>3. Save the template and you're done<br /><br />Any queries? ..comment here .<br /></p>MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-14345572572404049862010-03-08T21:07:00.000-08:002010-03-08T21:08:38.365-08:00wow posterousStarted a <a href="http://posterous.com/">posterous </a>account , which has an option to link twitter,facebook,blogger and almost everything .One post to posterous goes everywhere else on the web .One of the main advantage is we can post it via mail, that means even through mobile too . I have made an account here <a href="http://photos.munawer.in/">http://photos.munawer.in/</a> for sharing photos on the go through mobileMuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0tag:blogger.com,1999:blog-7558501519295354910.post-4341094232868408662009-12-07T00:51:00.000-08:002009-12-07T01:07:25.509-08:00Airtel NOP sucks..hey guys,<br /><br />i have started this blog to share my experience with some technologies..MuNNahttp://www.blogger.com/profile/04298383679583958577noreply@blogger.com0