This last week I setup a DNS server for a project at work. I have done it before but there were a couple nuances to where the zone file should be stored and how to have forwarders set by resolvconf on Hardy (8.04). (more…)
Archive for the ‘Technology’ Category
Bind, Resolvconf and Dynamic Updates on Ubuntu Hardy
Thursday, September 3rd, 2009Enhancing Extract in Photoshop (Elements)
Sunday, January 4th, 2009I lately have been using the Magic Extractor in Photoshop Elements 7 to extract people out of pictures for the purpose of putting a new background in place. One thing I disliked was that once I click the Okay button, all decisions were final. There was no way of going back and tweaking the extract. Everything had to be done right the first time. That is why I started doing the following so that my extraction was not on the photograph itself but was in a layer mask. This now allows me to tweak the extraction at any time.
- Open the image from which you wish to extract a person or item from.
- Duplicate the background layer (Layer -> Duplicate Layer).
- Select the background layer.
- Open the Magic Extractor (Image -> Magic Extractor).
- Perform the extraction on the image.
- Add a Solid Color layer below the duplicated layer (Layer -> New Fill Layer -> Solid Color).
- Ctrl-Click on the thumbnail of the background layer in layer palette.
- Click on the layer mask of the solid color layer.
- Be sure that white is selected as the background color and black as the foreground color.
- Use the Fill Bucket to paint the layer mask black.
- Press the Delete key. You will now see your extracted selection in white in the layer mask thumbnail.
- Delete the background layer.
- Select the previously duplicated layer of your image and press Ctrl-G.
Now you have your extracted person in your working view. If you want to tweak the extraction at all, now you just need to select the layer mask and use a paint brush to work the edges. In a layer mask, black makes things become transparent and white makes them become opaque. This technique works with Photoshop as well (with some modifications to the steps).
This can also be used with selections. Instead of using the Magic Extractor, select what you want to keep and use that as the selection in the above steps.
DIY Digital Backdrops
Thursday, December 18th, 2008In my November 30 – December 6, 2008 Photo of the Week, I posted a picture of my son. In that posted photo, I removed the background and placed a backdrop in place to give the appearance that the photo was taken in a studio. The backdrop is one of my own creations and in this post I will describe how I created that backdrop.
- Create a new image preferably larger in resolution than the images it will be used in.
- Add a layer that contains the base color for the backdrop. Think in terms of painting. We will create this base color and then “paint” patches over it.
- Add a second layer with another color you want to see in the backdrop, perhaps a different shade of the base color or a completely different color.
- Add a layer mask to this second layer.
- Make the layer mask the item to be edited.
- Use the selection tool to select a relatively small area of the layer mask. (We will be stretching this selection in following steps.)
- We now need to render clouds in this selection. Most editor’s have the ability to do this. In Photoshop it is under Filters -> Render.
- We now need to transform this selection to stretch it out. It needs to be stretched out to at least fill the image and perhaps stretched beyond that.
- Repeats the steps of creating the second layer for any additional colors you wish to add to the backdrop.
And now you have a backdrop that can be used to add that professional touch to your home studio images. Simply copy the resulting image and paste behind your subject, or copy your subject into this image. Below is the backdrop I used for that POTW.
VServer in Xen
Monday, January 14th, 2008I had heard of it being done. I have a friend doing it. So I decided I would too. It is an interesting idea to run virtualization in virtualization. One argument I have heard for running VServer in Xen is a best of both worlds scenario. VServer uses very little resources for each virtual instance thus allowing for many, many virtual instances to be started. Xen has the ability to perform live migration. The scenario would then be that physical server A has X number of Xen virtual machines running each with Y number of VServer instances. We want to migrate one of the Xen virtual machines to physical server B for load purposes. With Xen that migration is possible and the Y number of VServer instances go with it without skipping a beat.
Xen currently ships with kernel version 2.6.18. I noticed that there was a Debian package for a Xen 2.6.22 kernel which would allow me to use the latest stable code of VServer. I downloaded that package and extracted the three patches it included for patching a vanilla 2.6.22.9 kernel for Xen. I downloaded the VServer patch for 2.6.22.10 and the vanilla kernel 2.6.22.9. I then extracted the kernel and patched it with the VServer patch. That went smooth without any “gotchas.” I then proceeded to patch the kernel with the three Xen patches from the Debian package. There were a few segments that the patch utility was unable to do automatically so I went through and performed them manually. There were relatively simple and straightforward. (Note: There was a one set of segments in ecryptfs that I did not attempt to merge.) After that I configured the kernel to include both the Xen extensions as well as the VServer extensions. Booted the new kernel and was up and running. I tested the VServer extensions by creating and starting a VServer instance running SSH. It all worked like a charm.
I am comtemplating creating a single patch of Xen and VServer for the 2.6.22.9 kernel and posting it here if for no one else but myself. Happy virtualizing.
Ubuntu/Debian Dependency Tree
Monday, December 31st, 2007The Debian package system has some pretty sweet tools written for it. I came across one of these tools that makes visualizing package depenencies possible. apt-rdepends. You can pass a list of packages to it and it will provide all the dependencies for the packages.
This is cool by itself, but apt-rdepends has an option to output the tree in dotty format. Then using dot, you can create a graphical representation of the tree. I’m included an example image of the LVS dependency tree from my custom Ubuntu image. (more…)
Using a VM to add iptables support to Windows
Thursday, August 30th, 2007I began playing around with this idea after looking at how Sieve Firewall manager to achieve this. I could never understand how to use Sieve and I also wanted to add web filtering into the mix. Thus I began to develop and try this out. I started out with setting up a VM in VMware Server. I added two nics to the VM. One nic was setup to bridge with the physical nic and the other was setup on one of the unused vmnets (I used vmnet2). You need to be sure to disable the DHCP server for that network device.
From there, I followed this tutorial on freshmeat.net to setup the bridging, ebtables and iptables to setup a blind proxy. Once that was setup I disabled TCP/IP on the physical NIC. I changed the vmnet2 nic to obtain and address via DHCP. In this setup the vmnet2 will be our gateway to the internet (it obtains and IP address from the router’s DHCP server not from the VM). Since vmnet2 obtains it’s access to the internet via our VM, we can then do what we want to the traffic with iptables. In my case I wanted to redirect ports 80 and 443 to a Dansguardian/Squid proxy setup on the VM.
One catch about this method is that you’ll most likely need to have your computer behind a router. The reason for this is that your PC actually will require two IP addresses from the DCHP server. One for the VM and one for the physical PC. Many ISPs won’t hand out multiple IPs for the same household.
There is another way around that problem if you aren’t able to give your PC two IPs for whatever reason. You can setup the VM to be a NAT router instead of bridging. The Windows setup is the same. The VM will need a DHCP server and a DNS relay. It’s a little more overhead, but it’ll work. In my setup I setup iptables to send all incoming requests from outside to the physical PC so that it could be used as it was used before.
The first method I would say is the preferred method but to each their own.
Asterisk + Exchange 2007 != Unified Messaging
Friday, August 3rd, 2007So, in my last post I praised Microsoft. In this one I’m going to a little bit of bashing. Hold your applause.
Those familiar with Exchange know that in previous version, an Exchange Admin user could log into another mailbox via POP3 or IMAP using the Domain\Username\Mailbox Alias. I was hoping to use this to then setup a IMAP storage for voicemails in Asterisk without having to know each users password. Alas, this is not possible with Exchange 2007. I don’t understand why they removed this feature. I have suspicions that it might be related to their own Unity Messaging solution (but I think that just because it thwarted my attempts of getting some of the same functionality without using their solution).
Asterisk + sipX + Exchange 2007 Unified Messaging
Thursday, July 26th, 2007Now most of the things I discuss on this blog are related to open source. I love open source but I also think that Microsoft has some amazing offerings (thank goodness comments are turned off
). Today I downloaded the Exchange 2007 virtual machine offered from Microsoft for evaluation purposes. My purpose was to try integrating Asterisk voicemail with Exchange using IMAP for unified messaging. While becoming familiar with 2007 (used 2000 and 2003 previously) I came across the Unified Messaging part of 2007. It is simply amazing. Asterisk’s voicemail is on par with it, it is the auto attendant that I can see some nice value with (if you are running an environment based on Exchange anyway). There is a how to on integrating Exchange 2007 with Asterisk. A SIP proxy is needed since Exchange 2007 only talks SIP over TCP and Asterisk only does SIP over UDP.
chan_mobile…Continued
Sunday, June 10th, 2007Well, I finally got around to trying out the new chan_mobile channel for Asterisk. To start off, I’ll explain my hardware in use. My phone is a Nokia 6133. I’m using the trunk versions of Asterisk and asterisk-addons (which contains the chan_mobile module). My bluetooth “host” adaptor is a Trendnet TBW-105UB.
The first step (besides compileing Asterisk) was to pair my phone with my Asterisk server. This proved to be quite difficult. I am using Ubuntu Dapper for my OS. Here is my hcid.conf in case anyone had the same troubles I had. Once paired I started Asterisk. I used the mobile search command to find the Bluetooth Address and port for my phone. I then exited Asterisk, added my phone to mobile.conf and restarted Asterisk. Lo and behold, it worked. Asterisk was the “headset” for my phone. (more…)
chan_mobile
Tuesday, May 29th, 2007Not quite two weeks ago a new channel type was added to asterisk-addons. This new channel is called chan_mobile. It allows a user to connect their Bluetooth enabled cellphone or headset to Asterisk. When a cellphone is connected to Asterisk, Asterisk will then handle incoming calls and can also use the cellphone to make outgoing calls. When a headset is connected, Asterisk can send calls to it and possibly originate calls.
I personally find this to be very cool. I just ordered a Bluetooth USB device so that I can try this out for myself. I’ll report back with the results in the near future, hopefully.