Tips Thinkpad X220 – Debian Jessie

Graphics

To make graphical boot work (for example using plymouth-drm), enable modesetting in /etc/modules:

i915 modeset=1

and then run update-initramfs -u.

Laptop-mode-tools

If you use laptop-mode-tools, you will need the following in /etc/laptop-mode/conf.d/lcd-brightness.conf to configure the brightness of the screen:

BATT_BRIGHTNESS_COMMAND="echo 3000"
LM_AC_BRIGHTNESS_COMMAND="cat /sys/class/backlight/intel_backlight/max_brightness"
NOLM_AC_BRIGHTNESS_COMMAND="cat /sys/class/backlight/intel_backlight/max_brightness"
BRIGHTNESS_OUTPUT="/sys/class/backlight/intel_backlight/brightness"

and the following in /etc/laptop-mode/conf.d/cpufreq.conf to use the correct CPU governors:

BATT_CPU_GOVERNOR=powersave
LM_AC_CPU_GOVERNOR=performance
NOLM_AC_CPU_GOVERNOR=performance

Credits

How to Delete stuff using the ‘del’ key in Kali / Debian / Gnome

If you want to move a selected item(s) to Wastebasket, press Ctrl and Delete together.

If you want to permanently delete a selected item, press Shift and Delete together.

If you want to use Delete key to move a selected item(s) to Wastebasket,

edit ~/.config/nautilus/accels file

( example: gedit ~/.config/nautilus/accels )

look for ; (gtk_accel_path "<actions>/DirViewActions/Trash" "<primary>Delete") </primary></actions>

uncomment by removing the semicolon and change to the command you want to use. e.g. (gtk_accel_path "<Actions>/DirViewActions/Trash" "Delete")

Credits

How to setup multimedia on CentOS 7

You will need to also install the EPEL repository as nux-dextop depends on this for some of its packages.

Step 1: Install the nux-dextop repository

Run this command to install the nux-dextop repository.

yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm

Step 2: Install the adobe repository

Run this command to install the adobe repository.

yum -y install http://linuxdownload.adobe.com/linux/x86_64/adobe-release-x86_64-1.0-1.noarch.rpm

Step 3: Install the desired packages

This command will download the flash plugin for Firefox.

yum install flash-plugin

This command will download the java plugin for Firefox.

yum install icedtea-web

This command will install Handbrake, VLC and smplayer.

yum install vlc smplayer ffmpeg HandBrake-{gui,cli}

The following command installs a decoder and codecs which are required to play certain types of media. Their usage may be legally restricted in some areas. Obtain legal advice if you are uncertain about the laws in your locality.

yum install libdvdcss gstreamer{,1}-plugins-ugly gstreamer-plugins-bad-nonfree gstreamer1-plugins-bad-freeworld

Final note

Notice that you have the CentOS, Nux-Dextop and Adobe repos enabled by default and there should be no issues with running "yum update" or "yum upgrade" in the future.

TipsAndTricks/MultimediaOnCentOS7 (última edição 2014-10-23 15:25:55 efetuada por TrevorHemsley)

Microsoft’s Core Fonts

Get Microsoft's Core Fonts for the Web and Cleartype Fonts

For Redhat, Fedora, Centos, SUSE, Mandrake, Yellowdog, and any linux distro that uses RPM
 
How to INSTALL
 
Make sure the prereqs are there.  Except for cabextract, these prereqs are likely already installed on your system.
 
yum install curl cabextract xorg-x11-font-utils fontconfig
 
Install the fonts
 
rpm -i https://downloads.sourceforge.net/project/mscorefonts2/rpms/msttcore-fonts-installer-2.6-1.noarch.rpm
 
Credits: http://mscorefonts2.sourceforge.net

How to remove “Ubuntu” in the bios boot menu? (UEFI)

Install efibootmgr:

sudo apt-get install efibootmgr

Then add to the kernel efi support

sudo modprobe efivars

Then run sudo efibootmgr to check your boot entries. It will return something like this:

BootCurrent: 0004
Timeout: 2 seconds
BootOrder: 2001,0003,0005,0006,0000
Boot0000* Lenovo Recovery System
Boot0001* EFI Network 0 for IPv6 (B8-88-E3-84-F3-EF)
Boot0002* EFI Network 0 for IPv4 (B8-88-E3-84-F3-EF)
Boot0003* Windows Boot Manager
Boot0004* EFI USB Device (SanDisk)
Boot0005* ubuntu
Boot2001* EFI USB Device

Then delete the option you dont want. In this example, Ubuntu is entry 5. the following could be called to delete entry 5 and remove it from the BootOrder.

