[HOW TO] Remove files with names that contains special characters

I have wrote the script, unluckily it has created an text file with name that contains special character '-' as below:

@cattek Scripts]$ ls
configuration.sh  -P  rsysnc.sh

I don't like it, it shouldn't stay here. I try to delete:
@cattek Scripts]$sudo rm -rf '-P'

Outputs:
rm: missing operand
Try `rm --help` for more information

The rm command failed to delete that. Finally I find a method to delete. I put '--' the first of file name. A '--' signals will disables further option processing by shell. Any arguments after the '--' are treated  as filenames and argument.

@cattek Scripts]#sudo  rm -- '-P'
rm: remove regular file ‘-P’? y
@cattek Scripts]# ls
configuration.sh  rsysnc.sh

I am glad to see.

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] Google Driver Image not showing up on website

I change the theme blog for her. It's not hard to make decisions when she know what she like.
I quickly apply the new theme.

The new theme looks like better than old theme. I try to change a bit to reach the good view. Of course, it is a my view point. And I hope her too like.

...

I want to change her profile picture and BUM, image not showing up on Blogger. Humn, what the the next action?

It seems like that I have to change google data sharing's id. I see the solution on google, but now I do not remember him.

To solve this issues, I only do as below:

Get the sharing link on Google Drive: https://drive.google.com/file/d/0B8qCAdTDPDhSMkN4X2pQcDRsRE0/view?usp=sharing

I have to copy the id 0B8qCAdTDPDhSMkN4X2pQcDRsRE0 and paste to https://drive.google.com/uc?id= as below:
https://drive.google.com/uc?id=0B8qCAdTDPDhSMkN4X2pQcDRsRE0

Oh nice. I see that, image shows up on Blogger.

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] Restrict SSH connection

In afternoon I thought about restriction ssh Linux server. I know exactly the incoming ssh, therefore I have to restrict to improve secure system.

Secure system is not easy, it's hard to say that you completely control everything on system. With me, it combines of system, network, people, process.

And day-by-day you also learn/ practice and practice, join the community to discuss and update news. 

Back to this article, I will instruct you how to restrict ssh login access on Linux.

I use Cent OS 7.2, OpenSSH_6.6.1p1.

Firstly you have to edit /etc/ssh/sshd_config. Go to the end of sshd_config, and add:



AllowUsers user@IP
In case you allow 'user' from exactly IP

AllowUsers user
In case you allow 'user' from every IP

AllowUser user@192.168.1.*
In case you allow 'user' from subnet



After that, you have to restart sshd service to apply the new change.

Thank you for reading this article, please a comment if you are interested.

Tiến Phan - R0039

Knowledge is Endless

Sharing for Success

[HOW TO] remove shortcut from application menu in Elementary OS/ Ubuntu/ Kubuntu/ Xubuntu

Today is a Saturday, I get up lately. I have a breakfast, and now I stay at home. Turn on the laptop, and I see many icons in Application Menu in Elementary OS.

I do not like this. I always like simple menu.

What is solution to remove?
Google, I see Main Menu as known as Alacarte. So I have to install.

What is Alacarte?
It is a menu editor for the GNOME desktop, writen in Python (wikipedia)

How to install?
$sudo apt-get install alacarte

How to remove?
To start and removal, follow these steps:
  1. Go to Application menu
  2. Choose Main Menu
  3. Select the application you do not like, and then choose Delete