All posts by Mehrad

Kept back packages in apt-get

I faced the following error/message in Ubuntu 14.04 LTS while updating my softwares through apt-get command:

The following packages have been kept back:
libglib2.0-0:i386 libhwloc-plugins
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

After some googling and reading some posts which were either inappropriate or risky/dangerous, I came up with the following solution that works every time and is safe.
Continue reading Kept back packages in apt-get

Find and replace in Nano

Q: How to find and replace a string in Nano?

A: The answer is straightforward, while you are in Nano,

  1. Press Ctrl+\. Notice that a box appears in the bottom of the window
  2. Then type the string you are trying to find and press Enter
  3. Then type the string you want to replace and press Enter
  4. At this point Nano jumps to the first instance of what you are looking for and shows you a set of shortcuts to go and find one by one, by pressing y for accepting and n for skipping, or replace all by pressing a

Continue reading Find and replace in Nano

Run Java applications on Linux

There are still some companies out there that are trying to have a GUI (Graphical User Interface) for their web services specially in scientific society. Most of these application are written in Java and requires user to have a Java enabled machine to run on. All these companies support OSX and Windows but they don’t want to provide support for Linux (for some reason that is not clear for me!). So in this brief tutorial I’m going to answer the question in an easy way:

The question is, how should we run .jlnp file on Linux?
Continue reading Run Java applications on Linux

Remote logout user through SSH

I had an issue with my Ubuntu recently that the computer was not stopping screesaver and didn’t show me the login page after a screenlock. Most people usually try to forcefully shutdown by pressing and holding the power button for about 10 seconds. This is not a good choice specially when you have some services on that machine or having some other users logged in through SSH to that computer.

In this article I will briefly explain how to logout a specific user remotely through SSH without touching or terminating any service or any other user.

Continue reading Remote logout user through SSH

Save file/folder structure including permissions

It has always been a great concern to keep track of folder permissions since most of the lame errors in Linux are due to a permission denial by the system, and sysadmins should change some permissions from time to time to fix things. At this point having a good record of what has been changed is vital since in terminal there is no undo or Ctrl+z and you should keep track of what you are doing to reverse the change and correct the mistakes.

In this post I briefly want to present some lines of code that can help you keep track.

Continue reading Save file/folder structure including permissions

Have spotlight search in KDE

The first few sentences are just my personal experience, so you can skip it and move on to the next part (Starting the configurations).

Some small complains about Ubuntu 14.04 LTS !

I Started using KDE for my Ubuntu system (since Unity was causing lot’s of system crash and reboots). Everything about KDE is OK and smooth, with 32GB RAM and Intel core i7 vPro 3.4GHz 8MB, and I’m having lots of fun working around and it increases my productivity, but I also missed the spotlight search of my MacBook. also KDE does not have good shortcuts for their plasma system and for example you can not use a windows key on your keyboard to open the application launcher! so I tried to find an easy way not to use mouse for opening my application. So here is a way to have spotlight search in KDE:

Start the configuration

Before everything I should say that I’m not going to install any application or write some weird shell, I’m going to sue the KDE settings in few clicks.
So let’s get to business:

Continue reading Have spotlight search in KDE

Install and enable SSH in Ubuntu 14.04

I was setting up a service on a local computer with Ubuntu 14.04 Trusty Tahr OS which I realized there is no SSH server daemon what so ever on Ubuntu, so I thought installation and enabling SSH in Ubuntu 14.04 can be a issue for some beginners, so here is the solution:

First you should install the OpenSSH server:

sudo apt-get install openssh-server

Continue reading Install and enable SSH in Ubuntu 14.04

Git error after updating Xcode

Few days back I updated my Xcode and today when I opened my IDE to start coding, I realized the IDE is not recognising Git on my computer, so I tried to run git in terminal:

git --version

and I got the following error:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

so I search internet and I found  Continue reading Git error after updating Xcode

SSH “Host key verification failed” error

There is an annoying error which you get when you want to connect to the same IP via SSH but the server authentication key has been changed and you computer does not accept the risk to connect with a key other than the one you have used before.

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending key in /home/user/.ssh/known_hosts:1
RSA host key for ras.mydomain.com has changed and you have requested strict checking.
Host key verification failed.

This can happen when you install a new OS on the server (or what ever you are trying to connect with via SSH) or if you have completely change the device on the other end (which is also the same case as changing the OS). This error is basically for your own security and safety but it annoys anyway 😀

In this article i’m going to explain few ways to resolve the issue:

Continue reading SSH “Host key verification failed” error