Hey folks i have started a new photo blog. Nature from the eyes of an amateur photographer.Follow me here
Translate
Wednesday, June 28, 2017
Tuesday, April 26, 2016
Homecoming...with a twist :)
Hey folks!!! Am back here with something different today. Watch my recorded gameplay on iphone 6S Plus.
Wednesday, July 10, 2013
HowTo:Diasable GUI mode in Ubuntu
As the title suggests,here are the five steps using which you can disable the 'Graphics' mode in Ubuntu (offcourse intended for Ubuntu-desktop editions.The server edition does not provide GUI)
Step 1: Using terminal, navigate to /etc/default
cd /etc/default
Step 2: On listing out the files in the directory,you will find a file named grub.Edit this file using preferred editor.I use vi
vi grub
The file looks like this.
Step 3: Look for and change the line GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT ="text"
Step 4: Save changes and exit out of the editor.
Step 5: Its now time to update the configurations made to the grub.Use this command
sudo update-grub
You will see something like this
Reboot the system and see the effect.To revert back to the GUI mode just revert the changes you made earlier.Don't forget step 5.
Have a great day!!! Cheers!!
Step 1: Using terminal, navigate to /etc/default
cd /etc/default
Step 2: On listing out the files in the directory,you will find a file named grub.Edit this file using preferred editor.I use vi
vi grub
The file looks like this.
Step 3: Look for and change the line GRUB_CMDLINE_LINUX_DEFAULT = "quiet splash" to GRUB_CMDLINE_LINUX_DEFAULT ="text"
Step 4: Save changes and exit out of the editor.
Step 5: Its now time to update the configurations made to the grub.Use this command
sudo update-grub
You will see something like this
Reboot the system and see the effect.To revert back to the GUI mode just revert the changes you made earlier.Don't forget step 5.
Have a great day!!! Cheers!!
Friday, April 19, 2013
Friday, March 22, 2013
MySQL/Linux: Creating and restoring database backups using command line
Most of us have worked on different database technologies. MySQL is one amongst them.This tutorial explains the backup/restore process of db's in mysql.
Mysql provides a tool mysqldump which allows the user to take the backup of current state of the databases and restore them at a later point in time,if required.This tool comes in with the default installation of mysql server and can be used on the command line.
In this tutorial i am using mysql-server-5+ and Linux OS command line to explain the usage of this tool.
For a single database
Suppose you need to backup a single database.This command will do your work.
mysqldump -u root -p[root_password] [database_name] >filename.sql
So to backup a database named 'testing',the command would be
mysqldump -u root -p[root_password] testing > testing.sql
Note:The dump file testing.sqlwill be generated and stored in the directory location where you issue this command.However,you can specify your own directory location.Something like this
mysqldump -u root -p[root_password] [database_name] > /path/to/file
Now comes the restore part.To restore a dump into a database,the syntax is
mysql -u root -p[root_password] [database_name] < filename.sql
where filename.sql is the dump file generated using mysqldump command.
Suppose you need to restore the dump file generated in the previous step to a database named 'testing1'.The command is
mysql -u root -p[root_password] testing1 < testing.sql
Note: The database into which the dump needs to be restored(in this case testing1) should be created in advance (using the Create database) before dumping the content of the dump into file.Not doing so will throw up an error when the restoration is done.
For multiple databases
Sometimes it is necessary to back up more that one database at once. In this case you can use the --databases option followed by the list of databases you would like to backup. Each database name has to be separated by space.
mysqldump -u root -p[root_password] --databases db1 db2 > content_backup.sql
The above command will dump two databases db1 and db2 into the content_backup.sql file.
If you want to back up all the databases in the server at one time you should use the --all-databases option. It tells MySQL to dump all the databases it has in storage.
mysqldump -u root -p[root_password] --all-databases > alldb_backup.sql
Selective backup with mysqldump
The mysqldump utility also allows you to take selective backups in a database.You may want to backup one or more tables in database or,backup only selective data or records(using 'where' conditional clause).
With mysqldump command you can specify certain tables of your database you want to backup. For example, to back up only blog_template1 and blog_template2 tables from the ‘Templates’ database,use the command below. Each table name has to be separated by space.
mysqldump -u root -p[root_password] \blog_template1 blog_template2 > dbtemplate_backup.sql
For backing up or dumping only selective records in tables we can use the --where or -w option.For example,to backup the records from table t1 in the database db1 where vendor is google, the command will be
mysqldump -u root -p[root_password] db1 \t1 --where "vendor='google'" > t1.sql
This completes the tutorial on backing up/restoring data in mysql.Comments and feedbacks will be appreciated.Cheers!!!
Wednesday, March 6, 2013
Tweak your Ubuntu with this smart tool
There are several tools available for Windows for tweaking the look and feel of your WinOS. TweakUI,TweakNow,XDN Tweaker,Little Tweaker to name a few.However,most of you reading this post may not be aware of such tools for Ubuntu.Well there are a few and Ubuntu Tweak is one amongst them.
As quoted on Ubuntu Tweak website "Ubuntu Tweak is an application to config Ubuntu easier for everyone.It provides many useful desktop and system options that the default desktop environment doesn't provide."
So its time to explore this tool.
The HOME screen
The Home screen looks something like this.It provides basic info like hardware details,OS details,disk cache and system update.The 'Start Janitor' option can be used for cleaning up the disk cache and other junk which your system holds.We will review it further.You can also see different tabs at the top.These provide different functionalities.
The apps section
As the name suggests this section allows you to download apps for your Ubuntu OS.It features some handpicked tools as well as utilities for your entertainment.Try it out and i am sure you won't be disappointed.
Its time to do some tweaking
The 'Tweaks' section provides various categories of tweaks for your system.You can customize the look and interface of your OS.Click on the 'Love Wallpaper HD' icon and i am sure you would feel lucky.There's a lot more to explore in this section.Try it yourself.
For Admins only
This section is for the system administrators or users who have administrative privileges.This section can be used to manage files and applications.It also allows the superuser to edit and add new Sources other than the default one.The screenshots below will give you an idea about the various features.
Application Center
The application center provides a simple interface for finding and installing popular apps for your Ubuntu.One can argue it is a copycat of the apps section featured in this tweaking software,but hey,nothing is perfect in this world :)
File Type Manager
The name says it all.Just make sure that you make proper associations.
Source Center
The Janitor
The Janitor here is equivalent to the CCleaner app in Windows.Clean all the system's junk using this option.Allows you to clean out browser cache,apt-cache,temporary files,older kernel versions,unnecessary and broken packages.This is one feature that is highly recommended for all Ubuntu users.Get rid of the junk on just a click.Simple,isn't it.
Hope you enjoyed reading this review about Ubuntu Tweaks.Download the app from here and keep exploring.
As quoted on Ubuntu Tweak website "Ubuntu Tweak is an application to config Ubuntu easier for everyone.It provides many useful desktop and system options that the default desktop environment doesn't provide."
So its time to explore this tool.
The HOME screen
The Home screen looks something like this.It provides basic info like hardware details,OS details,disk cache and system update.The 'Start Janitor' option can be used for cleaning up the disk cache and other junk which your system holds.We will review it further.You can also see different tabs at the top.These provide different functionalities.
The apps section
As the name suggests this section allows you to download apps for your Ubuntu OS.It features some handpicked tools as well as utilities for your entertainment.Try it out and i am sure you won't be disappointed.
Its time to do some tweaking
The 'Tweaks' section provides various categories of tweaks for your system.You can customize the look and interface of your OS.Click on the 'Love Wallpaper HD' icon and i am sure you would feel lucky.There's a lot more to explore in this section.Try it yourself.For Admins only
This section is for the system administrators or users who have administrative privileges.This section can be used to manage files and applications.It also allows the superuser to edit and add new Sources other than the default one.The screenshots below will give you an idea about the various features.Application Center
The application center provides a simple interface for finding and installing popular apps for your Ubuntu.One can argue it is a copycat of the apps section featured in this tweaking software,but hey,nothing is perfect in this world :)
File Type Manager
The name says it all.Just make sure that you make proper associations.Source Center
The JanitorThe Janitor here is equivalent to the CCleaner app in Windows.Clean all the system's junk using this option.Allows you to clean out browser cache,apt-cache,temporary files,older kernel versions,unnecessary and broken packages.This is one feature that is highly recommended for all Ubuntu users.Get rid of the junk on just a click.Simple,isn't it.
Hope you enjoyed reading this review about Ubuntu Tweaks.Download the app from here and keep exploring.
Thursday, February 28, 2013
Friday, February 22, 2013
Debian/Linux:Advanced Packaging Tool(APT)
APT is the Advanced Packaging Tool and provides the apt-get program.APT provides an efficient way to retrieve and install packages from multiple sources using the command line.
In contrast to dpkg (another debian based package management tool),apt-get does not understand .deb files,it works with the package's proper name and can only install .deb archives from a source specified in '/etc/apt/sources.list'.A screenshot for the same is shown below.
Note: apt-get will call dpkg directly after downloading the .deb archives from the configured sources.
Some of the common usages of the apt-get program is illustrated below.
Update
To update the list of packages known by your system,issue the following command on the terminalapt-get update
Upgrade
To upgrade the installed packages(for which an upgradable version is available in the repository) on your systemapt-get upgrade
Install a package
To install a package and all its dependencies,issue this command on the terminalapt-get install
For example,to install the 'apache' webserver and all its dependencies
apt-get install apache2
Remove a package
To remove a package from your systemapt-get remove
For example,to remove the 'gedit' program from your system
apt-get remove gedit
Note : The above command will just remove the gedit program.It will not remove the configuration files related to the gedit program.
To completely remove the gedit package along with the configuration files
apt-get --purge remove gedit
Saving your valuable disk space
Each time you install an application using apt-get,the corresponding deb package is downloaded and stored in a location on the hard disk,usually the directory '/var/cache/apt/archives'.The following command will remove all the archives and free up hard disk space
apt-get clean
To delete only those packages in the cache which are found useless or partially complete,use this command
apt-get autoclean
The 'apt-cache' tool
Another tool in the APT tool suite is apt-cache.The apt-cache tool can be used to search for and find packages,and the best thing is that it supports use of regular expressions.The uses of this tool is illustrated below.
To find all packages that contain the word 'editor',use this command from the console
apt-cache search editor
The screenshot for the same is included below.
To print detailed information about a package,the syntax is-
apt-cache show
To display the packages that a given package depends on,the syntax is-
apt-cache depends
apt-cache depends apache2 will list all the packages that apache2 depends on.Simple,isn't it.
To print the detailed info of the versions available for a package and the packages that reversely depends on it,use this command
apt-cache showpkg
To get statistics of the packages available in the repositories,use this command
apt-cache stats
The history of package installation/removal/update using apt can be viewed in the history.log file (look in the directory /var/log/apt)
This completes the tutorial on APT.Stay tuned for more tutorials on package management on Unix/Linux based systems.Cheers!!!
Labels:
apt,
apt-get,
Debian,
package management
Monday, February 11, 2013
Setting up JAVA_HOME and PATH environment variables in Windows 7
I recently had to do some load testing stuff using the Apache Jmeter tool.Its a java based load testing tool.So for this i was required to install JDK on my Win7 box.Installing JDK was easy.But that was not all.
Since i am not much into programming in Java (am a .NET enthusiast fyi),so i was told by one of my friends to set the environment variable to enable java to execute jar files for the load testing tool.Well it was not a tough job but took some time for me to figure it out.So here's a short and smart tutorial to get your box Java ready.
Step 1: Where's my JDK installation
The first step would be to locate your jdk's installation folder on your hard drive.Mine was C:\Java.This is an important step.You need to know the jdk installation folder location.This will be required later.
Step 2: Setting up environment variable.Where do i begin?
To set up the environment variable,right click on the 'My Computer'(or 'Computer' icon/menu item in Win 7)
This would show up the following screen.
Notice the 'Advanced system settings' on left!! Click on it.
This would throw up a new mini-window with the 'System properties' options.
Now locate and click the button which says 'Environment Variables'.
This shows up the EV window where you have a couple of system related variables pre-defined.
Step 3: Setting up things
Now,our concern is to set up two new variables namely JAVA_HOME and PATH.We define the variables individually.Click on the 'New' button(Note there are two buttons with the text New.Click on the highlighted one in the image.)
This throws up a small-window with couple of textboxes. Here is where you specify the two attributes of your variable,the Variable Name and Variable value. In the Variable Name field you need to specify the name of the variable(JAVA_HOME or PATH in our case) and in the Variable value field,you need to specify the pathname.
For JAVA_HOME put in these parameter values.Note: The Variable value should contain the location of the JDK folder on your system.
For PATH put in these values.Note: The Variable value should contain the location of the bin folder of the JDK installation on your system.
Once done, you can see these environment variables in the listing. But we are not done yet.
Step 4: Some more changes
We just specified the environment variables.But the job is not over yet.We need to edit some 'System Variables' for the JAVA_HOME variable.To do so,highlight the JAVA_HOME variable by clicking on it.Once highlighted,you can see the various system variables related to our variable.
Now,we need to change the 'Path' variable(highlighted in the image above).Click on it and then click on 'Edit'.
This throws up the 'Edit System Variable' mini-window.Now add the highlighted portion in the image shown below at the end.(Don't forget to put in the semi-colon).
Once done,close everything and restart your system for the changes to come into effect.Once restarted,go to the command-line(cmd.exe) and type-in the following commands: java and javac
You can see the version of Java installed on your system.This indicates that you have set the 'environment variables' successfully on your system.
Since i am not much into programming in Java (am a .NET enthusiast fyi),so i was told by one of my friends to set the environment variable to enable java to execute jar files for the load testing tool.Well it was not a tough job but took some time for me to figure it out.So here's a short and smart tutorial to get your box Java ready.
Step 1: Where's my JDK installation
The first step would be to locate your jdk's installation folder on your hard drive.Mine was C:\Java.This is an important step.You need to know the jdk installation folder location.This will be required later.
Step 2: Setting up environment variable.Where do i begin?
To set up the environment variable,right click on the 'My Computer'(or 'Computer' icon/menu item in Win 7)
This would show up the following screen.
Notice the 'Advanced system settings' on left!! Click on it.
This would throw up a new mini-window with the 'System properties' options.
Now locate and click the button which says 'Environment Variables'.
This shows up the EV window where you have a couple of system related variables pre-defined.
Step 3: Setting up things
Now,our concern is to set up two new variables namely JAVA_HOME and PATH.We define the variables individually.Click on the 'New' button(Note there are two buttons with the text New.Click on the highlighted one in the image.)
This throws up a small-window with couple of textboxes. Here is where you specify the two attributes of your variable,the Variable Name and Variable value. In the Variable Name field you need to specify the name of the variable(JAVA_HOME or PATH in our case) and in the Variable value field,you need to specify the pathname.
For JAVA_HOME put in these parameter values.Note: The Variable value should contain the location of the JDK folder on your system.
For PATH put in these values.Note: The Variable value should contain the location of the bin folder of the JDK installation on your system.
Once done, you can see these environment variables in the listing. But we are not done yet.
Step 4: Some more changes
We just specified the environment variables.But the job is not over yet.We need to edit some 'System Variables' for the JAVA_HOME variable.To do so,highlight the JAVA_HOME variable by clicking on it.Once highlighted,you can see the various system variables related to our variable.
Now,we need to change the 'Path' variable(highlighted in the image above).Click on it and then click on 'Edit'.
This throws up the 'Edit System Variable' mini-window.Now add the highlighted portion in the image shown below at the end.(Don't forget to put in the semi-colon).
Once done,close everything and restart your system for the changes to come into effect.Once restarted,go to the command-line(cmd.exe) and type-in the following commands: java and javac
You can see the version of Java installed on your system.This indicates that you have set the 'environment variables' successfully on your system.
Tuesday, January 29, 2013
Going back to my roots....Programming with C#.NET
This post is dedicated for C#.NET enthusiasts.I will be regularly uploading C#.NET applications(zipped),code snippets,videos and study materials to master this technology.Your feedback would be highly appreciated.
Labels:
C#.NET
I have an iso image
I recently downloaded the Visual studio 2010 express edition iso image from the microsoft's website.
I thought of mounting the image file (iso) with alcohol 120%.The setup file of alcohol 120% gave me errors on my Windows 7 pc(maybe because the alcohol setup was an old version).
This gave me an idea of extracting the iso files to my local disk and then run the setup.
All i needed was some tool to extract the files from iso. WinRaR is the best i thought.
This is what i did
Step 1: Selected the iso image and extracted it to a location(Used the 'Extract to' option in the right click menu.You can configure these options during the installation of WinRaR application)
Step 2: The extraction in process
Step 3: The extracted folder which includes the 'Setup' file of VS2010.
Step 4: The installation window on clicking 'Setup'
The installation thereafter was pretty smooth and fast.
Extracting from iso is a good option especially if you have a large hard disk space to keep your extracted files.
I thought of mounting the image file (iso) with alcohol 120%.The setup file of alcohol 120% gave me errors on my Windows 7 pc(maybe because the alcohol setup was an old version).
This gave me an idea of extracting the iso files to my local disk and then run the setup.
All i needed was some tool to extract the files from iso. WinRaR is the best i thought.
This is what i did
Step 1: Selected the iso image and extracted it to a location(Used the 'Extract to' option in the right click menu.You can configure these options during the installation of WinRaR application)
Step 2: The extraction in process
Step 3: The extracted folder which includes the 'Setup' file of VS2010.
Step 4: The installation window on clicking 'Setup'
The installation thereafter was pretty smooth and fast.
Extracting from iso is a good option especially if you have a large hard disk space to keep your extracted files.
Thursday, January 24, 2013
Run a MySQL script file in Linux
We commonly use scripts to automate and ease our work. MySQL provides a feature to create schema structure using scripts.
A MySQL script file(.sql) is as good as a normal text file.Just put your queries in a text file and your script is ready to run.In this post i explain the procedure to run a mysql script through the command line as well as mysql shell
Here is my script file
I placed my script file in the root directory.The location of the script is important.Why?? We will get to know it soon.
mysql -u -p < script
Note: Execute this command from the location where you placed your script.
Replace the with the mysql username and with the password you use to login into mysql.For instance,if the username is root and password is xyz the script filename is scpt the command would be
mysql -u root -pxyz < scpt
< is the redirection operator in Unix/linux.
If the command execution is successful,you won't get any confirmation message.The control returns to the next line of the shell prompt.
Now to confirm the changes made by the script,login to mysql and use the show databases and show tables command.
Below is an illustration of this method.
To execute your script from the mysql shell.Follow these steps
2. Once in the mysql shell,enter this command to execute your script
source scriptname
Replace scriptname with the script you earlier created and want to execute.
3. Once the mysql shell finds your script file,it will execute it and the results can be instantly seen on your screen.
Now to confirm the changes made by the script, use the show databases and show tables command.
In case the mysql is unable to locate the file,it will throw up an error something like this
A MySQL script file(.sql) is as good as a normal text file.Just put your queries in a text file and your script is ready to run.In this post i explain the procedure to run a mysql script through the command line as well as mysql shell
The script file
I created my script using vi editor in Linux(you may use any text editor :) )Here is my script file
I placed my script file in the root directory.The location of the script is important.Why?? We will get to know it soon.
Executing the script
We can execute our script in two ways.- From the Linux/Unix command line with the help of the redirection operator(<)
- From the mysql shell.
mysql -u
Login to mysql with root privileges(Note:Login into mysql from the same directory where you placed your script)
2. Once in the mysql shell,enter this command to execute your script
source scriptname
Replace scriptname with the script you earlier created and want to execute.
3. Once the mysql shell finds your script file,it will execute it and the results can be instantly seen on your screen.
Now to confirm the changes made by the script, use the show databases and show tables command.
In case the mysql is unable to locate the file,it will throw up an error something like this
Subscribe to:
Posts (Atom)





































