Archive

Archive for December, 2014

Linux Probe / List Hardware

December 22, 2014 Leave a comment

dmidecode – tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format.This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision

[root@m backup]# dmidecode --type slot
# dmidecode 2.12
# SMBIOS entry point at 0x000f0480
SMBIOS 2.8 present.

Handle 0x001C, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE16X
	Type: x16 PCI Express x16
	Current Usage: Available
	Length: Long
	ID: 1
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

Handle 0x001D, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE1X
	Type: x1 PCI Express x1
	Current Usage: Available
	Length: Short
	ID: 2
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

Handle 0x001E, DMI type 9, 17 bytes
System Slot Information
	Designation: PCIE4X
	Type: x4 PCI Express x4
	Current Usage: Available
	Length: Short
	ID: 3
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

Handle 0x001F, DMI type 9, 17 bytes
System Slot Information
	Designation: PCI1
	Type: x1 PCI
	Current Usage: Available
	Length: Short
	ID: 4
	Characteristics:
		3.3 V is provided
		Opening is shared
		PME signal is supported
	Bus Address: 0000:ff:1f.7

lshw – tool to extract detailed information on the hardware configuration of the machine. It can report exact memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, bus speed, etc. on DMI-capable x86 or IA-64 systems and on some PowerPC machines (PowerMac G4 is known to work).
blkid – locate/print block device attributes

[root@m backup]# blkid -p -n ext3,ext4 /dev/sda1
/dev/sda1: UUID="4ea235a9-2db2-3a11-856a-2cd7f27d75ff" VERSION="1.0" TYPE="ext4" USAGE="filesystem" PART_ENTRY_SCHEME="dos" PART_ENTRY_TYPE="0x83" PART_ENTRY_FLAGS="0x80" PART_ENTRY_NUMBER="1" PART_ENTRY_OFFSET="2048" PART_ENTRY_SIZE="1024000" PART_ENTRY_DISK="8:0"

lspci – utility for displaying information about PCI buses in the system and devices connected to them.
hwinfo – to probe for the hardware present in the system. It can be used to generate a system overview log which can be later used for support.

last, lastb – show listing of last logged in users
findfs – find a filesystem by label or UUID
findmnt – find a filesystem

or install inxi

[root@mar ~]# inxi -v 3
System:    Host: mar Kernel: 3.10.0-123.13.1.el7.x86_64 x86_64 (64 bit gcc: 4.8.2) Desktop: MATE 1.8.1
           Distro: CentOS Linux release 7.0.1406 (Core)
Machine:   Mobo: ASUSTeK model: U46E v: 1.0 serial: NB-1214556190
           Bios: American Megatrends v: U46E.204 date: 05/17/2011
CPU:       Dual core Intel Core i5-2410M (-HT-MCP-) cache: 3072 KB
           flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 9178
           clock speeds: max: 2900 MHz 1: 2860 MHz 2: 2699 MHz 3: 2741 MHz 4: 2699 MHz
Graphics:  Card: Intel 2nd Generation Core Processor Family Integrated Graphics Controller bus-ID: 00:02.0
           Display Server: X.org 1.15.0 drivers: intel (unloaded: fbdev,vesa)
           tty size: 237x63 Advanced Data: N/A for root
Network:   Card-1: Intel Centrino Wireless-N + WiMAX 6150 driver: iwlwifi v: in-tree: bus-ID: 02:00.0
           IF: wlp2s0 state: down mac: 30:15:c1:54:38:6c
           Card-2: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet
           driver: atl1c v: 1.0.1.1-NAPI port: a000 bus-ID: 04:00.0
           IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: 11:da:e1:15:4c:cd
Drives:    HDD Total Size: 750.2GB (53.9% used) ID-1: model: ST9750423AS
Info:      Processes: 288 Uptime: 2 days Memory: 5619.5/7733.8MB Init: systemd runlevel: 5 Gcc sys: 4.8.2
           Client: Shell (bash 4.2.451) inxi: 2.2.16 

View current linux network driver:

[root@mar ~]# dmesg | grep 'enp4s0'
[    1.291293] systemd-udevd[284]: renamed network interface eth0 to enp4s0
[   21.056761] atl1c 0000:04:00.0: atl1c: enp4s0 NIC Link is Up
[ 4312.360231] device enp4s0 entered promiscuous mode

Get detailed info on driver:

