Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Thursday, November 13, 2014

Isolating CPUs from the general scheduler in Linux.

It could be done using the kernel parameters:

isolcpus=

Format:

<cpu number>,...,<cpu number>

or

<cpu number>-<cpu number>

(must be a positive range in ascending order) or a mixture

<cpu number>,...,<cpu number>-<cpu number>

This option can be used to specify one or more CPUs to isolate from the general SMP balancing and scheduling algorithms. You can move a process onto or off an "isolated" CPU via the CPU affinity syscalls or cpuset.

<cpu number> begins at 0 and the maximum value is "number of CPUs in system - 1".

This option is the preferred way to isolate CPUs. The alternative -- manually setting the CPU mask of all   tasks in the system -- can cause problems and suboptimal load balancer performance.

Taken from /usr/share/doc/kernel-doc-2.6.32/Documentation/kernel-parameters.txt

Boot parameters of the running kernel in Linux

Let's say I need to find out with what parameters did the kernel boot?

The following command will give you the answer:

cat /proc/cmdline

For example:

janeiros@harlie:~$ cat /proc/cmdline
BOOT_IMAGE=/vmlinuz-3.0.0-32-generic-pae root=/dev/mapper/harlie-root ro quiet


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

Thursday, September 11, 2014

Dumping computer’s DMI (SMBIOS) in Linux

dmidecode

dmidecode -t

The SMBIOS specification defines the following DMI types:

       Type   Information
       --------------------------------------------
          0   BIOS
          1   System
          2   Baseboard
          3   Chassis
          4   Processor
          5   Memory Controller
          6   Memory Module
          7   Cache
          8   Port Connector
          9   System Slots
         10   On Board Devices
         11   OEM Strings
         12   System Configuration Options
         13   BIOS Language
         14   Group Associations
         15   System Event Log
         16   Physical Memory Array
         17   Memory Device
         18   32-bit Memory Error
         19   Memory Array Mapped Address
         20   Memory Device Mapped Address
         21   Built-in Pointing Device
         22   Portable Battery
         23   System Reset
         24   Hardware Security
         25   System Power Controls
         26   Voltage Probe
         27   Cooling Device
         28   Temperature Probe
         29   Electrical Current Probe
         30   Out-of-band Remote Access
         31   Boot Integrity Services
         32   System Boot
         33   64-bit Memory Error
         34   Management Device
         35   Management Device Component
         36   Management Device Threshold Data
         37   Memory Channel
         38   IPMI Device
         39   Power Supply
         40   Additional Information
         41   Onboard Devices Extended Information
         42   Management Controller Host Interface

Additionally, type 126 is used for disabled entries and type 127 is an end-of-table marker. Types 128 to 255 are for OEM-specific data.

Keywords can be used instead of type numbers with --type.  Each keyword is equivalent to a list of type numbers:

       Keyword     Types
       ------------------------------
       bios        0, 13
       system      1, 12, 15, 23, 32
       baseboard   2, 10, 41
       chassis     3
       processor   4
       memory      5, 6, 16, 17
       cache       7
       connector   8
       slot        9

Monday, November 11, 2013

screen - screen manager with VT100/ANSI terminal emulation

Ctrl a c - New window
Ctrl a n - Next window
Ctrl a p - Previous window
Ctrl a d - detach
Ctrl a k - Kill window

screen -ls - List sessions
screen -r <number> reattach

Wednesday, October 24, 2012

arping utility in Linux


The arping utility is part of the iputils-arping package in Debian like systems.

It is very useful for finding out if an IP number is already taken in a local network.

The syntax should be:

~$ arping -D -I eth0 -c 3 172.17.12.228
ARPING 172.17.12.228 from 0.0.0.0 eth0
Sent 3 probes (3 broadcast(s))
Received 0 response(s)

No IP in this case.

~$ arping -D -I eth0 -c 3 172.17.12.222
ARPING 172.17.12.222 from 0.0.0.0 eth0
Unicast reply from 172.17.12.222 [00:21:70:6A:EA:48]  0.754ms
Sent 1 probes (1 broadcast(s))
Received 1 response(s)

One IP found.

-D Duplicate  address  detection  mode  (DAD).  See RFC2131, 4.4.1. Returns 0, if DAD succeeded i.e. no replies are received.


Thursday, March 15, 2012

How to check if a processor is capable of 64-bit.

If you are running Linux, open the terminal prompt and run:
grep --color=always -iw lm /proc/cpuinfo
If this command returns lm (Long Mode) as one of the flags, then your processor is capable of 64-bit.
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc pni monitor cx16 lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt

Tuesday, December 13, 2011

Comparison of Solaris OS and Linux for Application Developers

Comparison of Solaris OS and Linux for Application Developers

http://developers.sun.com/solaris/articles/solaris_linux_app.html

Many developers are writing applications to run under the Linux operating system. With the many new features of the Solaris 10 OS, and with the new emphasis Sun has placed on supporting the Solaris OS on AMD and Intel processor-based machines, developers are becoming interested in being able to develop their applications on the Solaris platform. This article examines similarities and differences in the development environments of both operating systems. Someone responsible for porting applications from Linux to the Solaris OS, or programmers with prior Linux experience that want to learn development on the Solaris OS, should benefit from this article.

In this article, the term "Solaris" refers to the Solaris 10 OS (and OpenSolaris), and "Linux" refers to Linux 2.6. Many of the details covered will also apply to earlier versions of Solaris and Linux. The Linux distribution is meant to be generic, though examples have been tested on SuSe 9.1. Also, the article concentrates on applications written using the C programming language, though C++ should behave the same. Since Java technology-based applications should not be making function calls specific to Linux or the Solaris OS, they should be portable as is.

Friday, January 8, 2010

Hardware info in Ubuntu (Linux)

cat /proc/cpuinfo
cat /proc/meminfo
dmesg
lspci