星期四, 5月 17, 2018

Quick kernel compile guide under CentOS 7

1. Download linux kernel source form the following link, linux-4.16.8.tar.xz in this case.
https://www.kernel.org/

2. Install a CentOS 7 as Workstation and choose most of development package set.
Or you could install as follows later.

  • yum update
  • yum install -y ncurses-devel openssl-devel (make gcc bc  grub2, depends on your installation)


3. copy kernel file and extract file as "tar xvf linux-4.16.8.tar.xz"
--> create a linux-4.16.8 folder

4. Then copy /boot/config-3.10xxxxxx to /linux-4-16.8/.config

5. Compile
make oldconfig (this will compare with new config)
make menuconfig
make -j 4

make -j 4 bzImage (user 4 cores to compile, speed up)
make -j 4 modules
make -j 4 install
make -j 4 modules_install

星期三, 3月 23, 2016

CentOS 7 PXE server for legacy and UEFI BIOS client

Basic Requirement



disable selinux (/etc/selinux/config) and reboot
# service firewalld stop ; chkconfig firewalld off
# yum install dhcp tftp tftp-server syslinux vsftpd xinetd

--- For Ubuntu ---
#sudo apt-get install tftp-hpa isc-dhcp-server vsftpd

# cp -a /mnt/CentOS-DVD/* /var/ftp/pub
# mkdir -p /var/lib/tftpboot/pxelinux/pxelinux.cfg
# mkdir -p /var/lib/tftpboot/pxelinux/centos7
# mkdir -p /var/lib/tftpboot/uefi
# cp /var/ftp/pub/images/pxeboot/vmlinuz /var/ftp/pub/images/pxeboot/initrd.img /var/lib/tftpboot/centos7/
# cp /var/ftp/pub/images/pxeboot/vmlinuz /var/ftp/pub/images/pxeboot/initrd.img /var/lib/tftpboot/uefi
# cp /var/ftp/pub/EFI/BOOT/grubx64.efi /var/lib/tftpboot/pxelinux/BOOTX64.EFI
# cp /var/ftp/pub/EFI/BOOT/grub.cfg /var/lib/tftpboot/pxelinux/
# chmod -R 777 /var/lib/tftpboot

PXE environment configuration files


  • file tree under /var/lib/tftp

/var/lib/tftpboot/
/var/lib/tftpboot/pxelinux
/var/lib/tftpboot/pxelinux/centos7
/var/lib/tftpboot/pxelinux/centos7/vmlinuz
/var/lib/tftpboot/pxelinux/centos7/initrd.img
/var/lib/tftpboot/pxelinux/pxelinux.cfg
/var/lib/tftpboot/pxelinux/pxelinux.cfg/default
/var/lib/tftpboot/pxelinux/pxelinux.cfg/efidefault  -> should be able to skip this file
/var/lib/tftpboot/pxelinux/msgs
/var/lib/tftpboot/pxelinux/msgs/boot.msg
/var/lib/tftpboot/pxelinux/pxelinux.0
/var/lib/tftpboot/pxelinux/fonts
/var/lib/tftpboot/pxelinux/fonts/TRANS.TBL
/var/lib/tftpboot/pxelinux/fonts/unicode.pf2
/var/lib/tftpboot/pxelinux/tmp
/var/lib/tftpboot/pxelinux/tmp/grub.cfg
/var/lib/tftpboot/pxelinux/tmp/grubx64.efi
/var/lib/tftpboot/pxelinux/tmp/MokManager.efi
/var/lib/tftpboot/pxelinux/tmp/TRANS.TBL
/var/lib/tftpboot/pxelinux/BOOTX64.EFI
/var/lib/tftpboot/pxelinux/grub.cfg
/var/lib/tftpboot/uefi
/var/lib/tftpboot/uefi/vmlinuz
/var/lib/tftpboot/uefi/initrd.img



  • /var/lib/tftpboot/pxelinux/pxelinux.cfg/default

default 0
timeout 2000
F1 msgs/boot.msg
F2 msgs/expert.msg
prompt 1
display msgs/boot.msg
        label 0
