linux
Active Directory authentication in Ubuntu
Submitted by madvip on Fri, 06/20/2008 - 07:29.This article will explain how to log inside a Linux box using Windows Domain credentials. This is especially useful in an enterprise environment. I am assuming that my windows username is james.attard and the domain is called ACME. First of all we install Likewise-Open:
james@madvip.net:~$ sudo apt-get install likewise-open
Now we can try to join the domain ACME with a domain administrator account. I'm assuming that my windows username james.attard is part of the domain admins:
james@madvip.net:~$ sudo domainjoin-cli join ACME james.attard
Joining Ubuntu to a Windows 2003 AD
Submitted by madvip on Thu, 06/19/2008 - 09:12.First of all you need to install the following packages:
* Samba (version 3):
o samba
o samba-common (installed by default)
o smbclient (installed by default)
o winbind
* Kerberos:
o krb5-config
o krb5-user
Edit /etc/samba/smb.conf:
[global] security = ADS realm = mycompany workgroup = mycompany password server = obelix.mycompany wins support = no wins server = 10.0.20.202 invalid users = root # Winbind settings idmap uid = 10000-20000 idmap gid = 10000-20000 # For testing debuglevel = 2
aMSN on Ubuntu
Submitted by madvip on Mon, 03/03/2008 - 09:57.aMSN is a very cool instant messenger software similar to Kopete and Gaim which supports webcam. Infact I decided to install the latest aMSN 0.98b from SVN. The only trouble I encountered is to configure correctly tcl/tk 8.5 to de-uglify the fonts (i.e. using anti-aliasing fonts). I found out that I needed to install the libxft-dev package. You can find more details in this howto - http://ubuntuforums.org/showthread.php?t=84765 .
Compiz-fusion and Java desktop apps
Submitted by madvip on Wed, 02/27/2008 - 13:31.I’m using Ubuntu 7.10 desktop edition with compiz-fusion and modal/emergent java windows are not displayed ( only grey background ) to solve this, I added the following environment var on the bashrc / bash_profile of the computer users that must deal with java display applications
export AWT_TOOLKIT=MToolkit
This solves the visualization of java desktop apps with compiz-fusion.
Being root in Ubuntu
Submitted by madvip on Sun, 02/24/2008 - 13:51.One of the main differences between Ubuntu and other distros, is the use of 'sudo' to do anything as root. You are not allowed to log in as root, however there are times when you need to do multiple operations as the root user. In order to achieve this you must type the following command:
sudo -s
Flush sendmail queue
Submitted by madvip on Fri, 02/22/2008 - 15:18.I just found out about this feature for flushing the sendmail queue. This is useful if, say, your mail server was down all weekend and you JUST CAN'T WAIT for the normal queue flush to occur because you've gone through email withdrawal by not being connected for a couple days. In the event that you, say, just rebuilt your mail server and wanted to make sure everything was working correctly you'd also want to watch the queue as it's processing. Normally you'd just run the following to flush the queue and see the results:
/usr/sbin/sendmail -q -v
Finding services on a subnet
Submitted by madvip on Tue, 02/19/2008 - 17:06.Today I needed to find out where was my old workstation in the company. However I had forgot its IP address - the only thing I remembered is that I had an openssh server open. So I needed to scan all the subnet for that particular service (port 22). This is how I did it:
nmap -p 22 -P0 -sT 10.150.3.0/24
Ubuntu 7.10 Gutsy 64 bit on Nec Versa M370
Submitted by madvip on Tue, 02/19/2008 - 13:58.Last week I decided to part for the 64 bit version mostly for the 'cool factor' - I also chose Ubuntu due to its fast installation process.
My main stumbling blocks where finding a suitable wifi driver and getting the inbuilt webcam to work. I still have a couple of problems to sort out, but they aren't really bothering me that much - the sound is coming only from the front speakers and the headphones don't work. Furthermore I still have to make the fingerprint reader to work.
The following are extracts from my lsusb, lspci, and lsmod:
lsusb:
Ubuntu restricted formats
Submitted by madvip on Sat, 02/09/2008 - 13:20.Ubuntu strives to make all software that meets the licensing terms in the Ubuntu License Policy available. However patent and copyright restrictions complicate free operating systems distributing software to support proprietary formats. If you still want to play most common multimedia formats, including MP3, DVD, Flash, Quicktime, WMA and WMV, including both standalone files and content embedded in web pages, you have to install the restricted formats package.
sudo apt-get install ubuntu-restricted-extras
Script to email changes in a file
Submitted by madvip on Fri, 02/01/2008 - 12:48.Suppose you want to email changes in the Oracle's alert log, or maybe syslog's messages, it would be nice to email new 'tailed' entries. Something like tail -f logfile | mailx ... won't work as tail -f will never pipe any output. The idea is to take a snapshot of the file every x minutes, archive it, take another snapshot after x minutes, diff the two files, and email the changes. Then you roundrobin the snapshot and repeat the whole process:
crontab -l */5 * * * * /usr/local/bin/swatch-action.sh > /dev/null 2>&1 [root]# cat /usr/local/bin/swatch-action.sh

