Change domain name on your Windows 2008 DC

May 9th, 2012

As usual, almost every note in this blog starts from a need I’ve solved and want to share this info with the world.

This time it has been the need to change my Windows 2008 R2 domain name.

The machine is a Domain Controller in my lab, hence I was prepared to go through a painful long process with clumsy and difficult instructions.

Until I found a great hint about the main steps to get you to the point, quick and dirty but straight to a working condition.

Thanking this guy who put down this instructions, I invite you all to click on the link and solve your need in case it is similar to mine.

Lion fresh install – How to retrieve iDVD from Snow Leopard or upgraded Lion on another Mac

February 23rd, 2012

Because all of my Mac systems were upgraded at home were upgraded from Snow Leopard to Mac OS X Lion, I did not noticed that Apple left out of Lion (when freshly installed like on my Mac Mini Server) iDVD and iWeb.

For iWeb not a very big deal since I can user the awesome Wiki3 bundled with the server, but iDVD was  something I used from time to time to create slideshows and movies to be played in standard DVD players (yes, Apple, there are still some around ;) ).

With much surprise, I’ve discovered that iDVD can be “installed” on my Mini Server by proceeding as follows:

  • on your Mac where you still have an iDVD version, right click on the application and select “Compress iDVD”
  • on your Mac in folder /Library/Application Support/iDVD, compress the subfolder Themes using same technique
  • copy the two compressed files on your new Lion and unzip them by double clicking on the compressed files.
  • copy the iDVD package (the one with the blue icon resembling a DVD) in your Applications folder
  • create a folder named iDVD in /Library/Application Support/
  • copy the Themes directory in /Library/Application Support/iDVD folder
  • launch iDVD and enjoy

This blog is BrowserID enabled

February 23rd, 2012

…because I simply love this new authentication technique.

When you install the WordPress plugin, the login screen changes with a small button to perform the BrowserID enabled login:

When you click on Sign in, the verification begins…

et voilà, you’re in your Dashboard!

Of course you need to have a user with email matching the email you’ve registered with BrowserID.

Easy, rather secure, immediate!

Kudos to Mozilla Identity Team!

Ext2/Ext3 Support on MAC OS X Lion

January 26th, 2012

As usual, not that immediate to find a proper answer on the ‘Net, hence I’m providing one here.

While in Snow Leopard was quite easy to see your ext2/ext3 formatted disks via MacFuse and ext2-fuse, in Lion you need to install another fuse fork and select a special option. That new fork is OSXFUSE, which latest release at the time of this post if from December 2011.

The most common symptom indicating you need this is to try mounting an ext2/3 formatted drive and see the following error:

fuse-ext2 /dev/disk3s1 /Volumes/Movies
dyld: Library not loaded: /usr/local/lib/libfuse.2.dylib
 Referenced from: /usr/local/bin/fuse-ext2
 Reason: image not found

During the installation of OSXFUSE, you need to enable MacFuse Compatibility Layer by flagging the appropriate checkbox as shown below:

click to zoom

Once you’re done with this, replug your ext2/3 formatted drive and it’ll automagically mount it in Finder, giving your deserved magnificent user experience of a Mac user ;)

 

 

 

Change Root DN Password on OpenLDAP

December 19th, 2011

Took me BIG time, some hack and research on the internet to find the information contained in this post.

Don’t want to redo it again therefore I “took note” in my universally accessible internet notepad ;)

The problem is the following: when I installed OpenLDAP, I have set a password for my OpenLDAP administrator that I would like to change. Admin account is normally NOT stored in the main LDAP bridge where other accounts are stored, and it is particularly difficult to find good documentation about how to do it.

If you find yourself in the same situation, here a working procedure you can follow (which at least worked on my OpenLDAP running on Ubuntu 10.10).

Although you can type in the password straight in a certain file in cleartext if you have root access to the machine, the more “elegant” way is to use the proper ldapmodify command.

First, we need to find a way to locate the credentials information of the administrator account in the correct database within the LDAP tree.

This can be done using the command:

ldapsearch -LLL -Y EXTERNAL -H ldapi:/// -b  cn=config olcRootDN=cn=admin,dc=example,dc=com dn olcRootDN olcRootPW

(replace olcRootDN value highlighted in blue with the correct value to match your configuration)

This command will return:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
dn: olcDatabase={1}hdb,cn=config
olcRootDN: cn=admin,dc=example,dc=com
olcRootPW: {SHA}ksixAVfgRXavGCpkPefc6hRHL4X=

There are two interesting information we know now:

  1. we need to modify the entry “dn: olcDatabase={1}hdb,cn=config
  2. the current password is hashed with SHA1 algorythm.
    Therefore we need to generate our new password with the same algorythm using the command slappasswd using the syntax
slappasswd -h <the hashing scheme we want to use - for example {SHA}>

The system will then prompt us twice for the new password to use and will finally display the hashed value we’re interested in (example below with password = password)