localboot 1
        label 1
kernel centos7/vmlinuz
append initrd=centos7/initrd.img ramdisk_size=65536 inst.repo=ftp://192.168.1.1/pub  ks=ftp://192.168.1.1/pub/ks.cfg


  • /var/lib/tftpboot/pxelinux/pxelinux.cfg/efidefault

#debug --graphics
default=0
#splashimage=/EFI/BOOT/splash.xpm.gz
timeout 5000
#hiddenmenu
title UEFI CentOS 7 Installation
        root (nd)
        kernel /centos7/vmlinuz
        initrd /centos7/initrd.img ramdisk_size=65536 inst.repo=ftp://192.168.1.1/pub  ks=ftp://192.168.1.1/pub/ks.cfg


  • /var/lib/tftpboot/pxelinux/msgs/boot.msg

1. Install Cent OS 7


  • /var/ftp/pub/EFI/BOOT/grub.cfg
*** modify the bottom of config, and left only this "menuentry".

menuentry 'Install CentOS 7' --class fedora --class gnu-linux --class gnu --class os {
        linuxefi /uefi/vmlinuz ip=dhcp inst.repo=ftp://192.168.1.1/pub  ks=ftp://192.168.1.1/pub/ks.cfg
        initrdefi /uefi/initrd.img


  • /var/ftp/pub/ks.cfg  (add this kickstart file manually)
openssl passwd -1 "000000" (run this command to have encryped root password)

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use NFS installation media
url --url="ftp://192.168.1.1/pub/"
# Root password (change the value to the value above)
rootpw --iscrypted $1$JagGKmgC$Mi3cHtb2cIm62SOtbHvxA1
# System authorization information
auth  useshadow  passalgo=sha512
# Use graphical install
graphical
firstboot disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux disabled
# Installation logging level
logging level=info
# System timezone
timezone Europe/Amsterdam
# System bootloader configuration
bootloader location=mbr
clearpart --all --initlabel
part swap --asprimary --fstype="swap" --size=1024
part /boot --fstype xfs --size=200
part pv.01 --size=1 --grow
volgroup rootvg01 pv.01
logvol / --fstype xfs --name=lv01 --vgname=rootvg01 --size=1 --grow
%packages
@core
wget
net-tools
%end
%post
%end


Server settings


  • xinetd + tftp server
    • /etc/xinetd.d/tftp

service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}


  • dhcp server
    • /etc/dhcpd/dhcpd.conf

option arch code 93 = unsigned integer 16; # RFC4578
allow booting;
allow bootp;
subnet 192.168.1.0 netmask 255.255.255.0 {
    option routers 192.168.1.1;
    range 192.168.1.100 192.168.1.200;
    class "pxeclients" {
        match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
        next-server 192.168.1.1;

        if option arch = 00:07 {
            filename "pxelinux/BOOTX64.EFI";
            }
        else {
            filename "pxelinux/pxelinux.0";
        }

    }
}



  • vsftp server

no need to modify vsftpd config file

Service enablement

chkconfig tftp on
chkconfig xinetd on
chkconfig dhcpd on
chkconfig vsftpd on
service xinetd start
service tftp start
service dhcpd start
service vsftpd start

星期五, 8月 07, 2015

Install Nagios on CentOS with DELL iDRAC script

My Nagios version is 3.5.1 and available to download from here.
http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.5.1/

check_iDRAC script could be downloaded from here
https://exchange.nagios.org/directory/Plugins/Network-and-Systems-Management/Check_iDRAC-for-DELL-iDRAC/details

MIB file could be downloaded from here.
http://dezoils.com/wp-content/uploads/2014/11/iDRAC-MIB.zip

-------------------------------------- How-To ----------------------------------

There are 2 systems in this instruction, 1 for CentOS (Host) and 1 for iDRAC device (DUT).

