[HOW TO] create terminal shortkey on Fedora 21

Hello,


I just need a shortkey for terminal on Fedora Workstation 21. I could not found it as default of operating system.

What I did?

I create it for me. Simply, you also can.

The first, you come to Keyboard setting:

Press Windows button on keyboard to show Search screen of Fedora, type Keyboard and choose Keyboard (View and change keyboard ...)

Keyboard windows appears, here you choose Shortcuts tab. Go to Custom Shortcuts, add a new:

Name: terminal
Command: gnome-terminal 

Click Apply button. You see the field is Disabled. Now you must type the shortkey as you want. E.g. Ctrl + Alt + T to finish.

Enjoy :)

-
Tien

[HOW TO] change hostname in Fedora 21

Today is a better day and you want to change hostname.

But ... how to change?

Okie, let's follow!

In this article, we use the hostnamectl command to change.

1. Get the now information
[root@localhost itien]# hostnamectl
   Static hostname: localhost.localdomain
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: 7432f328ffd84358a2400130ef7bb0ec
           Boot ID: c4c08e6c2eaa4e1a9a7279285ab12502
  Operating System: Fedora 21 (Twenty One)
       CPE OS Name: cpe:/o:fedoraproject:fedora:21
            Kernel: Linux 3.17.8-300.fc21.x86_64
      Architecture: x86-64


2. Change hostname as you want.
[root@localhost itien]# hostnamectl set-hostname --pretty 201407MON0042
[root@localhost itien]# hostnamectl set-hostname --transient 201407MON0042
[root@localhost itien]# hostnamectl set-hostname --static 201407MON0042


3. Re-check hostname
[root@localhost itien]# hostname
201407MON0042


-
Tien

[HOW TO] install the rpm auto install dependencies

Morning,

I am a newbie with Fedora. A long time before I used the CentOS as system administrator with a little administrative.

Yesterday I re-installed my computer with Fedora 21. Today morning I must use KingOffice to write the Documentation. And I?

Install the KingOffice, but ...

[itien@localhost Downloads]$ rpm -Uvh wps-office-9.1.0.4945-1.a16p3.i686.rpm
error: Failed dependencies:
    libICE.so.6 is needed by wps-office-9.1.0.4945-1.a16p3.i686
    libSM.so.6 is needed by wps-office-9.1.0.4945-1.a16p3.i686
    libX11.so.6 is needed by wps-office-9.1.0.4945-1.a16p3.i686
    ......

    libz.so.1 is needed by wps-office-9.1.0.4945-1.a16p3.i686
    libcups.so.2 is needed by wps-office-9.1.0.4945-1.a16p3.i686
    libpng12.so.0 is needed by wps-office-9.1.0.4945-1.a16p3.i686


Googled, I knows the solution to resolve. I need a repositories on local.

1. Create a directory for local repository e.g. /home/itien/repo
2. Move the rpms package into here
3. Set ownership and firesystem permissions:
#chown -R your_user:your_user /home/user/repo

4. Install the createrepo package
[itien@localhost ~]$ sudo yum install createrepo_c.x86_64 createrepo_c-devel.x86_64 createrepo_c-libs.x86_64
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * fedora: ftp.kaist.ac.kr
 * rpmfusion-free: mirror.bjtu.edu.cn
 * rpmfusion-free-updates: mirror.bjtu.edu.cn
 * rpmfusion-nonfree: mirror.bjtu.edu.cn
...
---> Package sqlite-devel.x86_64 0:3.8.7.4-1.fc21 will be installed
--> Running transaction check
---> Package popt-devel.x86_64 0:1.16-5.fc21 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

#createrepo /home/user/repo
#chmod -R o-w+r /home/user/repo

5. Create a repository configuration

#vi /etc/yum.repos.d/itien.repo

[local]
name=your_name_repo
baseurl=file:///home/user/repo
enabled=1
gpgcheck=0

6. Now you can install the rpm package which you can not install before.
#yum install your_rpm_package

-
Tien

[HOW TO] change the Java default in Ubuntu?



Hello,



I am come back here. Today we are having the scenario follows:

On computer, Java JRE 6update 45 already installed. Now we want to install more Java JRE 7update10 for testing. I wondered how to change the Java default?

And, ... here are reply

For Java :
update-alternatives --config java 

For Java compiler :
update-alternatives --config javac 
For Java web start :
update-alternatives --config javaws

Example:


Using update-alternatives you can manage multiple jdk libraries on the same system, choosing which one you want to use as the main one. First you have to install an alternative for the new installed
:

root@TP-M9999:/home/pttien# update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jre1.6.0_45/bin/javaws 1

root@TP-M9999:/home/pttien# update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).

Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/jre1.6.0_25/bin/java 1 auto mode
* 1 /usr/lib/jvm/jre1.6.0_25/bin/java 1 manual mode
2 /usr/lib/jvm/jre1.6.0_45/bin/java 1 manual mode
Press enter to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/lib/jvm/jre1.6.0_45/bin/java to provide /usr/bin/java (java) in manual mode
root@TP-M9999:/home/pttien#
root@TP-M9999:/home/pttien# java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Client VM (build 20.45-b01, mixed mode, sharing)


At any time you can see what alternatives you have for java or javac using the --list option: 
root@TP-M9999:/home/pttien# update-alternatives --list java
/usr/lib/jvm/jre1.6.0_25/bin/java
/usr/lib/jvm/jre1.6.0_45/bin/java

 
Okay! now the Java default is 6update45.

-
Tien

[HOW TO] download RPM without installing



Hello,





Maybe you want to download RPM pakage and do not install them with "yum". You can follows:


# yum install yum-plugin-downloadonly
# yum install --downloadonly puppet


Aloso you download to a directory:

#yum imstall --downloadonly --downloaddir=/tmp/ package_name

-
Tien

[HOW TO] change time-zone settings from the command line in Ubuntu

Morning beloved,

I have changed the time zone for girl beautiful and I think I should write the little guide.

Simply, you do as follows:

Press Ctrl + Alt + T to open the terminal.
You must root permission to execute.

#dpkg-reconfigure tzdata

Here you change as you want with time zone.

Also you can do as follows:

Come to /etc and edit timezone file
#vi /etc/timezone

Example: I am using the Ho Chi Minh time, I input: Asia/Ho_Chi_Minh

Hope this help you!
-
Tien