root@testbox:~# slappasswd -h {SHA} New password:
Re-enter new password:
{SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=

Then we’ll proceed to modify the entry we’ve identified above using the command:

root@testbox:~# ldapmodify -Y EXTERNAL -H ldapi:///

The system will start the listening mode for modifying commands:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0

First, we enter the entry we want to modify:

dn: olcDatabase={1}hdb,cn=config

Second, we type in the parameter we want to modify:

replace: olcRootPW

Third, we type in the new password generated above (copy and paste is MUCH less error prone than manual typing at this point ;) )

olcRootPW: {SHA}W6ph5Mm5Pz8GgiULbPgzG37mj9g=

Hit Enter another time to commit the modification and the following line will appear:

modifying entry "olcDatabase={1}hdb,cn=config"

After this, you can exit the listening mode with CTRL+C and restart the LDAP database service using

service slapd stop
service slapd start

and login now with the new password set.

 

Format file in FAT32 on a Mac

December 15th, 2011

Had a need, found a solution, reporting the procedure here.

First, you need to understand what is the disk name of the device you want to format.

For example, if you have a MacBook Pro and a SD card, this is done using disk utility, selecting the card reader where you inserted the SD card and clicking on Info button to get information about the storage.

Click to enlarge the picture below.

 

Even with an italian screenshot, you can grab that in my example the device name is disk4.

Open Terminal and type the command reported below to proceed with the format:

diskutil partitionDisk /dev/disk4 MBRFormat “MS-DOS FAT32” “2G2Gb

This will create on /dev/disk4 a FAT 32 (MS-DOS FAT16 will do a 16bit one) partition labeled 2G of 2 Gb in size.

Enjoy.

Move running processes to another tty or screen

December 4th, 2011

How many times I did find myself launching a script, or worst, seeing a process running on a system and wishing to take control over it… the answer is too many ;)

Today I’ve found a nice solution at least for Linux systems with the utility reptyr.

While I’m writing this post the package is still in unstable dist, hence not part of the “standard” repositories for a Debian Linux system.

But you can download it using command:

wget http://http.us.debian.org/debian/pool/main/r/reptyr/reptyr_0.3-2_i386.deb

for i386 architecture.

Then, to install

qpkg -i reptyr_0.3-2_i386.deb

And finally you run it.

For example, to bring a process with pid 4242 to your running tty you type:

reptyr 4242

Enjoy!

How to exit screen terminal emulator in Mac

November 17th, 2011

Since I always fail to remember this… ;)

Control+A ==> send commands to screen

Control+A, followed by Control+\ exit the session

 

Getting ATEN USB-to-Serial to work (again) on MAC OS X Lion

November 17th, 2011

This awesome USB to Serial adapter was working perfectly in MAC OS X Snow Leopard, but it did stop when I upgraded to Lion.

Luckily I’ve found good hints on few websites and because I’ve been able to fix it and now I have this working again, I’ve decided to document here how to make it working.

First, you need to download the drivers for MAC OS X 10.6 provided by the vendor.

Then, use the application USB Prober in Mac to find out what is the Vendor ID and Product ID of the adapter you are using.

The screenshot below shows example in my case (click to zoom):

Take not of the decimal values and go edit (with sudo) the file /System/Library/Extensions/ProlificUsbSerial.kext/Contents/Info.plist

Locate the keywords described below:

<key>idProduct</key>
<integer>xxxx</integer>
<key>idVendor</key>
<integer>xxxx</integer>

Replace the xxxx values with the numbers indicated below:

<key>idProduct</key>
<integer>8200</integer>
<key>idVendor</key>
<integer>1367</integer>

Save and close the file.

Execute the following commands:

sudo kextunload ProlificUsbSerial.kext

sudo kextload ProlificUsbSerial.kext

After this, you should be able to find the device cu.usbserial in /dev directory, which is the proof that the adapter is working.

You can then use the command screen cu.usbserial and get your marvelous adapter to work again.

How to Create a Bootable Image of Ubuntu (or any bootable ISO) on a Mac

November 17th, 2011

Found this process well described on Ubuntu website, hence thought it was a good idea to report here also, for future usage.

Note: this procedure requires an .img file that you will be required to create from the .iso file you download.

TIP: Drag and Drop a file from Finder to Terminal to ‘paste’ the full path without typing and risking type errors.

 

1. Download the desired file

2. Open the Terminal (in /Applications/Utilities/ or query Terminal in Spotlight)

3. Convert the .iso file to .img using the convert option of hdiutil (e.g.,hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso)

4. Note: OS X tends to put the .dmg ending on the output file automatically.

5. Run diskutil list to get the current list of devices

6. Insert your flash media

7. Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)

8. Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command; in the previous example, N would be 2)

9. Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example,./ubuntu.img or ./ubuntu.dmg).

▪ Using /dev/rdisk instead of /dev/disk may be faster.

▪ If you see the error dd: Invalid number ’1m’, you are using GNU dd. Use the same command but replace bs=1m with bs=1M.

▪ If you see the error dd: /dev/diskN: Resource busy, make sure the disk is not in use. Start the ‘Disk Utility.app’ and unmount (don’t eject) the drive.

10. Run diskutil eject /dev/diskN and remove your flash media when the command completes

11. Restart your Mac and press alt while the Mac is restarting to choose the USB-Stick