[LIFE] Mệt mỏi khi thể hiện ra khuôn mặt, đã là thứ không thể giấu được. Sợ đéo gì mà không làm, không nghĩ, không mơ!

Rời khỏi công ty, trên đường về nhà với nét mặt mệt mỏi. Tôi còn mệt mỏi nhiều trong cuộc rong chơi này. Tôi sẽ làm tới nó. Tới cái mức mà tôi kỳ vọng, bản thân tôi muốn.

Đừng bao giờ đi ăn một mình - đây vẫn là cuốn sách mà tôi tâm đắc nhất vì những gì tôi đọc trong nó, là những gì tôi nhận được từ một người anh, người thầy, người hướng dẫn!

Cứ ngon đã, rồi thành công sẽ đến! 
Dù hai chữ thành công nó cũng trừu tượng lắm. 

Sợ đéo gì mà không làm, không nghĩ, không mơ!



Thành phố Hồ Chí Minh, 23/ 01/ 2014

Tiến Phan

[HOW TO] 403 Access Denied In Tomcat

Hello,



Today I have a problem with Apache Tomcat: What is Tomcat default account? 
I resolved once.

Let's go,

You built Tom Cat to use for hosting website. Once day you need to deploy *.war package and ...

Go to http://heineken.tiger:8080/manager/html and move to Manager App button. You log in with default account (C:\apache-tomcat-7.0.32\conf\tomcat-users) . However you got the error:

403 Access Denied

You are not authorized to view this page.
If you have already configured the Manager application to allow access and you have used your browsers back button, used a saved book-mark or similar then you may have triggered the cross-site request forgery (CSRF) protection that has been enabled for the HTML interface of the Manager application. You will need to reset this protection by returning to the main Manager page. Once you return to this page, you will be able to continue using the Manager appliction's HTML interface normally. If you continue to see this access denied message, check that you have the necessary permissions to access this application.


What is happended?

Okay, we are finding the result for this case.

By default, Tomcat does not enable default account or manager access. Therefore, to enable, you need to edit the file configuration at C:\apache-tomcat-7.0.32\conf\tomcat-users

It's simple!

Before:

<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
</tomcat-users>
After:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
  <role rolename="manager"/> #access the HTML interface               <role rolename="manager-gui"/>
  <role rolename="admin"/>                                            <role rolename="admin-gui"/>
  <user username="admin" password="admin" roles="admin,admin-gui,manager,manager-gui"/>
</tomcat-users>
Saved it and restart Tomcat.


Refresh your browser at http://heineken.tiger:8080/manager/html and move to Manager App button, login with username: admin and password: admin.

Tomcat Web Application Manager appears.

Are you happy? I just help you to resolve the problem. Please pm me if you have any question.
You are welcome,




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success

[LIFE] Who are administrators?

Currently, systems administrators need general knowledge (theoretical and practical) in a diversity of fields, from network technologies, to operating systems, diverse applications, basic programming in a large number of programming languages, extensive hardware knowledge - regarding the computer itself as well as peripherals - Internet technologies, web-page design, database management etc. And normally the profile is sought to correspond to the company's area of work, chemistry, physics, mathematics etc. Therefore, it is no surprise that any medium to large company has turned away from employing the available dogsbody towards employing a small group of professionals with extensive knowledge, most with a university degree, assigned to different task within the organisation.

The systems administrator must be capable of mastering a broad range of technologies in order to adapt to a variety of tasks that can a rise within an organisation.

---

[LIFE] ...

Viết cho đầu ngày 21/ 01/ 2014. Buồn ngủ quá roài, sau chuyến đi ngày hôm qua.


Ngứa tay gõ vài dòng,

  1. Tránh xa [cũng có thể ngồi gần nhưng không hưởng ứng] hoặc thấy ngứa thì nhảy vào đưa nó lên ây [ cũng có thể cho nó tiếp đất luôn] . Đơn giản, rất dị với kiểu này.
  2. Facebook là một cái chợ, tránh xa cái chợ đó ra nếu muốn sống tử tế. Thông tin là cá nhân và Facebook là cái chợ cởi mở. Vì thế, tự biết cần làm gì. Nhạt thếch,
  3. Nhìn vào đôi chân đang đứng trên mặt đất.
  4. Con người sống không chỉ bằng đam mê, còn sống bằng cơm áo gạo tiền nữa. Mơ thì đẹp và đời thì thường không được như mơ.
  5. Không để những quyển sách và mấy khóa học nhạt thếch mị dân. Hiện thực đang ở đây - ở ngay trước mặt - không phải nơi nào khác.
  6. Sống thực tế, biết mình muốn gì, im lặng và làm việc.
  7. Mỗi ngày, hãy hoàn thành nhiều nhất & thêm task list.
  8. Phơi bày tất cả là tự giết mình. Một góc để mình lui tới, thấy thoải mái, có niềm vui nhỏ làm được điều gì đó.
Quan sát,




Hồ Chí Minh, 21/ 01/ 2014

Tiến Phan

[HOW TO] làm thế nào để thay đổi mật khẩu Gmail của bạn?

