Thursday, April 25, 2019

How to symlink a file in Linux? [SOLVED]

How to create symlink for a file/directory ?

Today I will show you how to create a symlink to a file or folder.
In linux, a symbolic link, also known as a symlink or a soft link, is a special kind of file (entry) that points to the actual file or directory on a disk (like a shortcut in Windows)

So lets create one: 

in order to create a new symlink try below


ln -s /path/to/file /path/to/symlink


To create or update a symlink:
ln -sf /path/to/file /path/to/symlink


How to list all symlink in a directory ?
Now you have created a symlink. To see present symlink for current directory you can try below command:

ls -la /var/www/ | grep "\->"

This will list all the links present in the current directory.

Let me know if this resolves your problem 😃



Tags:

Friday, April 19, 2019

Search in all files for specific string on Linux [SOLVED]

If you want to search a word in all of your files on your linux you need to run grep command. This command has some parameters. All explained below:

grep -rnw '/path/to/somewhere/' -e 'pattern'
  • -r or -R is recursive,
  • -n is line number, and
  • -w stands for match the whole word.
  • -l (lower-case L) can be added to just give the file name of matching files.
Along with these, --exclude--include--exclude-dir flags could be used for efficient searching:
  • This will only search through those files which have .c or .h extensions:
    grep --include=\*.{c,h} -rnw '/path/to/somewhere/' -e "pattern"
    
  • This will exclude searching all the files ending with .o extension:
    grep --exclude=*.o -rnw '/path/to/somewhere/' -e "pattern"
    
  • For directories it's possible to exclude a particular directory(ies) through --exclude-dirparameter. For example, this will exclude the dirs dir1/, dir2/ and all of them matching *.dst/:
    grep --exclude-dir={dir1,dir2,*.dst} -rnw '/path/to/somewhere/' -e "pattern"
    
This works very well for me, to achieve almost the same purpose like yours.
For more options check man grep

There appears to be trouble with your network connection. Retrying... [SOLVED]

So recently I was facing an issue while adding Yarn package to my application. Every time I was doing Yarn add it was showing me error like There appears to be trouble with your network connection. So problem is, this happens when your network is too slow or the package being installed is too large, and yarn just assumes it's a network problem. Lets try increasing Yarn network timeout!

To resolve this problem all you need to do is:

yarn add <yourPackage> --network-timeout 100000


Now if problem still exists then you need to add proxy.
To add proxy just do below.

$ yarn config set proxy http://your_company_proxy_url:port
$ yarn config set https-proxy http://localhost:3128

example $ yarn config set https-proxy http://proxy.example.com:8080

Add a comment below if problem still exists :) Will be happy to help you!


Thursday, July 16, 2015

Google News Reader using javascript and jQuery

Hey everyone,

Just developed a Google News Reader using google news api.

So just to sharpen my javascript skills, I have developed this small project.

What's special ?

  • Auto update. If turned on, it will keep on refreshing the news based on selected intervals.
  • Choose news from various country.
  • Responsive page design. Page will load as per the device width.

How to download ?

I have created a repository on my GitHub.
All you need to do is download the zip.
Click on below link to download google news reader!

DOWNLOAD NEWS READER


How to use ?

Once you download the news reader, just extract the zip and open the index.html file. That's it! you are done!
Enjoy the latest news.  Let me know your valuable comments :)

I am planning to develop more javascript webapp/addon's/modules.



Thanks for reading,
Amit

Monday, April 6, 2015

GNU/Linux Distribution Timeline

GNU/Linux Distribution Timeline

Ladies and gentlemen here is GNU/Linux distribution timeline. Look at my favorite Debian > Ubuntu  branch :) so many distributions under that. Feeling great :)

Full Screen Image

Click to see full screen

Click here to see Full Screen


Thursday, April 2, 2015

Error: Apache shutdown unexpectedly [SOLVED]

Hello Guys,

So, I have been installing XAMPP on my office windows 8 machine and it didn't worked in first attempt. I knew it something is wrong with ports/config settings.
When I clicked on 'Start' button of XAMPP control panel, it showed me below error.

Error: Apache shutdown unexpectedly.
This may be due to a blocked port, missing dependencies, 
improper privileges, a crash, or a shutdown by another method.
Press the Logs button to view error logs and check
the Windows Event Viewer for more clues
If you need more help, copy and post this
entire log window on the forums

Problem detected!
Port 80 in use by "Unable to open process" with PID 4!
Apache WILL NOT start without the configured ports free!
You need to uninstall/disable/reconfigure the blocking application

or reconfigure Apache and the Control Panel to listen on a different port

Please follow the steps to solve this problem:

1) From XAMPP control panel click on Apache 'config' button. 

2) Now, httpd.conf file will be opened in text editor. 

3) Find (Control + F) Listen 80 replace it to Listen 8080

4) Again find ServerName localhost:80 replace it to ServerName localhost:8080

5) Now save the file and go to XAMPP control panel and click on 'Start' button. 

6) Now go to http://localhost:8080 you should see XAMPP index page. 
    Congratulations: You have successfully installed XAMPP on your system! :) 


So how did it worked ?

Your port 80 was busy and we are now using unique port i.e. 8080
So remember whenever you are going to access the localhost you will be using it like http://localhost:8080 same for phpmyadmin http://localhost:8080/phpmyadmin/

If you insist with default port 80 then you need to look in your computer and find which installed software is using port 80. 

e.g. skype uses default port 80. 
To clear that port, open skype then go to Tools > Options > Advanced > Connection > and in that uncheck 'Use port 80 and 443 for additional incoming connections' option. Then save it and restart the skype. Now your skype will use another unique port. 
Thats how you can clear port 80. 


Helpful ? comments please :)


Tuesday, September 16, 2014

Linux Commands Cheat Sheet

Hi Guys,

I have an idea! I have created most useful and important linux commands cheat sheet.

To make it more easy, I have created a short URL. So now you can access this cheat sheet file with simple URL.



Linux command cheat sheet
CopyLeft Linux Command Cheat Sheet

Note : Click on above image to see full size.



Thanks for reading!
Enjoy and be open
Amit Naik