##########  DUT iDRAC port setting
                - connect to idrac web interface (log in of course)
                - in left side, go into the Overview / iDRAC settings / Network
                - in right side (from top panel), choose Services / SNMP Agent
                - make sure "Enabled" is checked
                - make sure "SNMP Protocol" is checked on option "All (SNMP v1/v2/v3)


##########  CentOS (Host)
- Install CentOS 7
                #yum search net-snmp (make sure you can see the package list, it's normal if there is a downloading process)
                #yum install net-snmp net-snmp-utils git -y
                #git clone https://github.com/dangmocrang/check_idrac
                #cd check_idrac
                #mv idrac_2.0b9 idrac_2.0b9.py
                #python idrac_2.0b9.py -h  (please check if it can print out the help page, if yes, the script works).
                copy IDRAC-MIB.mib file as attached to Desktop

                #pwd (confirm the current directly is "/root/check_idrac", if not, please do command "#cd /root/check_idrac")
                #mv idrac_2.0b9 idrac_2.0b9.py
                #python ./idrac_2.0b9.py -H $IP_Address -c public -m /home/dell/Desktop/IDRAC-MIB.mib –n –w mem
                it's very important, you have to get response like
----------------
Memory 1 (DIMM Socket A1) 2.00 GB/1600 MHz: ENABLED/OK [DDR3, Samsung, S/N: 234A70AF]
----------------




########## Nagios Installation
**copy attathed nagios-3.5.1.tar.gz and nagios-plugins-1.4.11.tar.gz to Desktop
su -
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
yum install   httpd php  gd gd-devel gcc glibc glibc-common openssl perl perl-devel make -y
cd /home/dell/Desktop
tar -xvzf nagios
cd nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cp -rvf contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagios /usr/local/nagios/libexec/eventhandlers
htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin   (set the password for "nagiosadmin" user)
systemctl start httpd.service
systemctl start nagios.service
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

