網頁

2013年7月20日 星期六

Cygwin/X --- Uninstall & Remove Cygwin/X Component and related setting

Due to Cygwin/X never have uninstall facility by Setup tool, we have to do some method manually if need to remove all Cygwin/X component.
How to do it?
Stop and Remove any Cygwin Services
If the Cygwin services (# 1) such as sshd are running, ScreenHunter_02we have to stop all services by using cygrunsrv –E sshd commandScreenHunter_03ScreenHunter_04and uninstall all service by using cygrunsrv –R ssh command.ScreenHunter_05ScreenHunter_06
Delete the Cygwin root folder and all subfolders
Based on the logon account, we will take ownership of the recursive files and folders of the Cygwin installation path by using takeown /r /f c:\cygwin commandScreenHunter_02So does that the status is as follows:
AS-ISScreenHunter_01TO-BEScreenHunter_03
We also have to delegate Full Access to Everyone in the recursive files and folders of the Cygwin installation path by using icacls c:\cygwin /t /grant Everyone:F command.ScreenHunter_05So does that the status is as follows:
AS-ISScreenHunter_04TO-BEScreenHunter_06
In the moment, we can completely delete the cygwin folder and its subfolders by using rmdir /s c:\cygwin command.
ScreenHunter_07
Delete key from registry
Start...Run... regedit and Delete Cygwin keys from registry tree “Computer\HKEY_CURRENT_USER\Software”ScreenHunter_08Delete the system variable (option)
To remove the Environment Variable as 'CYGWIN' if ever create it.ScreenHunter_02Delete the related Account (option)
To remove the related account as cyg_server & sshd if ever create it in the installation process.ScreenHunter_01Until now, the Cygwin/X will be uninstalled clearly.

Reference(# 1) we can know what services are running now by using cygrunsrv –list on the prompt command.ScreenHunter_23

2013年6月29日 星期六

Cygwin/X --- Install Cygwin/X on Windows 8 x64 (part 1)

In general, we use Microsoft Windows as Workstation that connects with Server as Linux(CentOS) for managing system or accessing resource. In X Windows as Gnome environment, we can use some tools as Cygwin/X to remote access. How to do it?

At first, go to Cygwin/X web site http://x.cygwin.com next to download installation package.
ScreenHunter_01After download completion, double-click setup package and launch the Cygwin Setup wizard to install Cygwin/X on my Windows platform. ScreenHunter_02In Choose A Download Source dialog, select Install from Internet option next to click Next > buttonScreenHunter_03In Select Root Install Directory dialog, select Root Directory as default value “C:\cygwin” and Install for someone as All Users or Just Me to use it.ScreenHunter_04In Select Local Package Directory dialog, click Browse button for selecting a local package directory next to click Next > buttonScreenHunter_05In Select Your Internet Connection dialog, select an option as Use Internet Explorer Proxy Settings for contacting with the Internet next to click Next > buttonScreenHunter_06In Choose A Download Site dialog, select an available download site is neighboring with your location next to click Next > buttonScreenHunter_07Due to the Cygwin is installed firstly,we can ignore this Setup Alert message at the moment next to click Ok button to go ahead.ScreenHunter_08According to the Official User guide Installing Cygwin/X ,  we can select some packages as follows and change the value from “Skip” to “special version”.
Net -- > openssh        ※ for using ssh connection to run remote X Client
Net – > inetutils         ※ for using telnet connection to run remote X Client
X11 – > xorg-server                ※for Cygwin/X X Server
X11 – > xinit                         ※ for starting X Server
Of course, we can select the X11 package for using graphic program so that change the value from “Default” to “Install”.ScreenHunter_18In Resolving Dependencies dialog, click Select required package (RECOMMENDED) check bot next to click Next > buttonScreenHunter_19The installation progress is running nowScreenHunter_10To click Finish button to complete installationScreenHunter_11
In the next article, I will introduce How to configure Cygwin setting?

2013年6月22日 星期六

CentOS 6.3 --- Add GNOME Desktop Environment into CentOS Minimal installation

If execute graphical tool on a minimal installation of CentOS 6.3, it will cause the failure that this tool cannot be initialized.
ScreenHunter_01This is why I want to add a GUI to CentOS at the moment.

For installing Gnome Desktop, we can execute the yum command as yum groupinstall basic-desktop desktop-platform x11 fonts to download & install the related packages from Internet.
ScreenHunter_21ScreenHunter_22To start X Windows by typing startx command
ScreenHunter_01The X Windows will show up
ScreenHunter_04and we can initialize the Logical Volume Management now.
If we hope that it started on boot, please remember to change the run level from 3 to 5 in /etc/inittab file.
ScreenHunter_02

2013年6月14日 星期五

MySQL --- How to know the location of the default or custom database

If we are system manager and have to install MySQL on CentOS, we always know the default data directory location will depend on the installed method. For example,
      If install MySQL from a source distribution(*.tar.gz), its default data location is “/usr/local/mysql/var”.
      If install MySQL from a binary distribution, its default data location is “/usr/local/mysql/data”.
      If install MySQL from a RPM file(*.rpm), its default data location is “/var/lib/mysql”.

But if we take over MySQL management after the system and database is installed by someone, how to know the location of default or custom database?

In system console, log on SQL console and type sql command as show databases; to show which databases need to be realized.
ScreenHunter_03According to database path rule, by default all database files are located under the default location as /var/lib/mysql/"db_name", we can use find / –name “db_name” –print command to find out the special database path.
ScreenHunter_06
To do the find command again but change search path from / to found path as /var/lib/mysql/emdp, we can realize whether the file type belong to MySQL data format(*.frm).ScreenHunter_01Finally, if we want to know the default data directory on MySQL now,we can use sql command as SHOW VARIABLES LIKE ‘datadir’;ScreenHunter_04or mysqladmin command as mysqladmin –u root –p variables | grep datadir
ScreenHunter_05

2013年6月2日 星期日

情緒管理應是一門人生須終身學習的課程

凡事需要「三思而後行」,隨著年紀的增長,慢慢有所頓悟!

過去遇到問題時,有時候會因為一時的情緒衝動、自我負面的認定,掩蓋理性的判斷與思維,最終結果將造成不必要的誤會與困惱,甚至有時候是杞人憂天。『輕』者或許需要花時間與金錢擬補裂痕,『重』者可能是情勢無法挽回、形成一輩子的傷害與陰影。

這樣的情緒抒發,是在近期處理老婆車子外觀遭不明人士潑漆與個人保險事宜後有感而發.
幸好老婆個性溫順,沒有因最近學校工地施工所產生的認知,誤會是工人施工不慎、學校宣導與警戒不當而造成,故向學校行政單位要求處理善後。在昨天花了一天時間將車子送去汽車美容,原本以為事情就告一段落,沒想到過了一晚早上要開車時,狀況又發生。經追查發現車子外觀油漆盡然是社區停車格上的水管漏水所造成的!經向社區主任反應,臨時將車子停到其他空位以確保外觀不會再惡化,至於後續處理,就只能等星期一廠商到場查看與修補後再做下一步打算. 可喜的是:至少先前二千元的維護費用是可以要回的,但後續車子是否還要再做一次美容,就等問題處理後再說.

至於個人保險,花了6年時間才認知「投資型保單」不適合我,後續還要再花時間與金錢,買回原來、異動前的保障,真的是有夠貴的學費! 這要怪誰,只能怪自己不夠認真、仔細了解商品箇中差異與優劣,而是全盤交給保險員。當時個人心態只是偷懶、認為保險這種東西個人怎們會懂,應該交給專業保險人員。但保險人員也是人,對事物的解讀人人觀點也是不同,再加上公司有要賺錢,故所推銷的商品因此會有各種不同的考量。但不管如何,這也是自己認同,否則也不會白紙黑字簽下合約,這能怪誰?只能怪自己的無知。

雖然當下有點氣,但畢竟年紀大了,會先靜下心來調整情緒後再來面對它,仔細想想也不能全怪人家。目前只能面對它、處理它,待事情圓滿解決後才能放下它!雖然知道這處理過程需要花時間,但我內心還是很急,希望能儘快將問題解決掉,因為我會掛心睡不著覺,難怪血壓會標高!

2013年5月24日 星期五

CentOS 6.3 --- Maybe need to configure network setting after creating the differencing disk or clone OS

In virtualization environment as Hyper-V or VMware, if we create a VM disk and its type has a parent-child relationship with another disk, maybe we will find out the original network card will disappear after boot VM next to use /sbin/ifconfig command.ScreenHunter_41
When this scenario happens, we have to realize whether the first or others Ethernet network interface card or NIC exist in the system so that use ls /etc/sysconfig/network-scripts command. (#1)
If it exists           we will go to the next steps to confirm something.ScreenHunter_42If it non-exists   we have to create network interface.ScreenHunter_31                           To create a file by using vi /etc/sysconfig/network-scripts/ifcfg-eth0 command and add some word as follows:ScreenHunter_32                            for getting dynamic IPScreenHunter_33                            for setting static IP (# 1)ScreenHunter_03End if
Of course, we also have to confirm whether the duplicated content in the /etc/udev/rules.d/70-persistent-net.rules file exist the wrong network card mapping to MAC.ScreenHunter_43In general, we just need to delete the first row and change NAME’s value from eth1 to eth0 at the second rowScreenHunter_44The final result is as follows:ScreenHunter_45

By add or modify the content in the /etc/sysconfig/network file, we can specify the network configuration as Networking should be configured, hostname set FQDN, set the network gateway and so on.ScreenHunter_40ScreenHunter_42
By using chkconfig  network on command, we will configure the system to automatically start the network function when the system startup.ScreenHunter_49
Finally, please reboot itScreenHunter_47After log on the system, the network function will be normal now.
ScreenHunter_48
Reference :
(# 1)
 In installing Linux Integration Services on Hyper-V 3.0, we can realize whether the network module is loaded successfully by using lsmod | grep vsc command.
(# 2) About name server setting in CentOS 6.3, we don’t need to add or modify the content in /etc/resolv.conf file because it need to set in the /etc/sysconfig/network-scripts/ifcfg-eth0 file.
         If we still do it in /etc/resolv.conf file, the name server setting will disappear after reboot the system.
         As to PEERDNS=no or PEERDNS=yes in the /etc/sysconfig/network-scripts/ifcfg-eth0 file, it don’t influence anything in my testing lab.
Since 2010 Design by Davidwa
©Copyright Davidwa Inc. All rights reserved.