Để giữ tài khoản của bạn an toàn, tôi khuyên bạn tạo mật khẩu đảm bảo duy nhất - không sử dụng mật khẩu này cho bất kỳ website khác. Và nhớ, khi thay đổi mật khẩu cho Gmail, bạn cũng đang thay đổi mật khẩu cho các sản phẩm khác của Google bạn có thể sử dụng như YouTube, Google Drive.

Heineken: Tiger, làm thế nào để thay đổi mật khẩu Google Mail (Gmail)?

Tiger: Đơn giản, chú ý và làm theo từng bước, từng bước.

Heineken: Đồng ý, bắt đầu đi.

Tiger: Mở gmail, nếu không biết làm thế nào để mở? nhấp link sau: http://mail.google.com . Giao diện đăng nhập của Google Mail như hình dưới. Tại đây, cần làm:

  • Nhập account của Heineken, ví dụ: rocky@gmail.com
  • Nhập password Heineken đang dùng
  • Nhấp đúp vào Sign in để bắt đầu bắt tay với Google Mail.


Heineken: Ok, nó đây.



Tiger: Tốt, nhìn thấy bánh răng ở góc phía trên bên phải không? nhấp vào nó, chọn Settings như hình dưới:





Tiger: Giao diện chính của trang Setting xuất hiện, chọn Account tab.



Heineken: Ok, đang ở Account tab.

Tiger: Tốt. Chọn Change password và nhấp vào nó.


Tiger: Giao diện của trang đổi password xuất hiện. Tại đây, bạn gõ 
  • Password hiện dùng [Current password] vào ô đầu tiên trong hình dưới:
  • Ô thứ hai [New password] trong hình dưới là password mới - đây là password từ giờ về sau của bạn. Bạn cần ghi nhớ password này và không chia sẻ nó cho bất kỳ ai. Nhớ: không chia sẻ cho bất kỳ ai.
  • Ô thứ ba [Confirm new password] trong hình, bạn gõ lại password mới một lần nữa để xác nhận. Bước này tưởng thừa mà không thừa vì nó giúp bạn nhớ và lặp lại/ ghi nhớ một lần nữa password. Google đã thao dõi hành vi người dùng để đưa thao tác này đến với bạn.



Tiger: Tới đây, việc cuối cùng cần làm là nhấp chọn  

Heineken: :D xong roài à. Đơn giản.

Tiger: Chúc ngủ ngon :) . Good luck and see you soon.




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] mount cannot mount block device //server/share read-only

You try to mount Samba share, you get this error as below:

ali33@01:/etc/skel$ sudo mount -t cifs //192.168.1.5/tool_utils /mnt/ -o username=pttien
[sudo] password for ali33: 
mount: block device //192.168.1.5/tool_utils is write-protected, mounting read-only
mount: cannot mount block device //192.168.1.5/tool_utils read-only

You don't like once. Ok, the solution is very simple. You must install cifs-utils package:

root@01:/etc/skel# apt-get install cifs-utils
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  keyutils
The following NEW packages will be installed:
  cifs-utils keyutils
0 upgraded, 2 newly installed, 0 to remove and 42 not upgraded.
Need to get 99.3 kB of archives.
After this operation, 312 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://vn.archive.ubuntu.com/ubuntu/ precise-updates/main cifs-utils i386 2:5.1-1ubuntu2 [65.2 kB]
Get:2 http://vn.archive.ubuntu.com/ubuntu/ precise/main keyutils i386 1.5.2-2 [34.1 kB]
Fetched 99.3 kB in 1s (50.0 kB/s)     
Selecting previously unselected package cifs-utils.
(Reading database ... 171358 files and directories currently installed.)
Unpacking cifs-utils (from .../cifs-utils_2%3a5.1-1ubuntu2_i386.deb) ...
Selecting previously unselected package keyutils.
Unpacking keyutils (from .../keyutils_1.5.2-2_i386.deb) ...
Processing triggers for man-db ...
Setting up cifs-utils (2:5.1-1ubuntu2) ...
Setting up keyutils (1.5.2-2) ...
root@01:/etc/skel# mount -t cifs //192.168.1.5/tool_utils /mnt/ -o username=pttien
Password: 
root@01:/etc/skel# cd /mnt/
root@01:/mnt# ls
0  01_Production  temp
root@01:/mnt# 




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success


[WHAT] thế nào là ./configure? make? make install?

Trong thế giới U[Li]nix, chuẩn phân phối các package dưới dạng tarball. Khi tarball được giải nén, gần như chắc chắn, bạn sẽ tìm thấy một tập tin "README" hoặc[và] tập tin "INSTALL" ở trong thư mục đó. Bạn nên đọc, đó là chỉ dẫn rất hữu dụng. Thông thường, bạn sẽ thực hiện cài đặt theo các bước sau:

./configure
make
make install


./configure
Cấu hình ứng dụng/phần mềm cần cài đặt để đảm bảo hệ thống có đủ chức năng, thư viện cần thiết để quá trình biên dịch thành công.

make
Biên dịch tất cả các tập tin mã nguồn vào trong tập tin dạng nhị phân có thể thi thành được.

