Wednesday, May 02, 2012

Sync Linux Time With Windows Domain Controller Time

If you use a Linux box in a Windows domain environment, you may want to sync its time with the domain's. Here is how:

  • Add domain controller to server pool in /etc/openntpd/ntpd.conf
  • # $OpenBSD: ntpd.conf,v 1.7 2004/07/20 17:38:35 henning Exp $
    # sample ntpd configuration file, see ntpd.conf(5)
    
    # Addresses to listen on (ntpd does not listen by default)
    #listen on *
    #listen on 127.0.0.1
    #listen on ::1
    
    # sync to a single server
    #server ntp.example.org
    
    # use a random selection of 4 public stratum 2 servers
    # see http://twiki.ntp.org/bin/view/Servers/NTPPoolServers
    # and http://www.pool.ntp.org/
    server your_domain_controller
    #server 0.debian.pool.ntp.org
    #server 1.debian.pool.ntp.org
    #server 2.debian.pool.ntp.org
    #server 3.debian.pool.ntp.org
    
  • Add '-s' to DAEMON_OPTS in /etc/default/openntpd (from man page: "-s     Set the time immediately at startup if the local clock is off by more than 180 seconds.  Allows for a large time correction, eliminating the need to run rdate(8) before starting .")
  • # /etc/default/openntpd
    
    # Append '-s' to set the system time when starting in case the offset
    # between the local clock and the servers is more than 180 seconds.
    # For other options, see man ntpd(8).
    DAEMON_OPTS="-s -f /etc/openntpd/ntpd.conf"
    

Re-configure After Ubuntu Upgrade

Some of my configuration/customization were lost after the upgrade. So, I have to bring them back manually.

Install proprietary video driver

  • Press System → Administration → Hardware Drivers.
  • Press Activate to enable the driver. You may be asked to enter your password.
  • Wait for the proprietary driver to be downloaded and installed.
  • Restart your computer to finish enabling the driver.

Change default editor

  • ~$ update-alternatives --config editor

Restore configuration files


  • /etc/sudoers

Got Ubuntu 12.04 Today

I was excited to hear Ubuntu 12.04 (Precise Pangolin) released! and decided to upgrade my Oneiric Ocelot as soon as I can. I was too frustrated with Compiz crashed and restarted every day. Hope that Precise Pangolin will solve this problem.

The update went very well and the first boot seem to be error free

:~$ cat /var/log/boot.log 
fsck from util-linux 2.20.1
/dev/sda1: clean, 339922/14999552 files, 6707324/59986688 blocks (check in 4 mounts)
rpcbind: Cannot open '/run/rpcbind/rpcbind.xdr' file for reading, errno 2 (No such file or directory)
rpcbind: Cannot open '/run/rpcbind/portmap.xdr' file for reading, errno 2 (No such file or directory)
 * Starting mDNS/DNS-SD daemon                                                                                                                                          [ OK ]
 * Starting bluetooth daemon                                                                                                                                            [ OK ]
 * Starting network connection manager                                                                                                                                  [ OK ]
 * Stopping Userspace bootsplash                                                                                                                                        [ OK ]
Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox
Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd
 * Starting CUPS printing spooler/server                                                                                                                                [ OK ]
 * Starting AppArmor profiles                                                                                                                                           [ OK ] 
 * Stopping System V initialisation compatibility                                                                                                                       [ OK ]
 * Starting System V runlevel compatibility                                                                                                                             [ OK ]
 * Starting GNOME Display Manager                                                                                                                                       [ OK ]
 * Starting xinetd daemon                                                                                                                                               [ OK ]
 * Starting ACPI daemon                                                                                                                                                 [ OK ]
 * Starting anac(h)ronistic cron                                                                                                                                        [ OK ]
 * Starting save kernel messages                                                                                                                                        [ OK ]
 * Starting regular background program processing daemon                                                                                                                [ OK ]
 * Starting deferred execution scheduler                                                                                                                                [ OK ]
 * Starting automatic crash report generation                                                                                                                           [ OK ]
 * Starting CPU interrupts balancing daemon                                                                                                                             [ OK ]
 * Stopping GNOME Display Manager                                                                                                                                       [ OK ]
 * Starting LightDM Display Manager                                                                                                                                     [ OK ]
 * Starting crash report submission daemon                                                                                                                              [ OK ]
 * Stopping anac(h)ronistic cron                                                                                                                                        [ OK ]
 * Stopping save kernel messages                                                                                                                                        [ OK ]
 * Exporting directories for NFS kernel daemon...                                                                                                                       [ OK ] 
Some quick observations on the new version:
  • It gets to login screen faster 
  • It shutdowns and restarts faster
  • More beautiful login screen
  • fglrx does not work :-( (solution here)
  • [    20.477] (EE) fglrx(0): atiddxDriScreenInit failed, GPS not been initialized.
    [    20.477] (WW) fglrx(0): ***********************************************************
    [    20.477] (WW) fglrx(0): * DRI initialization failed                               *
    [    20.477] (WW) fglrx(0): * kernel module (fglrx.ko) may be missing or incompatible *
    [    20.477] (WW) fglrx(0): * 2D and 3D acceleration disabled                         *
    [    20.477] (WW) fglrx(0): ***********************************************************
    [    20.477] (II) fglrx(0): FBADPhys: 0xc0000000 FBMappedSize: 0x10000000
    [    20.492] (II) fglrx(0): FBMM initialized for area (0,0)-(1920,8191)
    [    20.492] (II) fglrx(0): FBMM auto alloc for area (0,0)-(1920,1920) (front color buffer - assumption)
    [    20.492] (II) fglrx(0): Largest offscreen area available: 1920 x 6271
    [    20.492] (==) fglrx(0): Backing store disabled
    [    20.492] (II) Loading extension FGLRXEXTENSION
    [    20.492] (==) fglrx(0): DPMS enabled
    [    20.493] (II) fglrx(0): Initialized in-driver Xinerama extension
    [    20.493] (WW) fglrx(0): Textured Video not supported without DRI enabled.
    [    20.493] (II) LoadModule: "glesx"
    [    20.493] (II) Loading /usr/lib/i386-linux-gnu/xorg/extra-modules/extra-modules.dpkg-tmp/modules/glesx.so
    [    20.494] (II) Module glesx: vendor="X.Org Foundation"
    [    20.494]    compiled for 1.4.99.906, module version = 1.0.0
    [    20.494] (II) Loading extension GLESX
    [    20.494] (II) fglrx(0): GLESX enableFlags = 512
    [    20.494] (II) LoadModule: "amdxmm"
    [    20.494] (II) Loading /usr/lib/i386-linux-gnu/xorg/extra-modules/extra-modules.dpkg-tmp/modules/amdxmm.so
    [    20.494] (II) Module amdxmm: vendor="X.Org Foundation"
    [    20.494]    compiled for 1.4.99.906, module version = 2.0.0
    [    20.494] (EE) fglrx(0): XMM failed to open CMMQS connection.(EE) fglrx(0):
    [    20.494] (EE) fglrx(0): XMM failed to initialize
    [    20.494] (WW) fglrx(0): No XV video playback available
    
After several days:
- No more Compiz crash