vineri, 4 octombrie 2013

Building a custom kernel

This example is for Fedora Core 18

I. Install necessary packages:

#su -c 'yum install rpmdevtools yum-utils'
#su -c 'yum install ncurses-devel'
#su -c 'yum install qt3-devel libXi-devel'

II. Get the Source
OBS. Do not build packages as root

1. Prepare a RPM package building environment in your home directory. Run the following command: 

rpmdev-setuptree

2.Download the kernel-<version>.src.rpm file. Enable the appropriate source repositories with the --enablerepo switch. (yumdownloader --enablerepo=repo_to_enable --source kernel)

 
yumdownloader --source kernel

3.Install build dependencies for the kernel source with the yum-builddep command (root is required to install these packages):

su -c 'yum-builddep kernel-<version>.src.rpm'

4. Install kernel-<version>.src.rpm with the following command

rpm -Uvh kernel-<version>.src.rpm


Prepare the Kernel Source Tree

cd ~/rpmbuild/SPECS
rpmbuild -bp --target=$(uname -m) kernel.spec


Preserve the original tree :

export arch=x86_64 # replace x86_64 with your arch
export ver=3.7 # replace 3.1 with your kernel version
export subver=4-204
export fedver=fc16 # replace fc16 with your fedora version
cp -r ~/rpmbuild/BUILD/kernel-$ver.$fedver ~/rpmbuild/BUILD/kernel-$ver.$fedver.orig
cp -al ~/rpmbuild/BUILD/kernel-$ver.$fedver ~/rpmbuild/BUILD/kernel-$ver.$fedver.new



cd ~/rpmbuild/BUILD/kernel-$ver.$subver.$fedver/linux-$ver.$arch/
cp configs/<desired-config-file> .config
make menuconfig

Copy the config file to ~/rpmbuild/SOURCES/:

cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic
cd ~/rpmbuild/SPECS
%define buildid .<custom_text>
rpmbuild -bb --with baseonly --with firmware --without debuginfo \
--target=`uname -m` kernel.spec


Install the new kernel
su -c "rpm -ivh $HOME/rpmbuild/RPMS/<arch>/kernel-<version>.<arch>.rpm"



marți, 1 octombrie 2013

How Do I Export Active Directory User Information To A CSV File?


Exporting all user information
To run CSVDE on a Windows Server running Active Directory, open the command prompt (go to Start > Run, then type cmd and press Enter). Type in the following command:
csvde -m -f AccountName_mailboxes.txt -r "(&(objectClass=*)(mail=*))" -l objectClass,member,displayName,memberOf,proxyAddresses,legacyExchangeDN,title,telephoneNumber,facsimileTelephoneNumber,mobile,homephone,givenName,company,userPrincipalName,co,c,physicalDeliveryOfficeName,postalCode,sn,st,streetAddress,title,wWWHomePage,description,l,initials,info,sAMAccountName
Go back to top
Exporting information from a single organizational unit (OU)
If you want to export only a single organizational unit (OU), type the following command in the command prompt, instead of the one shown above. In the command, change the "OU=,OU=,DC=,DC=,DC=" field to the correct OU that your mailboxes are stored in.
csvde -m -f AccountName_mailboxes.txt -d "OU=,OU=,DC=,DC=,DC=" -r "(&(objectClass=*)(mail=*))" -l objectClass,member,displayName,memberOf,proxyAddresses,legacyExchangeDN,title,telephoneNumber,facsimileTelephoneNumber,mobile,homephone,givenName,company,userPrincipalName,co,c,physicalDeliveryOfficeName,postalCode,sn,st,streetAddress,title,wWWHomePage,description,l,initials,info,sAMAccountName
Go back to top
Finding the name and path of the OU
To get a list of your organizational units that can be used in the command in place of "OU=,OU=,DC=,DC=,DC=", you can issue the following command from the command prompt window:
dsquery ou
Select the OU you would like to start the export for (all sub-units will be exported as well). For more information, please see this TechNet article.
Alternatively, you can use the following method:
  1. Open the Active Directory Users and Computers snap-in.
  2. Find the OU containing the users you want to export.
  3. Starting from the lower level OU, compose a path to the OU. Please see the following example:



In this example, if you wanted to import users from the OU "test", you would replace "OU=,OU=,DC=,DC=,DC=" in the command with:
"OU=test,OU=Hosting,DC=exch015,DC=msoutlookonline,DC=net"
Please note that we do not provide support for CSVDE, dsquery, or any other aspects of data export from your server.