(CAUTION: Before executing the following command make sure you enter the correct Boot entry number)

sudo efibootmgr -b 5 -B 

Further details described here: http://linux.die.net/man/8/efibootmgr

Note: as for anything that changes your bootloader, please ensure you have a good disk image that you can boot with.

Crossover or Straight through cable?

                      Hub        Switch        Router        Workstation

Hub                 C             C            S                 S

Switch             C             C            S                 S

Router             S             S            C                 C

Workstation    S             S            C                 C

 

S – Straight

C – Crossover

 

Same devices = Crossover

Different devices = Straight

Console = Rolled

Credits

Monitoring Windows hosts with Nagios on Debian GNU/Linux

1. Install necessery nagios debian packages

apt-get install nagios-images nagios-nrpe-plugin nagios-nrpe-server nagios-plugins nagios-plugins-basic nagios-plugins-standard
nagios3 nagios3-cgi nagios3-common nagios3-core

2. Edit /etc/nagios-plugins/config/nt.cfg

In the File substitute:

define command { command_name check_nt command_line /usr/lib/nagios/plugins/check_nt -H '$HOSTADDRESS$' -v '$ARG1$' }

With:

define command {
command_name check_nt
command_line /usr/lib/nagios/plugins/check_nt -H '$HOSTADDRESS$' -p 12489 -v $ARG1$ $ARG2$
}

3. Modify nrpe.cfg to put in allowd hoss to connect to the Nagions nrpe server

vim /etc/nagios/nrpe.cfg

Lookup inside for nagios’s configuration directive:

allowed_hosts=127.0.0.1

In order to allow more hosts to report to the nagios nrpe daemon, change the value to let’s say:

allowed_hosts=127.0.0.1,192.168.1.4,192.168.1.5,192.168.1.6

This config allows the three IPs 192.168.1.4-6 to be able to report for nrpe.

For the changes to nrpe server to take effect, it has to be restrarted.

debian:~# /etc/init.d/nagios-nrpe-server restart

Further on some configurations needs to be properly done on the nrpe agent Windows hosts in this case 192.168.1.4,192.168.1.5,192.168.1.6

4. Install the nsclient++ on all Windows hosts which CPU, Disk, Temperature and services has to be monitored

Download the agent from http://sourceforge.net/projects/nscplus and launch the installer, click twice on it and follow the installation screens. Its necessery that during installation the agent has the NRPE protocol enabled. After the installation is complete one needs to modify the NSC.ini
By default many of nsclient++ tracking modules are not enabled in NSC.ini, thus its necessery that the following DLLs get activated in the conf:

FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll

Another requirement is to instruct the nsclient++ angent to have access to the Linux installed nagios server again with adding it to the allowed_hosts config variable:

allowed_hosts=192.168.1.1

In my case the Nagios runs on Debian Lenny (Squeeze) 6 and possess the IP address of 192.168.1.1
To test the intalled windows nsclient++ agents are properly installed a simple telnet connection from the Linux host is enough:

5. Create necessery configuration for the nagios Linux server to include all the Windows hosts which will be monitored

There is a window.cfg template file located in /usr/share/doc/nagios3-common/examples/template-object/windows.cfg on Debian.

The file is a good start point for creating a conf file to be understand by nagios and used to periodically refresh information about the status of the Windows hosts.

Thus it’s a good idea to copy the file to nagios3 config directory:

debian:~# mkdir /etc/nagios3/objects
debian:~# cp -rpf /usr/share/doc/nagios3-common/examples/template-object/windows.cfg /etc/nagios3/objects/windows.cfg

A sample windows.cfg content, (which works for me fine) and monitor a couple of Windows nodes running MS-SQL service and IIS and makes sure the services are up and running are:

define host{
use windows-server ; Inherit default values from a template
host_name Windows1 ; The name we're giving to this host
alias Iready Server ; A longer name associated with the host
address 192.168.1.4 ; IP address of the host
}

define host{
use windows-server ; Inherit default values from a template
host_name Windows2 ; The name we're giving to this host
alias Iready Server ; A longer name associated with the host
address 192.168.1.4 ; IP address of the host
}

define hostgroup{
hostgroup_name windows-servers ; The name of the hostgroup
alias Windows Servers ; Long name of the group
}

define hostgroup{
hostgroup_name IIS
alias IIS Servers
members Windows1,Windows2
}

define hostgroup{
hostgroup_name MSSQL
alias MSSQL Servers
members Windows1,Windows2
}