cp /home/dell/Desktop/IDRAC-MIB.mib /usr/share/snmp/mibs/
cp /root/check_idrac/idrac_2.0b9.py /usr/local/nagios/libexec/
chown nagios.nagios /usr/local/nagios/libexec/idrac_2.0b9.py
echo "cfg_file=/usr/local/nagios/etc/objects/idrac.cfg" >> /usr/local/nagios/etc/nagios.cfg
touch /usr/local/nagios/etc/objects/idrac.cfg
gedit /usr/local/nagios/etc/objects/idrac.cfg
                - copy & past all contents list below (#### idrac.cfg file ###) into the file
                - then you need to modify $idrac_ip_address to real DUT (idrac) IP Address (there are 2 items)
                - then save it

service nagios restart

*** now you should be able to use Chrome to browse "http://CentOS_IP_Address/nagios/" and log in as user:nagiosadmin and password you just set.


$$$$$$ for multi-DUT (idrac) $$$$$$$$$$$
cd /usr/local/nagios/etc/objects

cp idrac.cfg idrac2.cfg
cp idrac.cfg idrac3.cfg

echo "cfg_file=/usr/local/nagios/etc/objects/idrac2.cfg" >> /usr/local/nagios/etc/nagios.cfg
echo "cfg_file=/usr/local/nagios/etc/objects/idrac3.cfg" >> /usr/local/nagios/etc/nagios.cfg

and you need to modify "/usr/local/nagios/etc/objects/idrac2.cfg,idrac3.cfg...etc" for the following items.
- host_name
- $idrac_ip_address
- command_name
- $idrac_ip_address
- host_name
- check_command
#service nagios restart
$$$$$$






#### idrac.cfg file ###
define host{
        host_name                       idrac-dut
        alias                           iDRAC Server
        address                         $idrac_ip_address
        check_command                   check-host-alive
        check_interval                  1
        retry_interval                  1
        max_check_attempts              5
        check_period                    24x7
        process_perf_data               0
        retain_nonstatus_information    0
        contact_groups                  admins
        notification_interval           1
        notification_period             24x7
        notification_options            d,u,r
        }

define command{
command_name    check-idrac
command_line   python /usr/local/nagios/libexec/idrac_2.0b9.py -H $idrac_ip_address -c public -m /usr/share/snmp/mibs/IDRAC-MIB.mib -n | tee /tmp/test.log
}


define service{
host_name       idrac-dut
service_description     OnlyForTesting
check_command   check-idrac
max_check_attempts      5
check_interval  1
retry_interval  1
check_period    24x7
notification_interval   3
notification_period     24x7
notification_options    w,c,r
contacts        nagiosadmin
contact_groups  admins
        }


-------------------------------------- End of How-To ----------------------------------

星期一, 12月 22, 2014

Ubuntu 14.04 issue of SDIO kernel support (sdhci-acpi)

check reference links below.

http://serverphorums2.rssing.com/browser.php?indx=20361555&item=4129

http://ubuntuhandbook.org/index.php/2014/08/install-upgrade-linux-kernel-3-16/

Simply, update your kernel up to 3.16
2. For 64-bit system:
cd /tmp/

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-headers-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-headers-3.16.0-031600_3.16.0-031600.201408031935_all.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.16-utopic/linux-image-3.16.0-031600-generic_3.16.0-031600.201408031935_amd64.deb

sudo dpkg -i linux-headers-3.16.0-*.deb linux-image-3.16.0-*.deb
Reboot and done.
If for some reason this kernel release doesn’t work properly for you, reboot into previous kernel (Grub -> Advanced -> select previous kernel) and run this command to remove Linux Kernel 3.16:
sudo apt-get remove linux-headers-3.16.0-* linux-image-3.16.0-*
Finally update grub menu:

sudo update-grub

*********** might be useful for realtek rtl8723bs module ************
http://ubuntuforums.org/showthread.php?t=2249936


星期四, 6月 26, 2014

Install Unity8 with touch

Install Unity 8 with touch
install 14.10
apt-get update then upgrade
install unity8-desktop-session-mir
##############
- for unity8 login hangs fix
wget https://launchpad.net/~ci-train-ppa-service/+archive/landing-005/+build/6112664/+files/qtubuntu-sensors_0.6%2B14.10.20140619-0ubuntu1_amd64.deb
and install this fix for unity8
- for unity8 touch fix
mkdir /usr/idc and create a file named /usr/idc/Vendor_04f3_Product_023e.idc
add 2 lines there
device.internal = 1
touch.deviceType = touchScreen
###################
log out and in, then you will see a Unity8-Mir option in login section

Quick note of LXC on Ubuntu 14.10 with X, MIR on Unity7

Install LXC
install lxc
* sudo for all lxc command
lxc-create -t ubuntu -n project-name
## The OS installed here is very limited, only pure rootfs, so most of commands and packages need to be installed manually. And the default user and password is ubuntu.ubuntu##

configuration files
--------------------
/var/lib/lxc/project-name/config
- add mount socket config into it
#lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir
#lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir1

# For mount the X socket and use it
lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,optional,create=dir
lxc.mount.entry = /dev/video0 dev/video0 none bind,optional,create=file
---------------------

Run LXC under default unity7 with X socket
lxc-start -n project-name
install bash-completion
(for tab usage, and need to reboot for enable)
install firefox
$firefox --display=:0
(Or you can do "export DISPLAY=:0)
Now you can see the firefox running on the screen via LXC

Run LXC under default unity7 with MIR socket
install mir-demos
switch to console mode (tty1)
sudo mir-demo-server-shell (will create the mir on tty1)
switch to tty2
change the default socket config, /var/lib/lxc/project-name/config, to
lxc.mount.entry = /tmp/mir tmp/mir none bind,optional,create=dir
create /tmp/mir and MOVE mir_socket from /tmp to /tmp/mir
chmod 777 /tmp/mir/mir_socket
### in container ###
lxc-start -n project-name
install mir-demos
* check /tmp/mir to see if there is a "mir_socket" file.
mir_demo_client_eglplasma -m /tmp/mir/mir_socket
DONE!!!


Unprivileged LXC containers
add below 2 lines in config file
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536

Then, assign yourself a set of uids and gids with:

sudo usermod –add-subuids 100000-165536 $USER
sudo usermod –add-subgids 100000-165536 $USER
sudo chmod +x $HOME

Now create ~/.config/lxc/default.conf with the following content:

lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
And /etc/lxc/lxc-usernet with:

veth lxcbr0 10
And that’s all you need. Now let’s create our first unprivileged container with:


lxc-create -t download -n p1 -- -d ubuntu -r trusty -a amd64

chmod +x for /home/user/.local   and   /home/user/.local/share
the config file will store at $HOME/.local/share/lxc/project-name/config
DONE!!!



reference site
https://www.stgraber.org/2013/12/20/lxc-1-0-your-first-ubuntu-container/


星期三, 10月 30, 2013

Atheros 0036 on ACER Aspire V5-132 with Ubuntu 12.04.2 (issue for ath9k)

This machine has only wifi connection, no wired to connect to Internet.
The worst thing is the native ath9k driver is failed, that means you won't have any resource to connect outside the world..... :(
Thus, here is what I have done for the solution (easy job) to get my wifi back to real life.

1. need a smart phone to share network with usb connection....:)
2. if not, then you may need to have any other same ubuntu 12.04.2 device to download all the packages, then copy to your system. (apt-get download package-name)
3. apt-get update (for updating your source list)
4. apt-get install linux-headers-generic build-essential
(for compiling driver later)
5. download the compat driver from the link below
https://www.kernel.org/pub/linux/kernel/projects/backports/stable/
from the link, you need to find out the package name "compat-drivers-3.9-rc4-2-s.tar.bz2" and download to local.
6. extract file and enter the folder
7. sudo su (easier to do all jobs later)
8. ./scripts/driver-select ath9k
9. make;make install
10. you can reboot and get your wifi back now.


星期一, 5月 27, 2013

Broadcom BCM43142 on Ubuntu 13.04 64bit

download the file: http://jas.gemnetworks.com/debian/po...19-1_amd64.deb
sudo apt-get install linux-headers-generic build-essential dkms
then install the debian package
but you need to install the following stuffs for 13.04
- linux-headers-generic
- bcmwl-kernel-source
then you can use wifi!
ps: This document is just integrate some contents from the other sites.

星期二, 3月 13, 2012

My ubuntu (11.10 Oneiric) on ASUS U41S

I bought a laptop,ASUS U41S, and installed ubuntu 11.10 on it. But found out many issues and record how to fix it listed below. The solution are from my experiences, many links (googling) and references, just integrate all fixes here. Not sure can fit all people using ubuntu on asus.

1. Fan Speed control.
When I power on my laptop with Ubuntu, the fan speed always (or usually) make lots of noises. Then I find a way to make it being quieter, that's lm_sensors. (but maybe still need to refer to power consumption as item 2.)

- Install lm-sensors


2. power consumption (2.5 hrs to 6 hrs)

- Enable ACPI ASPM
edit /etc/default/grub and add pcie_aspm=force
update-grub

#The major eating-power-monster will be the nvidia and unity3D with compiz, so change to 2D first.
- About acpi_call
git clone http://github.com/mkottman/acpi_call.git
cd acpi_call
make
sudo insmod acpi_call.ko # first trying
--> then copy acpi_call.ko to /lib/module/... and depmod -a
./test_off.sh # you can use this script to find out your "parameter" of acpi_call to disable the nvidia h/w

*** build acpi_call in dkms format under 12.10 ***
apt-get install dkms
put acpi_call folder into /usr/src/acpi_call-0.1
modify Makefile and dkms.conf

Makefile
obj-m := acpi_call.o default: $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules clean: rm acpi_call.mod.o acpi_call.o acpi_call.ko
dkms.conf

PACKAGE_NAME="acpi_call"
PACKAGE_VERSION="0.1"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="acpi_call"
DEST_MODULE_NAME[0]="acpi_call"
MAKE[0]="make IGNORE_CC_MISMATCH=1 KDIR=$kernel_source_dir PWD=$dkms_tree/acpi_call/0.1/build"
DEST_MODULE_LOCATION[0]="/kernel/drivers/acpi"
AUTOINSTALL="yes"

build dkms format
sudo dkms add -m acpi_call -v 0.1
sudo dkms build -m acpi_call -v 0.1
sudo dkms install -m acpi_call -v 0.1

(can check the status with "dkms status" command)
and here is the link for reference.
https://wiki.ubuntu.com/Kernel/Dev/DKMSPackaging
http://hybrid-graphics-linux.tuxfamily.org/index.php?title=Acpi_call

---- save these in /etc/rc.local -----
# remove nouveau for nvidia before X
modprobe -r nouveau
# Disable nvidia h/w
modprobe acpi_call
echo "\_SB.PCI0.PEG0.GFX0.DOFF" > /proc/acpi/call
#then reboot, you should have more than 5 hrs power consumption now.

3. Suspend issue (can't fix hibernate yet)
From the solution, looks like the issue caused by usb.
- add the contents below into /etc/pm/sleep.d/20_suspend and chmod to 755
#!/bin/sh
#inspired by http://art.ubuntuforums.org/showpost.php?p=9744970&postcount=19
#...and http://thecodecentral.com/2011/01/18/fix-ubuntu-10-10-suspendhibernate-not-working-bug
# tidied by tqzzaa :)

VERSION=1.1
DEV_LIST=/tmp/usb-dev-list
DRIVERS_DIR=/sys/bus/pci/drivers
DRIVERS="ehci xhci" # ehci_hcd, xhci_hcd
HEX="[[:xdigit:]]"
MAX_BIND_ATTEMPTS=2
BIND_WAIT=0.1

unbindDev() {
echo -n > $DEV_LIST 2>/dev/null
for driver in $DRIVERS; do
DDIR=$DRIVERS_DIR/${driver}_hcd
for dev in `ls $DDIR 2>/dev/null | egrep "^$HEX+:$HEX+:$HEX"`; do
echo -n "$dev" > $DDIR/unbind
echo "$driver $dev" >> $DEV_LIST
done
done
}

bindDev() {
if [ -s $DEV_LIST ]; then
while read driver dev; do
DDIR=$DRIVERS_DIR/${driver}_hcd
while [ $((MAX_BIND_ATTEMPTS)) -gt 0 ]; do
echo -n "$dev" > $DDIR/bind
if [ ! -L "$DDIR/$dev" ]; then
sleep $BIND_WAIT
else
break
fi
MAX_BIND_ATTEMPTS=$((MAX_BIND_ATTEMPTS-1))
done
done < $DEV_LIST
fi
rm $DEV_LIST 2>/dev/null
}

case "$1" in
hibernate|suspend) unbindDev;;
resume|thaw) bindDev;;
esac

