Posts

Showing posts from November, 2015

Switching from Notepad++ FTP to Visual Studio Code FTP

Image
Notepad++ is good but Visual Studio is better in suggesting code and organizing it. I mostly code PHP and never used Visual Web Developer. However, I have used Visual C# to develop Performance Maintainer and I was impressed by it. Now, Microsoft has VS Code to support all forms of coding. Late bloomer yet powerful enough to  keep up with current trend. Speaking of trend how did VS Code got username 'code' on twitter . Did no one register such simple username? Anyways, I always use ftp to maintain my websites. So, here is a tutorial to install VS Code and setup FTP connection in VS Code.

Download VS Code from code.visualstudio.com and install itCreate folder Code/Projects/projectfolder in My Document of OneDrive. (optional)Open VS Code and open your projectfolderPress F1 and type >ext install This will take a whileSelect ftp-sync extension to install.Once installed restart VS Code.Press F1 and type >ftp-sync:init This will open a file. Fill in your ftp credential in json…

Shrink/Purge/Delete ibdata1 file in MySQL

While dealing with large data, I realised ibdata file was rapidly increasing. I did some research and found out ibdata1 not shrinking is a particularly annoying feature of MySQL. The ibdata1 file can´t actually be shrunk unless you delete all databases, remove the files and reload a dump.

Here are the steps for doing so:

Do a mysqldump of all databases, procedures, triggers etc except the mysql and performance_schema databases mysqldump -u [username] -p[root_password] [database_name] > dumpfilename.sql Drop all databases except the above 2 databases (in MySQL console) DROP DATABASE [database_name] Stop mysql sudo service mysql stop sudo service mariadb stop Delete ibdata1 and ib_log files sudo rm /var/lib/mysql/ibdata1 sudo rm /var/lib/mysql/ib_logfile Start mysql sudo service mysql start sudo service mariadb start Restore from dump (in MySQL console) create database [database_name] mysql -u [username]-p[root_password] [database_name] < dumpfilename.sql

Thats it!

Install Webmin in Ubuntu

Image
Webmin is not preconfigured in Ubuntu apt-get repository and we don't want to go through the hassle of dpkg deb files or compiling the source code.So lets begin by editing repository sources
Edit sources file /etc/apt/sources.list sudo vim /etc/apt/sources.list Add these lines to it and save the file deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib Add the Webmin GPG key to make apt-get to trust repository wget -q http://www.webmin.com/jcameron-key.asc -O- | sudo apt-key add - Update the sources sudo apt-get update Now simply install webmin sudo apt-get install webmin To access webmin, remember to port-forward 10000 port number. Moreover, webmin runs on HTTPS protocol. Hence, connect like the link below. change example.com to your domain name https://example.com:10000 To learn more about webmin please visit: http://doxfer.webmin.com/Webmin/Main_Page
Thats it! If you face any prob…

jTable to edit and process MySQL table using CodeIgnitor : Part 2

Image
Previously in Part 1, we generated table using Datatables. However, part 1 tutorial was only to display data from database. To create, update and delete rows, it's better to use jTable as its freely available. Just follow the simple steps below: Download jTable PHP Sample: http://jtable.org/downloads/jTable-PHP-Samples.zipUnzip the zip and place the content of Codes folder in root web folder. Don't worry if you already have codeigniter files.Personally. I feel dealing with jTable code is very tricky. Therefore, I would initially test jTable functionality in Core PHP by updating MySQL with sql file in unzipped Database folder. Start by converting all uppercase to lowercase in JavaScript and links. Then connect to database by updating PersonActions.php and PersonActionsPagedSorted.php<link href="scripts/jtable/themes/lightcolor/blue/jtable.css" rel="stylesheet" type="text/css" /> <script src="scripts/jtable/jquery.jtable.js" type…