make install
Cài đặt các tập tin nhị phân trên và các tập tin phụ kèm theo vào thư mục được cài đặt.




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success

Google Chrome sync behind the firewall

Google requires https to authenticate your profile with their server. If not, the sync don't work. Therefore, please make sure the firewall don't blocked 443 port.

A little shit!!!

How to bypass the firewall?

I will bypass :D




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] useradd: unable to open password file

Hello Buddy,

In the mid night I have just found what is needed. It's simple.

When I created/deleted/modified an account in CentOS 6, I'm getting error:

userdel: cannot open /etc/passwd

Damn, I tried to fix it  but ... 

At the moment, my buddy call me that invite me out for lunch. I temporarily forget it. Let's go!

After come back home. Laptop, I need to start it to resolve a little shit.

And it make me happy when I solved the problem.

You can fix the following me.

[root@centos01 ~]# userdel -r dtdong
userdel: cannot open /etc/passwd
[root@centos01 ~]#
[root@centos01 ~]# userdel dtdong
userdel: cannot open /etc/passwd
[root@centos01 ~]# chattr -ai /etc/passwd
[root@centos01 ~]#
[root@centos01 ~]# userdel -r dtdong
userdel: cannot open /etc/shadow
[root@centos01 ~]#
[root@centos01 ~]# chattr -ai /etc/shadow
[root@centos01 ~]# userdel -r dtdong
userdel: cannot open /etc/group
[root@centos01 ~]# chattr -ai /etc/group
[root@centos01 ~]# userdel -r dtdong
userdel: cannot open /etc/gshadow
[root@centos01 ~]# chattr -ai /etc/gshadow
[root@centos01 ~]# userdel -r dtdong
[root@centos01 ~]#

Happy =))

That may mean that your /etc/passwd file is not set properly for access. Therefore, you must to use the chattr command to set properly for access.

Why? What is chattr?

I will explain about chattr command. Chattr attribute is used to stop accidentally delete of files and folders. You can not delete the files secured via chattr attribute event though you have full permission over files. This is very use full in system files like shadow and passwd files which contains all user information and passwords.

Syntax for chattr command is

#chattr [operator] [switch] [file name]

The operator "+" causes the selected attributes to be added to the existing attributes of the file. "-" causes them to be removed, and "=" causes them to be the only attributes that the files have.

-R
Recursively change attributes of directories and their contents. Symbolic links encountered during recursive directory traversals are ignored.

-a
set can only be open in append mode for writing. Only the superuser can set or clear this attributes.

-i
A file with the "i" attributes cannot be modified, cannot be deleted or renamed, no link can be created to this file and no data can be written to the file. Only the superuser can set or clear this attributes.




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] add samba user?

Step 1: You create an operating account.

useradd hensiberg

Step 2: The smbpasswd utility to create a samba password for the user.

sudo smbpasswd -a hensiberg

Step 3: Add a user to a Samba share

[sharing]
comment = forever and one
path = /data/share
valid users = hensiberg tiger
public = no
writable = yes

Step 4: Restart the samba

service smbd restart

or

service smbd reload

Now you can access the samba shares.




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] kick off samba users?

Tiger: Do you need to kick off samba users?

Heineken: Yup, I need. I have some folder sharing on Samba. Now I don't want to share.

Tiger: Okay, you use smbstatus to find the Process ID. Then, you kill those PIDS.

Heineken: Oh it's simple. Why me don't think :D

Example:

root@##:/media# smbstatus

Samba version 3.6.3
PID     Username      Group         Machine                        
-------------------------------------------------------------------
13578     culi          culi          g##-laptop-hai (10.10.19.53)
13359     culi          culi          a##-pc     (10.10.20.84)

Service      pid     machine       Connected at
-------------------------------------------------------
IPC$         13359   a##-pc      Fri Jan  3 15:47:48 2014
Tiger        13578   g##-laptop-hai  Fri Jan  3 14:51:47 2014
Tiger        13359   a##-pc      Fri Jan  3 14:48:07 2014

No locked files

root@##:/media# 
root@##:/media# kill -9 13578
root@##:/media# smbstatus

Samba version 3.6.3
PID     Username      Group         Machine                        
-------------------------------------------------------------------

Service      pid     machine       Connected at
-------------------------------------------------------

No locked files

root@##:/media# 




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] fix the error: "E200 - Your LDAP & Windows (AD) password cannot be change, please contact the administrator"

Hi Buddy,

Today, user inform us that they can not change password and give error alert:
  • "E200 - Your LDAP & Windows (AD) password cannot be change, please contact the administrator".

User don't remember the password. They tell us that the reset password for them. We reset (1st), they use default password to reset continuously (2nd).

After investigated, we know a bit: "Minimum Password Age (3600 Seconds = 1 hours) in Password Policy. It means the password can not change more than 1st per hour.

Okay, we known the problem. We must edit minimum password age to resolve. However, I have a question: Should we change the configuration Password Policy?

No. We don't change. We should engineering about tech stuff, not only disable functions.

Ordinary, user don't know that they need. Therefor, please force them.




Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success