星期二, 2月 21, 2012

好玩的,一行列出99乘法表

echo $[{1..9}*{1..9}] | xargs -n9 | column -t

星期四, 1月 12, 2012

Why you cannot make your command or parameter complete by pushing TAB under Ubuntu

Just find out the package name for this function, and keep this info here in case forget this name.
*bash-completion

Who enable this function? The answer is bash script.

1. ~/.bashrc
2. /etc/profile

You can also check which package support this or program it by yourself.
/etc/bash_completion.d

星期一, 5月 09, 2011

Adobe Reader cht fontpack for Ubuntu

- Install adobereader 9 in s/w center
- download the fontpack from [1]
- unpack the fontpack and execute the INSTALL file
- Done

[1] ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.1/misc/

星期一, 7月 26, 2010

How to change the "indicator" default setting, like mail agent

There is no setting option in gconf-editor or panel properties.
But you can just use the file to change the preferred application.

- In /usr/share/indicators/messages/applications/ there are some files, like empathy/evolution/gwibber in my folder by default.
- You can add a "thunderbird" file.
- And add a line in it as "/usr/share/applications/thunderbird.desktop".
- Then~~~you will see the indicator show you "Mozilla Thunderbird" dynamically.

星期五, 7月 23, 2010

Enable/Calibrate touch screen on EeeTop ET1602 for Ubuntu 10.04 (Lucid)

