Recently I had a requirement to install SSL certificate on Shared server. Although I worked with SSL installation on IIS over dedicated servers couple of time but this was a bit different experience to install it on shared hosting and that too using cPanel.
Continue reading
Author: Deepak Sihag
Resize an image without crop using PHP
Recently in one of project I faced a requirement to display image in a developed paint tool of fixed dimensions canvas. It sounds fine as long as two points are not considered:
1. Image size can be anything because it is to be uploaded by user
2. Image should not crop and just fit in canvas without any scroll
Continue reading
How to open multiple instance of Skype at same time
Ever faced a situation when your team member is on leave and you have to manage communication with your clients on Skype as well address support requests on his Skype? And you hate it when not being able to open second instance of it.
Well multitasking is good but a pain when need to be done at different places or desk making it hard. But you can open another instance of Skype too using Command prompt.
Here is magic command to make it easy to open and use multiple Skype ids on same laptop at same time.
[code]”C:\Program Files\Skype\Phone\Skype.exe” /secondary[/code]
Hope this helps !!
How to retrive Plesk Panel Password
Forgot your password of Plesk Panel?
No worries, if you have remote access to server it is quite easy to view your password using follow below steps:
1. Open command prompt
2. Enter: ‘%plesk_dir%\bin\admin.exe –show-password’
Hide Download path of File: WordPress Plugin
You might have also worried at some point of time regarding security of your website/blog ever. It happen sometimes that we implement major security measured on our website but still some or other way hacker or spammers get to hitch inside. Continue reading
Backup MYSQL database using PHP
Sometime we need to backup MYSQL database without access to PHPMYAdmin in scenarios when need to do this through a scheduled job. Here is a code snippet I found to backup database using PHP.
This will also allow to backup complete database or single table.
{code}
backup_tables(‘localhost’,’DB_USER_NAME’,’DB_PASSWORD’,’DB_Name’);
/* backup the db OR just a table */
function backup_tables($host,$user,$pass,$name,$tables = ‘*’)
{
$link = mysql_connect($host,$user,$pass);
mysql_select_db($name,$link);
//get all of the tables
if($tables == ‘*’)
{
$tables = array();
$result = mysql_query(‘SHOW TABLES’);
while($row = mysql_fetch_row($result))
{
$tables[] = $row[0];
}
}
else
{
$tables = is_array($tables) ? $tables : explode(‘,’,$tables);
}
//cycle through
foreach($tables as $table)
{
$result = mysql_query(‘SELECT * FROM ‘.$table);
$num_fields = mysql_num_fields($result);
$return.= ‘DROP TABLE ‘.$table.’;’;
$row2 = mysql_fetch_row(mysql_query(‘SHOW CREATE TABLE ‘.$table));
$return.= “\n\n”.$row2[1].”;\n\n”;
for ($i = 0; $i < $num_fields; $i++) { while($row = mysql_fetch_row($result)) { $return.= 'INSERT INTO '.$table.' VALUES('; for($j=0; $j<$num_fields; $j++) { $row[$j] = addslashes($row[$j]); $row[$j] = ereg_replace("\n","\\n",$row[$j]); if (isset($row[$j])) { $return.= '"'.$row[$j].'"' ; } else { $return.= '""'; } if ($j<($num_fields-1)) { $return.= ','; } } $return.= ");\n"; } } $return.="\n\n\n"; } //save file $handle = fopen('db-backup-'.time().'-'.(md5(implode(',',$tables))).'.sql','w+'); fwrite($handle,$return); fclose($handle); } {/code}
How to show post from Blogger on your website
I was recently working on a website in Open source and blog of that site was being managed on Blogger.com, in general case when blog is self hosted on same domain or is in WordPress is become quite easy to show the post on the website. Here also the same requirement was faced where I had to show the blog post on website but from blogger.com
Initially is sounded something quite complex due to my limited exposure with blogger but once I checked the post structure it become quite easy to achieve this. I did this using MagpieRSS, a free to use open source project for converting various types of RSS feed. I support Blogger too. Step by step process to achieve this is as below:
Step 1: Download Magpie RSS
Step 2: Extract downloaded files in a directory named magpierss in ROOT of your project.
Step 3: Open PHP page where we need to display list of post from blogger and paste below code, I assume you :
{code}
{/code}
Now we have to display post data fetched from blogger:
a. If you want to display POST TITLE along with DESCRIPTION from blogger on your website, use below code:
{code}
//display latest blog content:
$item = $rss->items[0];
$content = $item[‘atom_content’];
echo “
Latest Blog Entry:
$content
\n”;
?>
{/code}
b. If you want to display POST TITLE ONLY from blogger on your website, use below code:
{code}
//display links recent blog entries:
echo "
- Latest blog additions:\n”;
- $title $created
foreach ($rss->items as $item) {
$href = $item[‘link’];
$title = $item[‘title’];
$created = $item[‘created’];
echo “
\n”;
}
echo “
“;
?>
{/code}
c. b. If you want to display ‘N’ number of POST TITLE from blogger on your website, a small change in above code is required and it will be as below:
{code}
echo "
Latest blog additions
- “;
- $title
define(‘MAGPIE_DIR’, ‘magpierss/’);
require_once(MAGPIE_DIR.’rss_fetch.inc’);
$num_items = 7; // Number of post we wish to display
$rss = fetch_rss( ‘http://yourblogname.blogspot.com/atom.xml’ );
$items = array_slice($rss->items, 0, $num_items);
foreach ($items as $item) {
$href = $item[‘link’];
$title = $item[‘title’];
echo “
\n”;
}
echo “
“;
?>
{/code}
JQuery and WordPress
If you are trying to add your own jQuery code to WordPress, and have had the error “$ is not a function” show up on Firebug, here is the fix:
Convert all dollar signs ($) to ‘jQuery’
The dollar sign is reserved in WordPress for the Prototype library, which is why it errors out. For example, instead of:
$().ready(function() {
$(“#select_me”).show();
});
Change it to:
jQuery().ready(function() {
jQuery(“#select_me”).show();
});
MX record settings for using Google apps
Since I starting using Google app, I feel traditional webmail not much efficient in terms of usage. Yes I do admit I have become a huge fan of Google apps and for same reason I have suggested and implemented it for most of my clients.
There are several reasons to use Google apps to enhance you business:
– No more need to worry about Microsoft Outlook, office license etc.
– No need of any additional backups of server as you can surely rely on Google for that
– Seamless integration of users for an organization/business
– Overall it very easy to use because of it interface, which most internet users are already aware of being a Gmail user
The only thing I mostly need to search every time I configure is MX records for using Google apps, to make it more handy and easy accessible (also for your help, if required) I thought to add it on blog and avoid searching each time:
We need to update MX records as below:
Priority Mail Server
1 ASPMX.L.GOOGLE.COM.
5 ALT1.ASPMX.L.GOOGLE.COM.
5 ALT2.ASPMX.L.GOOGLE.COM.
10 ASPMX2.GOOGLEMAIL.COM.
10 ASPMX3.GOOGLEMAIL.COM.
Dont forget to select ‘Remote Mail Exchanger’ to avoid routing issues
Commands for Command prompt
With every new version of windows interface is enhanced and it becomes more easy for user to use the system but still hardcore programmers wish to use the command prompt to for programs and other feature. Command prompt is an extensive useful utility for programmers and advanced users. It is a non-graphical interface that allows you to interact with your operating system. At the command prompt, you enter commands by typing their names followed by options and arguments. Remember the last time you wish to restart IIS and forgot the command : ) No issue, here is a list of most frequent user commands for command prompt for advanced users:
Accessibility Controls = access.cpl
Accessibility Wizard = accwiz
Add Hardware Wizard = hdwwiz.cpl
Add/Remove Programs = appwiz.cpl
Administrative Tools = control admintools
Adobe Acrobat ( if installed ) = acrobat
Adobe Distiller ( if installed ) = acrodist
Adobe ImageReady ( if installed ) = imageready
Adobe Photoshop ( if installed ) = photoshop
Automatic Updates = wuaucpl.cpl
Basic Media Player = mplay32
Bluetooth Transfer Wizard = fsquirt
Calculator = calc
Ccleaner ( if installed ) = ccleaner
C: Drive = c:
Certificate Manager = cdrtmgr.msc
Character Map = charmap
Check Disk Utility = chkdsk
Clipboard Viewer = clipbrd
Command Prompt = cmd
Command Prompt = command
Component Services = dcomcnfg
Computer Management = compmgmt.msc
Compare Files = comp
Control Panel = control
Create a shared folder Wizard = shrpubw
Date and Time Properties = timedate.cpl
DDE Shares = ddeshare
Device Manager = devmgmt.msc
Direct X Control Panel ( if installed ) = directx.cpl
Direct X Troubleshooter = dxdiag
Disk Cleanup Utility = cleanmgr
Disk Defragment = dfrg.msc
Disk Partition Manager = diskmgmt.msc
Display Properties = control desktop
Display Properties = desk.cpl
Display Properties (w/Appearance Tab Preselected ) = control color
Dr. Watson System Troubleshooting Utility = drwtsn32
Driver Verifier Utility = verifier
Ethereal ( if installed ) = ethereal
Event Viewer = eventvwr.msc
Files and Settings Transfer Tool = migwiz
File Signature Verification Tool = sigverif
Findfast = findfast.cpl
Firefox = firefox
Folders Properties = control folders
Fonts = fonts
Fonts Folder = fonts
Free Cell Card Game = freecell
Game Controllers = joy.cpl
Group Policy Editor ( xp pro ) = gpedit.msc
Hearts Card Game = mshearts
Help and Support = helpctr
Hyperterminal = hypertrm
Hotline Client = hotlineclient
Iexpress Wizard = iexpress
Indexing Service = ciadv.msc
Internet Connection Wizard = icwonn1
Internet Properties = inetcpl.cpl
Internet Setup Wizard = inetwiz
IP Configuration (Display Connection Configuration) = ipconfig /all
IP Configuration (Display DNS Cache Contents) = ipconfig /displaydns
IP Configuration (Delete DNS Cache Contents) = ipconfig /flushdns
IP Configuration (Release All Connections) = ipconfig /release
IP Configuration (Renew All Connections) = ipconfig /renew
IP Configuration (Refreshes DHCP & Re-Registers DNS) = ipconfig /registerdns
IP Configuration (Display DHCP Class ID) = ipconfig /showclassid
IP Configuration (Modifies DHCP Class ID) = ipconfig /setclassid
Java Control Panel ( if installed ) = jpicpl32.cpl
Java Control Panel ( if installed ) = javaws
Keyboard Properties = control keyboard
Local Security Settings = secpol.msc
Local Users and Groups = lusrmgr.msc
Logs You Out of Windows = logoff
Malicious Software Removal Tool = mrt
Microsoft Access ( if installed ) = access.cpl
Microsoft Chat = winchat
Microsoft Excel ( if installed ) = excel
Microsoft Diskpart = diskpart
Microsoft Frontpage ( if installed ) = frontpg
Microsoft Movie Maker = moviemk
Microsoft Management Console = mmc
Microsoft Narrator = narrator
Microsoft Paint = mspaint
Microsoft Powerpoint = powerpnt
Microsoft Word ( if installed ) = winword
Microsoft Syncronization Tool = mobsync
Minesweeper Game = winmine
Mouse Properties = control mouse
Mouse Properties = main.cpl
MS-Dos Editor = edit
MS-Dos FTP = ftp
Nero ( if installed ) = nero
Netmeeting = conf
Network Connections = control netconnections
Network Connections = ncpa.cpl
Network Setup Wizard = netsetup.cpl
Notepad = notepad
Nview Desktop Manager ( if installed ) = nvtuicpl.cpl
Object Packager = packager
ODBC Data Source Administrator = odbccp32
ODBC Data Source Administrator = odbccp32.cpl
On Screen Keyboard = osk
Opens AC3 Filter ( if installed ) = ac3filter.cpl
Outlook Express = msimn
Paint = pbrush
Password Properties = password.cpl
Performance Monitor = perfmon.msc
Performance Monitor = perfmon
Phone and Modem Options = telephon.cpl
Phone Dialer = dialer
Pinball Game = pinball
Power Configuration = powercfg.cpl
Printers and Faxes = control printers
Printers Folder = printers
Private Characters Editor = eudcedit
Quicktime ( if installed ) = quicktime.cpl
Quicktime Player ( if installed ) = quicktimeplayer
Real Player ( if installed ) = realplay
Regional Settings = intl.cpl
Registry Editor = regedit
Registry Editor = regedit32
Remote Access Phonebook = rasphone
Remote Desktop = mstsc
Removable Storage = ntmsmgr.msc
Removable Storage Operator Requests = ntmsoprq.msc
Resultant Set of Policy ( xp pro ) = rsop.msc
Scanners and Cameras = sticpl.cpl
Scheduled Tasks = control schedtasks
Security Center = wscui.cpl
Services = services.msc
Shared Folders = fsmgmt.msc
Sharing Session = rtcshare
Shuts Down Windows = shutdown
Sounds Recorder = sndrec32
Sounds and Audio = mmsys.cpl
Spider Solitare Card Game = spider
SQL Client Configuration = clicongf
System Configuration Editor = sysedit
System Configuration Utility = msconfig
System File Checker Utility ( Scan Immediately ) = sfc /scannow
System File Checker Utility ( Scan Once At Next Boot ) = sfc /scanonce
System File Checker Utility ( Scan On Every Boot ) = sfc /scanboot
System File Checker Utility ( Return to Default Settings) = sfc /revert
System File Checker Utility ( Purge File Cache ) = sfc /purgecache
System File Checker Utility ( Set Cache Size to Size x ) = sfc /cachesize=x
System Information = msinfo32
System Properties = sysdm.cpl
Task Manager = taskmgr
TCP Tester = tcptest
Telnet Client = telnet
Tweak UI ( if installed ) = tweakui
User Account Management = nusrmgr.cpl
Utility Manager = utilman
Volume Serial Number for C: = label
Volume Control = sndvol32
Windows Address Book = wab
Windows Address Book Import Utility = wabmig
Windows Backup Utility ( if installed ) = ntbackup
Windows Explorer = explorer
Windows Firewall = firewall.cpl
Windows Installer Details = msiexec
Windows Magnifier = magnify
Windows Management Infrastructure = wmimgmt.msc
Windows Media Player = wmplayer
Windows Messenger = msnsgs
Windows Picture Import Wizard (Need camera connected) = wiaacmgr
Windows System Security Tool = syskey
Windows Script host settings = wscript
Widnows Update Launches = wupdmgr
Windows Version ( shows your windows version ) = winver
Windows XP Tour Wizard = tourstart
Wordpad = write
Zoom Utility = igfxzoom