Equilateral Triangle using SCSS

Simple Demo to create an Equilateral Triangle of Selective Size and Color
HTML<div class="triangle"> </div> SCSS$triangle_size: 500px; $triangle_color: tomato; $triunit: $triangle_size / 2; $transb: $triunit + ($triunit/4); .triangle { width: 0; height: 0; border-left: $transb solid transparent; border-right: $transb solid transparent; border-bottom: $triangle_size solid $triangle_color; } Try the example:

Setup NETBIOS on Ubuntu

It is nice to access a computer with knowing its IP address. Windows broadcast NETBIOS on port 139 to access a computer by its name. Similar can be applied on ubuntu. So here we go:
Edit /etc/nsswitch.conf and change the line: hosts: files dns to this: hosts: files wins dnsInstall winbind sudo apt-get install winbind Thats it!

Switching from Notepad++ FTP to Visual Studio Code FTP

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 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

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 sarge contrib deb sarge contrib Add the Webmin GPG key to make apt-get to trust repository wget -q -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 to your domain name To learn more about webmin please visit:
Thats it! If you face any prob…

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

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: 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…

DataTables to display MySQL table using CodeIgnitor : Part 1

This blog is 2 part tutorial to help you to display MySQL data  using Codeignitor. Previously, before MVC, I use to write loops and pagination of tables from scratch. I use to do that on java in 11th class in my school day. I learnt loop from my teacher but I learnt pagination on my own. Now a days javascripts have arrived that can perform the server side processing. is the way to go if you have table with small amount of rows. Thus server side pagination by CodeIgnitor can be ignored. However, when it comes to editing and displaying huge sets of data, it is better to have because it is design with efficient server side processing and also editing in DataTables is only trial based.

Difference between jTable and DataTables is in the way they deal with HTML data. jTable just requires a DIV to be assigned and jquery and PHP does the rest whereas in DataTables you simply generate a standard HTML table which is later converted into pagination.

This is the Part 1 …