Have a chance to port Lucid on the EeeTop machine. There are some problems in touchscreen and resolution, and here is how to fix it.

1. touchscreen
In Lucid, evdev is the default driver for X input devices, but it's not useful for this type machine. So you need to install the "evtouch" driver, the package name is "xserver-xorg-input-evtouch".

aptitude install xserver-xorg-input-evtouch

Then you need to modify the default xorg.conf (create a new one under /etc/X11/), and below is the details.

--------------------------
Section "ServerLayout"
Identifier "Default Serverlayout"
Screen 0 "Default Screen" 0 0
InputDevice "Touch0"
EndSection


Section "Device"
Identifier "Configured Video Device"
Driver "intel"
Option "monitor-VGA" "VGA"
Option "monitor-VGA1" "VGA1"
Option "NoDCC"
Option "FramebufferCompression" "off"
EndSection


Section "InputDevice"
Identifier "Touch0"
Driver "evtouch"
Option "device" "/dev/input/evtouch"
Option "MinX" "1"
Option "MinY" "1"
Option "MaxX" "4096"
Option "MaxY" "4096"
Option "ReportingMode" "Raw"
Option "Emulate3Buttons" "false"
Option "Emulate3Timeout" "50"
Option "SendCoreEvents" "on"
Option "MoveLimit" "0"
EndSection

