Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

Thursday, September 25, 2014

Java 8 installation on Fedora 14


  1. Download Java SDK/JRE from Oracle: http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html. (I selected the server version).
  2. Extract the files into /usr/local/java. (I created the java directory).
  3. Use the alternatives program to create the necessary links:
    • [root@Fedora-test ~]# alternatives --install /usr/bin/java java /usr/local/java/jdk1.8.0_20/bin/java 20000
    • Run the alternatives config command:
[root@Fedora-test ~]# alternatives --config java
Select the option for Java 8
    • Test it:
[root@Fedora-test ~]# java -version
java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
The following link was useful: http://www.dafoot.co.uk/index.php/menuitemcomputing/linux/101-fedora-12-alternatives-program-to-manage-java-runtimes-jdkjre

Wednesday, April 30, 2014

systemd-analyze - Analyze system boot-up performance

systemd-analyze may be used to determine system boot-up performance of the current boot.

systemd-analyze blame prints a list of all running units, ordered by the time they took to initialize.

SysVinit to Systemd Cheatsheet

http://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet

Wednesday, January 15, 2014

Fedora Full List of Kernel Options

The full list of kernel options is in the file /usr/share/doc/kernel-doc-<version>/Documentation/kernel-parameters.txt, which is installed with the kernel-doc package.

Taken from:
https://fedoraproject.org/wiki/Common_kernel_problems#Getting_the_Full_List_of_Kernel_Options

Friday, August 9, 2013

Fedora 19 sytemctl

systemctl works with not only services but all other unit types, and is a valuable tool when monitoring or troubleshooting a system. It can list all known units, limit the results to a single unit type, show only failed units, or examine unit relationships. The table below shows some useful systemctl features and should help system administrators replace their old workflow in sysVinit.
systemctl command reference
sysVinit commandsystemd commandNotes
service sshd start systemctl start sshd.service Used to start a service (not reboot persistent)
service sshd stop systemctl stop sshd.service Used to stop a service. (not reboot persistent)
service sshd restart systemctl restart sshd.service Used to start and stop a service.
service sshd reload systemctl reload sshd.service When supported, reloads the config file without interrupting pending operations.
service sshd condrestart   systemctl condrestart sshd.service Restarts if the service is already running.
service sshd status systemctl status sshd.service Tells whether a service is currently running.
ls /etc/rc.d/init.d/ systemctl list-unit-files --type=service Lists all available services.
chkconfig sshd on systemctl enable sshd.service Always run the service at this target (runlevel.)
chkconfig sshd off systemctl disable sshd.service Do not automatically run the service at this target (runlevel.)
chkconfig --list systemctl list-units -t service --all Print a table of available services and their status.
chkconfig sshd --list ls /etc/systemd/system/*.wants/sshd.service Lists the targets that will include the service.
chkconfig sshd --add systemctl daemon-reload Used when you create a service file or modify any configuration.
telinit 3 systemctl isolate multi-user.target Move system into another target (change runlevels.)
[no comparable command] systemctl show -p "Wants" multi-user.target Lists units pulled in by a given target.
[no comparable command] systemctl show -p "After" sshd.service Shows dependent services and other targets.
[no comparable command] systemd --test --system --unit=multi-user.target Simulates booting the system to a given target
[no comparable command] systemd-analyze plot > boot.svg Generates a diagnostically useful graphical representation of the boot process.
ps xawf -eo pid,user,cgroup,args systemd-cgls Display control group process tree.

Monday, August 29, 2011

Show ports and the applications bound to them


#!/bin/bash

netstat -lntup \
| awk '/^(tcp|udp)/ {print substr($4, match($4, ":[^:]+$") + 1) "/" $1, substr($NF, 1, index($NF, "/") - 1)}' \
| while read PORT PID
do
        BIN=$(readlink /proc/$PID/exe)
        echo $PORT $PID $BIN
done

Thursday, August 18, 2011

Show hardware info in Fedora

dmidecode -q
less /proc/cpuinfo
lspci
lsusb

Wednesday, July 27, 2011

Delete route in Fedora

route del -net 172.16.9.0 netmask 255.255.255.0 eth3

Wednesday, July 13, 2011

Yum groups and repositories

Yum supports the group commands
  • grouplist
  • groupinfo
  • groupinstall
  • groupremove
  • groupupdate
Groups are read from the "group" xml metadata that is optionally available from each repository. If yum has no repositories which support groups then none of the group operations will work.
  • grouplist
    yum grouplist [hidden]
    
This will list the installed and available groups for your system in two separate lists. If you pass the optional 'hidden' argument then all of the groups which are set to 'no' in the group xml tag.
  • groupinfo
    yum groupinfo groupname
    
This will give you detailed information for each group including: description, mandatory, default and optional packages.
  • groupinstall, groupupdate
    yum groupinstall groupname
         yum groupupdate groupname
    
Despite their differing names both of these commands perform the same function. They will attempt to install/update all of the packages in the group that are of the types 'default' or 'mandatory' (by default). (To change this types of packages edit the value of the group_package_types option in yum.conf.) And they will install any additional dependencies needed by any of the installing/updating packages.
  • groupremove
    yum groupremove groupname
    
This will remove all packages, of any type, in the named group. It will also remove any package that depends on any of these packages.

Tuesday, June 28, 2011

Static routes after restart/reboot in Fedora/RedHat/CentOS

Static routing is the term used to refer to the manual method used to set up routing. An administrator enters routes into the router using configuration commands. This method has the advantage of being predictable, and simple to set up. It is easy to manage in small networks but does not scale well.

Question: How can I save static routes I set up in my Fedora/RedHat/CentOS Linux after I reboot server?

Answer: In Fedora Linux (or RedHat, CentOS) you can set up static routes for certain network interface (for example eth1) by editing file /etc/sysconfig/network-scripts/route-eth1.

For example, you have to save static route added by the following command:

route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.100.1 dev eth1

To do it, just add the following line to /etc/sysconfig/network-scripts/route-eth1:

ADDRESS0=192.168.0.0
NETMASK0=255.255.255.0
GATEWAY0=192.168.100.1

The alternate way of doing it is to put the routes in /etc/sysconfig/static-routes. So the above route would like this like in the static-routes file:

any net 192.168.0.0 netmask 255.255.255.0 gw 192.168.100.1

Where any is specified above you can also set specific interfaces (such as eth1).

Here is the part /etc/init.d/interfaces code:

# Add non interface-specific static-routes.
if [ -f /etc/sysconfig/static-routes ]; then
grep "^any" /etc/sysconfig/static-routes | while read ignore args ; do
/sbin/route add -$args
done
fi

Looks like any must be at the beginning of each line in /etc/sysconfig/static-routes.

/usr/share/doc/initscripts-${VERSION}/sysconfig.txt is a good place to look for these things as well