Skip to main content

Posts

Showing posts with the label Tips n Tricks

Install sublime editor

Hi. Sublime editor is a light weight editor and very helpful for developers to write code.It will highlight the code in colors for easy readability. Sublime editor 3 is the latest one available as of now . The below link shows how to install sublime editor in CentOS . http://software-engineer.gatsbylee.com/how-to-install-sublime-3-on-centos-7-rhel-7/ To know about you system OS is 32 bit or 64 bit , use the below command. >uname -a 

UNIX : How to ignore lines with certain names

Sometimes we need to ignore multiple lines with certain words and get the list out of the file. usually it will be a log file to read . The below grep command can be used to ignore multiple words present in a text file. Lets say the file contain $ cat list.txt apple orange apple banana papaya Now we need to ignore line with orange , banana and papaya . So we can use the below grep command. $ cat list.txt | grep -Ev "orange|banana|papaya" apple apple It will ignore lines with the words in -v part of grep.

UNIX : Find all files created on particular date

Here a simple script to display or list only the the files created on a particular date in unix. Lets say there are 3 files in the directory and we need to get only the files created on september 28, $ ls -ltr total 12 -rw-rw-r-- 1 system system  8 Sep 28 23:55 list.txt -rwxrwxrwx 1 system system 89 Sep 28 23:57 script.sh -rw-rw-r-- 1 system system 10 Oct  2 08:54 list2.txt We can use the  below one liner to get it. $ ls -l | awk ' $6 == "Sep" && $7 >= 28 && $7 <= 28 { print $9 }' | xargs ls -ltr -rw-rw-r-- 1 system system  8 Sep 28 23:55 list.txt -rwxrwxrwx 1 system system 89 Sep 28 23:57 script.sh The awk part can be modified to get range of files or even files created or modified within a particular time. We can also male use of find command , but it is little difficult to specify the date range in it.

How to take screen shot in iphone 6s

To take screen shot in Iphone 6S  1 . Go the the screen or app which you would like to get screen shot. This can be a watsapp chat session or a high score you got in any games you are playing . 2. Press in sleep/wake button and home button at the same time. This will get the image of the screen.

How to take screen shot in moto g turbo?

To take screen shot in Moto g turbo 1 . Go the the screen or app which you would like to get screen shot. This can be a watsapp chat session or a high score you got in any games . 2. Press in volume down button and power button at the same time. This will get the image of the screen and it will be saved into the gallery.

How to create shortcut in Ubuntu

To create a shortcut in Ubuntu like creating in windows , 1. Right click on the file which in the short cut need to be created 2. Select "Make Link" option. This will make a a new file with name '<link to filename>' turn arrow on it. 3. Move the short cut file where ever you like  

Excel : Join strings from two cells

To concatenate two cells to one cell and have them in two different line use the below technique. Lets say A1 has This is line one B1 has This is line two To have C1 as  This is line one This is line two  give =CONCATENATE(A1," ",B1) To have C1 as This is line one                         This is line two  give =A1&CHAR(10)&B1

Ubuntu : How to remove a broken package

Ubuntu ver : 14.04 Here I am going to show how to remove a broken package from the system.I was not able to use synaptic package manager since it was getting closed immediately after opening. Step 1 : Open terminal Ctrl + Alt + T Step 2 : Give the command sudo dpkg --configure -a               if it is not showin g any errors then system is fine.Otherwise get the package name from the error d isplayed. dpkg: error processing package libcups2:i386 (--configure):  package is in a very bad inconsistent state; you should  reinstall it before attempting configuration Errors were encountered while processing:  libcups2:i386 Step 3 : Open the file sudo gedit /var/lib/dpkg/status Step 4 : Find for the broken package . Search for Package: libcups2 Step 5 : Remove the entire block of line relating to it and save the file. Now synaptic package manager should open.

UNIX : grep command examples

GREP (Global Regular Expression and Print) is a utility used to search for lines containing the string in a file. Syntax of GREP is :  grep [option] [pattern] [ files] 1. Search for lines in a file that contains a word . > grep "word" <filename> 2. How to search for more than one matching string in a file? >egrep "a|b|c" <filename>

Text to Columns in Excel

Today I will show you , how to use Text to Columns feature in Microsoft Excel.Many times we may need to split a space separated line to columns and use.With this text to column option you can easily split the words to separate columns. Eg: I want to split the follwing text to separate columns. If it is copied to Excel sheet , each line will occupy a row and fit into single column(Here it is column A). To Split do the following. 1. Select Data Tab from the menu bar. Select the range to split .Now click on Text to Columns as shown in figure 2. A popup windows will appear.Choose the delimited option and click next. 3. Now 'Check' the space option and click next.(Here the word is separated by single space.If it is required to be separated by any other character , it can be chosen). 4. If you do not want to change any data format click next. Now click Finish.Your data is ready.Now here is the conver

How to format hardisk in ubuntu?

To format hardisk in ubuntu , you can use Gparted partition editor 1. Install gparted in the system  ~$ sudo apt-get install gparted 2. Open the application through terminal. 3. Gparted will list all the partitions and the filesystem it is holding. Right click on the desired partition and format it.

How to add fonts in Ubuntu?

To add fonts like Times New Roman , Ariel etc in Ubuntu do the following. 1. open ubuntu Software Center  2. Searh fo r  ttf-mscorefonts   in search  bar. 3. Install the item listing in the page. Now you can use new fonts in ubuntu.    

How to remove toolbar from browser?

Some tool bars will get installed in browser along with desktop applications. I will show how to remove these toolbar from Google Chrome , Mozilla Firefox and Internet Explorer. Internet Explorer Go to TOOLs > MANAGE ADD-ONS You can see all the toolbars added to browser here.Select the toolbar to be removed by clicking the item.Now click the DISABLE button present at the bottom. Google Chrome Go to SETTINGS as shown below. Select EXTENSION. There you can see all the tool bars installed in CHROME browser. By clicking on the 'TRASH' icon toward the right side of the item , it can be removed. Mozilla FireFox Go to TOOLs >  ADD-ONS Select EXTENSION. There you can see all the tool bars installed in firefox browser. By clicking on the 'DISABLE button toward the right side of the item , it can be removed.

How to take screenshot in Samsung Galaxy S2 ?

To capture screen shot in Samsung galaxy S2 , hold the Home button and Power button at the same time for some time. Then the image captured can be saved easily.

How to download.swf file

Here I will tell you about how to save a .swf (shockwave file) from Mozilla Firefox. 1. The flash file will play in a webpage.Right click on region just outside flash window on webpage. 2. Select the option 'View Page Info' 3. Select the 'Media' tab at the top of the new window appearing.  4. Find the items in address box having extension .swf  5 .Now select on the .swf file and click the 'Save As' button at bottom right of window and give location to save.

How to add jQuery to blogger?

jQuery is a JavaScript Library.It is fast and concise jQuery helps to simplifies HTML document traversing, event handling, animating, and Ajax interactions for web development.  Here i show you how to add jQuery to blogger.  1.Login to your blog. 2.Go to design page. 3.Select Edit HTML tab 4.Find the <head> section and paste the following code just below the tab.  

How to share blog post ?

Hi.I will show you how to add social network sites icon to your blog post in Blogger.For that follow the steps. 1. Login to your Blogger. 2.Go to design tab. 3.Take Edit HTML tab. 4.You my expand the widget option.Give the check option on ' Expand Widget Templates' 5.Find the tag  <data:post.body/>