Section "Monitor"
Identifier "VGA"
ModeLine "1366x768" 85.600 1366 1430 1542 1798 768 771 777 795 +hsync +vsync
EndSection

Section "Monitor"
Identifier "VGA1"
ModeLine "1366x768" 85.600 1366 1430 1542 1798 768 771 777 795 +hsync +vsync
EndSection

Section "Monitor"
Identifier "Configured Monitor"
ModeLine "1366x768" 85.600 1366 1430 1542 1798 768 771 777 795 +hsync +vsync
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 24
Subsection "Display"
Modes "1366x768"
EndSubsection
EndSection

--------------------------

And also need to add "69-touchscreen.rules" udev rule under /etc/udev/rules.d
notes: check sysfs by the command
udevadm info -ap /sys/class/input/event8

--------------------------
KERNEL=="event*", SUBSYSTEM=="input", ATTRS{idVendor}=="1bfd", ATTRS{idProduct}=="1688", SYMLINK+="input/evtouch"
--------------------------

BTW, explain how I have the right "ModeLine" parameters here.
We can use the "PowerStrip" tool (Windows tool) to have the values.
Below is the link to teach you how to get the right values by PowerStrip.

http://www.x.org/wiki/FAQVideoModes#ObtainingmodelinesfromWindowsprogramPowerStrip

星期一, 3月 15, 2010

Some Linux tips

1. share the shell screen
user a# screen -S test
user b# screen -x test
then both a and b can use the shared shell screen to watch the status.

2. how to show your IP address (a little boring and stupid...^^)
ifconfig | grep "eth0" -A 1|sed '1d'|awk '{print $2}'|awk -F: '{print $2}'

3. how to show your VGA driver name (still need to see /var/log/Xorg.0.log for details)
lspci -v|grep VGA -A 10|grep modules

4. How to clean all gnome panel applet default settings
gconftool-2 --recursive-unset /apps/panel
kill gnome-panel --> it will make gnome-panel refresh again.

-- Need to maintain ---

星期三, 11月 18, 2009

Linux sound architecture - pulseaudio/alsa/codecs