define service{
use generic-service
host_name Windows1
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

define service{ use generic-service
host_name Windows1
service_description Uptime
check_command check_nt!UPTIME
}

define service{ use generic-service
host_name Windows1
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}

define service{
use generic-service
host_name Windows1
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
define service{
use generic-service
host_name Windows1
service_description C: Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}

define service{
use generic-service
host_name Windows1
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

define service{
use generic-service
host_name Windows1
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}

define service{
use generic-service
host_name Windows2
service_description NSClient++ Version
check_command check_nt!CLIENTVERSION
}

define service{ use generic-service
host_name Windows2
service_description Uptime
check_command check_nt!UPTIME
}

define service{ use generic-service
host_name Windows2
service_description CPU Load
check_command check_nt!CPULOAD!-l 5,80,90
}

define service{
use generic-service
host_name Windows2
service_description Memory Usage
check_command check_nt!MEMUSE!-w 80 -c 90
define service{
use generic-service
host_name Windows2
service_description C: Drive Space
check_command check_nt!USEDDISKSPACE!-l c -w 80 -c 90
}

define service{
use generic-service
host_name Windows2
service_description W3SVC
check_command check_nt!SERVICESTATE!-d SHOWALL -l W3SVC
}

define service{
use generic-service
host_name Windows2
service_description Explorer
check_command check_nt!PROCSTATE!-d SHOWALL -l Explorer.exe
}

define service{ use generic-service
host_name Windows1
service_description SQL port Check
check_command check_tcp!1433
}

define service{
use generic-service
host_name Windows2
service_description SQL port Check
check_command check_tcp!1433
}

The above config, can easily be extended for more hosts, or if necessery easily setup to track more services in nagios web frontend.
6. Test if connectivity to the nsclient++ agent port is available from the Linux server

debian:~# telnet 192.168.58.6 12489
Trying 192.168.58.6...
Connected to 192.168.58.6.
Escape character is '^]'.
asd
ERROR: Invalid password.

Another good idea is to launch on the Windows host the NSClient++ (system tray) , e.g.:

Start, All Programs, NSClient++, Start NSClient++ (system tray).

Test Nagios configuration from the Linux host running nagios and nrpe daemons to check if the check_nt, can succesfully authenticate and retrieve data generated from the nsclient++ on the Windows host:

debian:~# /usr/lib/nagios/plugins/check_nt -H 192.168.1.5 -p 12489 -v CPULOAD -w 80 -c 90 -l 5,80,90,10,80,90

If everything is okay and the remote Windows system 192.168.1.5 has properly configured and running NSClient++ the above command should return an output like:

CPU Load 1% (5 min average) 1% (10 min average) | '5 min avg Load'=1%;80;90;0;100 '10 min avg Load'=1%;80;90;0;100

In case of the command returns:

could not fetch information from server

instead this means that probably there is some kind of problem with authentication or handshake of the Linux host’s nagios check_nt to the Windows server’s running on 12489.

This is sometimes caused by misconfigured NSC.ini file, however in other occasions this error is caused by misconfigured Windows Firewall or because the NSClient++ is not running with Administrator user.

By the way important note to make about Windows 2008r2 is that if NSClient++ is running there it’s absolutely required to Login with Windows Administrator and run the NSClient++ /start , if it’s run through the Run As Adminsitrator with an admin privileged user the aforementioned error might appear, so be careful.
I’ve experienced this error myself and it took me about 40 minutes to find that I have to run it directly with Administrator user after logging as Administrator.

7. Create nagios web iface Apache configuration

nagios debian pachage is shipped with a config which is suitable to be setdebian:~# cp -rpf /usr/share/doc/nagios3-common/examples/apache2.conf /etc/apache2/sites-avalable/nagios
debian:~# ln -sf /etc/apache2/sites-available/nagios /etc/apache2/sites-enabled/nagios

The /etc/apache2/sites-available/nagios can easily be configured to work on Virtualhost, to do so the above copied file need to be wrapped inside a VirtualHost directive. For that put in the beginning of the file;

<VirtualHost *:80>

and in the end of the file:

<VirtualHost *:80>

8. Restart nagios server and Apache for the new settings to take effect

debian:~# /etc/init.d/apache2 restart
...
debian:~# /etc/init.d/nagios3 restart

If some custom configuration about tracking the Debian Linux nagios host running services needs to be made, its also helpful for one to check in /etc/nagios3/conf.d

Well that’s mostly what I had to do to make the Nagios3 server to keep track of a small Windows network on Debian GNU/Linux Squeeze 6, hope this small article help.

Fonte: pc-freak.net