Practical Web Programming

Monday, November 18, 2013

How to Connect to a Server via SSH

ssh -p 800

where: = is the server
user = the user defined in that server
800 = connection port to that server

Thursday, November 14, 2013

How to scp (Secure Copy) File from a Server to Local Machine

The console command below will copy the file from the remote server to the desktop using the same filename.

scp root@remote_server:/var/lib/backup/server_backup.gz ~/Desktop

root = the user to that server
remote_server = host entry in you ~/.ssh/config file

Wednesday, November 06, 2013

How to Load Your Own jQuery Library When CDN is Down

It's always a good practice to load libraries like jQuery your web applications from CDN (Content Delivery Network). But sometimes (though rare) CDN goes down. The code below makes that you have jQuery loaded in events like this.

<script type="text/javascript" src=""></script>
<script type="text/javascript">if (typeof jQuery == 'undefined') {  document.write(unescape("%3Cscript src='Scripts/jquery.2.0.0.min.js' type='text/javascript'%3E%3C/script%3E"));

Recent Post