Below is the processes of sound architecture what I know.
Only base on alsa architecture, and be aware OSS is not supported by Linux anymore.
*recording
mic --> audio codec --> audio codec interface (snd_hda_codec) --> alsa kernel driver --> /dev/snd/* --> alsa api --> alsa lib (you can have the different recording type here) --> sound recorder

*playing
totem --> gstreamer --> pulseaudio --> alsa lib --> alsa api --> alsa kernel --> /dev/snd/* --> alsa kernel driver --> audio controller driver --> audio controller --> speaker

** Vocabulary **
gstreamer : for some codecs that default doesn't support, like mp3 or divx.
alsa kernel driver : like soundcore, snd, snd_pcm, snd_timer...etc
audio controller driver : snd_hda_intel
audio codec interface : snd_hda_codec

** notes **
gnome-sound-recorder only support ogg and wav
packages:
helix for realplayer (non-free), and will touch the alsa lib directly.
gstreamer for the others free audio codecs, below lists the main packages.
-gst-plugins-base
contains a basic set of well-supported plug-ins
-gst-plugins-ugly
contains a set of well-supported plug-ins, but might pose problems for distributors
-gst-plugins-bad
contains a set of less supported plug-ins that haven't passed the rigorous quality testing we expect

星期二, 11月 10, 2009

tips or useful diag tools under Linux

* audio
audacity -- professional audio editor
(help to see the audio wave pattern or spectrum)
amixer -- command line mixer tuning program
(another is alsamixer in GUI mode)
arecord -- alsa command line audio recording program

*video
glxgears -- 3D testing tool
(quick to figure out the 3D performance)
xrandr -- command line interface to check and use the video port
(can check the all connecting video interface and output the video signal to dedicate device)

星期五, 10月 02, 2009

where is the Firefox default settings, like cookies

In /home/username/.mozilla/firefox there has a file named "profiles.ini".
This file contains the [Profile0], and that defines which folder will be used for default settings, use "abc" to be example.
That means /home/username/.mozilla/firefox/abc will have lots of files about the firefox settings.
Like cookies, the file is "cookies.sqlite".

星期五, 7月 03, 2009

Useful deploy tool -- DRBL (Clonezilla SE)

My environment is Ubuntu jaunty (9.04).

sudo aptitude install nis dhcp3-server tftpd
sudo ifconfig eth0:1 192.168.0.1 (when system only has 1 nic port)

# import gpg key
wget -q http://drbl.sourceforge.net/GPG-KEY-DRBL -O- | sudo apt-key add -

# add following line into source list
# then aptitude update and install drbl
deb http://drbl.sourceforge.net/drbl-core drbl stable testing unstable

# For setting up system environment, here has lots of setting, and choose which IP to be the PXE interface should be the most important portion.
sudo /opt/drbl/sbin/drblsrv -i
sudo /opt/drbl/sbin/drblpush -i
-----------------------------------
# start to use clonezilla
sudo /opt/drbl/sbin/dcs
# clone the client image
All --> clonezilla-start --> Beginner --> save-disk
# restore the local image to the client
All --> clonezilla-start --> Beginner --> restore-disk

Now you can boot up your client, then it will show you the GRUB menu with deploy option.

星期一, 6月 15, 2009

Change wireless on/off status in general user mode

list some different ways, but need to verify by yourself carefully.

1. silly way....killall nm-applet

2. /etc/acpi/wireless.sh

3. script file by Paul Liu
For old/new version (remark lines are for old version)
#!/bin/sh

#dbus-send --system --type=method_call \
# --dest=org.freedesktop.NetworkManager \
# /org/freedesktop/NetworkManager \
# org.freedesktop.NetworkManager.setWirelessEnabled \
# boolean:false

#dbus-send --system --print-reply --type=method_call \
# --dest=org.freedesktop.NetworkManager \
# /org/freedesktop/NetworkManager \
# org.freedesktop.NetworkManager.getWirelessEnabled

STAT=`dbus-send --system --print-reply --type=method_call \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Get \
string:org.freedesktop.NetworkManager \
string:WirelessEnabled | grep variant | awk '{ print $3 }'`
case "$STAT" in
true)
NEWSTAT="false"
;;
*)
NEWSTAT="true"
;;
esac
dbus-send --system --type=method_call \
--dest=org.freedesktop.NetworkManager \
/org/freedesktop/NetworkManager \
org.freedesktop.DBus.Properties.Set \
string:org.freedesktop.NetworkManager \
string:WirelessEnabled variant:boolean:$NEWSTAT