[root@mar ~]# modinfo atl1c
filename:       /lib/modules/3.10.0-123.13.1.el7.x86_64/kernel/drivers/net/ethernet/atheros/atl1c/atl1c.ko
version:        1.0.1.1-NAPI
license:        GPL
description:    Qualcom Atheros 100/1000M Ethernet Network Driver
author:         Qualcomm Atheros Inc., 
author:         Jie Yang
srcversion:     D7C51AE9EAEA06DE7F10568
alias:          pci:v00001969d00001083sv*sd*bc*sc*i*
alias:          pci:v00001969d00001073sv*sd*bc*sc*i*
alias:          pci:v00001969d00002062sv*sd*bc*sc*i*
alias:          pci:v00001969d00002060sv*sd*bc*sc*i*
alias:          pci:v00001969d00001062sv*sd*bc*sc*i*
alias:          pci:v00001969d00001063sv*sd*bc*sc*i*
depends:        
intree:         Y
vermagic:       3.10.0-123.13.1.el7.x86_64 SMP mod_unload modversions 
signer:         CentOS Linux kernel signing key
sig_key:        DE:D3:BD:6A:08:F8:8B:A9:1C:08:E3:20:34:E4:D1:E0:1F:1A:EB:2D
sig_hashalgo:   sha256
Advertisements
Categories: linux Tags: ,

Virtualbox clone linux

December 22, 2014 Leave a comment

Remove or move /etc/udev/rules.d/70-persistent-net.rules from master machine.

Shutdown and clone master machine (select reinitialize mac card). Boot new machine.

Regenerate uuid for network card:

[root@localhost ~]# uuidgen eth0
6c63c2af-16b5-4df0-a153-afc347a06ce6

Edit ifcfg-eth0 ,enter new mac address and UUID on clone machine:

[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=08:00:27:8F:D6:C6
TYPE=Ethernet
ONBOOT=yes
BOOTPROTO=none
IPV6INIT=no
USERCTL=no
NM_CONTROLLED=yes
PEERDNS=yes
IPADDR=192.168.1.153
NETMASK=255.255.255.0
UUID=6c63c2af-16b5-4df0-a153-afc347a06ce6

Change hostname and gateway if required

[root@localhost ~]# vim /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.1.1

Reboot clone machine

Centos 7 low screen resolution problem

December 16, 2014 Leave a comment

somehow after upgrading one of my laptops to centos 7 my second monitor stuck to 1024×768 resolution. This is how i solved it:

Create the new resolution

[marko@marko ~]$ cvt 1280 1024 75
# 1280x1024 74.90 Hz (CVT 1.31M4) hsync: 80.30 kHz; pclk: 138.75 MHz
Modeline "1280x1024_75.00"  138.75  1280 1368 1504 1728  1024 1027 1034 1072 -hsync +vsync

Declare new resolution with xrandr

xrandr --newmode "1280x1024_75.00"  138.75  1280 1368 1504 1728  1024 1027 1034 1072 -hsync +vsync

Add new resolution to VGA1 (my second monitor)

xrandr --addmode VGA1 1280x1024_75.00

Create layout script and run

[marko@marko ~]$ cat layout.sh 
#!/bin/sh
xrandr --output HDMI1 --off --output LVDS1 --mode 1366x768 --pos 0x0 --rotate normal --output DP1 --off --output VGA1 --mode 1280x1024_60 --pos 1366x0 --rotate normal

Logitech m570 Centos 7 review

December 5, 2014 Leave a comment

Easiest way to change side buttons (or any other button in that matter) behaviour for logitech m570 trackball mouse under linux is xbindkeys.

Unfortunately this package is not available for centos 7 ( i do not know why  or if its replaced with another mechanism )  google search return absolutely no results.

So to get around this problem you have to install :

xautomation-1.07-3.fc19.x86_64.rpm
xbindkeys-1.8.5-4.fc19.x86_64.rpm

These are fedora 19 packages but works under centos 7. You can not install fedora 20 or 21 packages as they require libpng16.so.16 and that package is not available under centos as well

After you install above packages create .xbindkeysrc file under your home directory and paste below lines:

"xte 'key Page_Up'"
b:9

"xte 'key Page_Down'"
b:8

now start xbindkeys

[bakim@marko ~]$ xbindkeys

and test your mouse your side keys will act as key up and key down

Also with this setup side keys will act as back and forward button in firefox if you click them while you are holding scroll wheel.

Some useful xte key codes, this keys are case sensitive:

Home
Left
Up
Right
Down
Page_Up
Page_Down
End
Return
BackSpace
Tab
Escape
Delete
Shift_L
Shift_R
Control_L
Control_R
Meta_L
Meta_R
Alt_L
Alt_R