Archive for the ‘ Linux ’ Category

Create a custom application launcher in GNOME3

On Arch, the system-wide shortcuts are stored in /usr/share/applications. Each one is a .desktop file with a few parameters. user-specific icons are stored in ~/.local/share/applications. I downloaded eclipse and extracted it in my home directory, so I’ll use eclipse as the example application.

  1. Create the .desktop file:
    nano ~/.local/share/applications/Eclipse.desktop

    Paste this in:

    [Desktop Entry]
    Encoding=UTF-8
    Version=1.0
    Type=Application
    NoDisplay=false
    Exec=/path/to/eclipse/eclipse
    Name=Eclipse Comment=Launcher for Eclipse

    Each line is pretty self-explanatory. Edit to suit your needs. As soon as you save the file, you will be able to see your new shortcut in the list.

  2. (Optional) Give the shortcut a nice-looking icon:
    You probably noticed that your icon is an ugly diamond. To pretty it up, you simply have to add one more line to the desktop file.

     Icon=/path/to/eclipse/eclipse.

    Your application may have included a png icon, but to make it really look nice, you should grab an SVG file of the logo from somewhere. Arch has a very simple packaging process which lets you examine all of the package building elements through their webpage at http://www.archlinux.org/packages/. I was able to grab the SVG which the package uses like this:

    wget -O eclipse.svg http://projects.archlinux.org/svntogit/packages.git/plain/trunk/eclipse.svg\?h\=packages/eclipse

Prevent samba from creating home directory for machine accounts.

Since this setup automatically creates a home directory for a user as soon as they access the machine (via samba, ssh, console), I noticed some directories being created for computer accounts.  To prevent this,  I have added a line that only “Domain Users” are allowed to authenticate.  To add this:

wbinfo -n "Domain Users"

It will spit out the SID for the Domain Users group. Something like this:

S-1-5-21-((some number))-((some number))-((some number)) Domain Group (2)

Take that number and change the Pam_winbind.so line in /etc/pam.d/common-session to look like this:

session sufficient pam_winbind.so require_membership_of=S-1-5-21-((some number))-((some number))-((some number)

Install Open-VM-tools on Debian 6 squeeze

Installing Open Tools is a nice alternative to managing and installing the tools package that comes with ’s hypervisor products.  It allows you to use APT to manage all the dependencies and updates. Module assistant will recompile the kernel modules for you automatically when you update kernels too.

I have verified that this configuration works under ESXi 4.1.0, 260247 and a new . All of the essential functions like being able to see guest OS information on the Vsphere summary page and performing “Shut Down Guest” and “Restart Guest” all work as expected. If your experiences vary, please leave a comment

This should all be performed by the root user (otherwise prepend ‘sudo’ to the commands if you must use sudo).
The first thing you need to do is add the ‘contrib’ archive to your apt sources config:

nano /etc/apt/sources.list

Add the ‘contrib’ to the end of these source lines. I use the .uchicago.edu repository, so mine look like this on a new install:

deb http://debian.uchicago.edu/debian/ squeeze main contrib
deb-src http://debian.uchicago.edu/debian/ squeeze main contrib

After you save changes to the file, simply update your package list and perform the install:

apt-get update
apt-get install open--tools open--source

You might see an error that looks like this:

Loading open-vm-tools modules: vmhgfsFATAL: Module vmhgfs not found.
 vmmemctlFATAL: Module vmmemctl not found.
 vmsyncFATAL: Module vmsync not found.

Don’t worry, this is because we have not installed the kernel modules for some of the more advanced VMware functions like the vmhgfs file system, Memory Balloon (vmmemctl) Driver, and vmsync, which helps freeze the VM while taking snapshots.
To install these kernel modules, we’re going to use module-assistant. It will compile the modules for your kernel:

module-assistant auto-install open-vm -i

The ‘-i’ puts module assistant into non-interactive mode. It wont ask you to confirm any additional package installs necesarry to set up the build environment.
If you’re running a server without a Graphical environment, you’re finished. If you want features such as automatically adjusting the VM’s monitor resolution or allowing your mouse to seamlessly move between your host system and the VM, you need to install one more package:

apt-get install open-vm-toolbox

Now you won’t need to use CTRL+ALT to switch back and forth.

Tar extract destination folder

Tar can redirect extracted files to a different folder. This can be handy if you want to unpack a tar archive stored on a cd or other read-only media and want to eliminate the step of first copying the archive, extracting it, then deleting the extra tar.  All you have to do is add a ‘-C <target folder>’ to the tar command.   So here’s an example using the tarball:

# tar -C /root -zxvf /media/cdrom0/VMwareTools-8.3.2-257589.tar.gz

This will redirect the extracted files into the /root folder. simple

Brasero, no option for creating ISO

I love . It’s simple, lightweight, and comes with . Recently, when I wanted to back up a disk, was not on the list of formats. As is usual, the issue was a missing package: brasero-cdrkit.

apt-get  brasero-cdrkit

Now, .ISO (ISO9960) will be an available disk format for you under Brasero.