Category Archives: Software

SELinux: AVC denied read for postfix

I recently installed dovecot and postfix (postfix how-to documentation) on a server running an optimized and hardened version of CentOS 5.6 (LAMP):

yum install postfix dovecot system-switch-mail system-switch-mail-gnome

After starting both services:

/etc/init.d/dovecot start
/etc/init.d/postfix start

I noticed several log entries in /var/log/messages:

Aug  1 08:31:49 vps kernel: type=1400 audit(1375518709.556:695): avc:  denied  { read } for  pid=4545 comm="smtpd" name="hosts" dev=sda1 ino=803366 scontext=root:system_r:postfix_smtpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=file
Aug  1 08:31:49 vps kernel: type=1400 audit(1375518709.588:696): avc:  denied  { read } for  pid=4545 comm="smtpd" name="localtime" dev=sda1 ino=803387 scontext=root:system_r:postfix_smtpd_t:s0 tcontext=system_u:object_r:file_t:s0 tclass=lnk_file

Those logs were generated by SELinux, and if I had to guess, that’s what the “hardened” part refers to in the CentOS server image name.

Here is what it does in a nutshell:

By default under a strict enforcing setting, everything is denied and then a series of exceptions policies are written that give each element of the system (a service, program or user) only the access required to function.

Continue reading

How to change your Windows 7 login screen background

Tired of looking at the same ol’ Windows login screen? This guide shows you how to replace the standard Windows login screen background with an image of your choice. It also covers what types of images work best, how to create or find them, and what changes need to be made to the Windows system in order for it to use your new image.

Step 1

First, we have to find and prepare an image that will become our new Windows login background image.

1.1) Find an image that works with your screen resolution

For best results, you’ll want to find an image that meets your screen resolution. You can find that information by right-clicking on your desktop and selecting Screen properties. In the Resolution field you’ll see what your screen resolution is currently set to. It will be something like 1440×900, for example. You can now search through your pictures to see if you have something in that size. The easiest way to tell is to select a picture and then look towards the very bottom of the window for something that reads Dimensions. If you don’t have any images in that size, you can use a photo editing software, such as Photoshop, to crop a larger picture to fit your dimensions, or you can simply Google for a background image that meets those specifications (which is what I usually do). On the left side of the Google search there’s a category called Any size and underneath it, the last item says Exactly…. Just type in your dimensions and it Search to filter the results.

1.2) Ensure the image is less than 245KB in size

Any image that’s larger than 245KB in size will not work, because Windows needs a file that can be quickly loaded during boot — you don’t want to wait any longer for the login screen than you have to — which is why that limitation is in place. To find the size of the image you’ve selected to be your new login background image, you can right-click on the file and select Properties. Look at Size by disk and see what it says. If it has something with MB after the number e.g. 2.1MB, you know it’s too big (1MB = 1,024KB). You can use a photo editing software, such as Photoshop, to save your image in a lower quality, which will significantly reduce the size.

1.3) Rename your image to backgroundDefault.jpg

The image you’ll need should be renamed to backgroundDefault.jpg, which is what Windows will be expecting. Just select the file and hit [F2] on your keyboard to rename your file.

1.4) Move your image to C:\Windows\System32\oobe\info\backgrounds

Open a Windows explorer via [WIN]+[E] and copy the following into the address bar: %windir%\system32\oobe and press [Enter]. Now create a folder in there called info and then create another folder inside info called backgrounds. Now move your image from wherever it currently is — select it, hit [CTRL]+[X] (cut) — to the newly created background folder — press [CTRL]+[V] (paste).

Step 2

Next you’ll be using the registry editor. Please be sure to follow the directions very carefully.

2.1) Open the registry editor

Open the registry editor by hitting [WIN]+[R] (opens run command), then type in regedit and press [Enter]. If the user account control (UAC) appears, simply click on yes.

2.2) Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\Background\OEMBackground

Click on HKEY_LOCAL_MACHINE and hit [CTRL]+[F] and type in OEMBackground. It will take a few seconds to search and once found, confirm that you are in the path listed above.

2.3) Set OEMBackground to 1

If the OEMBackground REG_DWORD exists, double-click it, change the value to 1, and hit OK.

If it doesn’t exist, go to Edit > New > DWORD (32 Bit) Value and call it OEMBackground. Now follow the instructions in the previous sentence.

Step 3

Lastly, reboot your computer and enjoy your new login screen.

If you have any problems or questions, feel free to leave comments below.

Wrong toolbar icons in Microsoft Office (Word, Excel, etc) for Mac

I came across a really bizarre issue on my Mac regarding the toolbar icons in Word (and Excel). For example, the save button now contained an icon of scissors and the up arrow on the scroll bar was now the spell check icon. Needless to say, this mix-up is less than convenient.

I did a bit of research online and found several threads talking about the issue:

You can read about each proposed solution in detail by visiting the respective link above, however what did the trick for me was the following one:

  • Ensure all Microsoft products are quit, including Outlook, Word, Excel, Communicator, etc.
  • Launch Terminal: Applications > Utilities >
  • Type in cd /Library and press ENTER.
  • Type in sudo mv Automator Automator_Old, hit ENTER.
  • Enter your Mac password and hit ENTER again.
  • Launch Microsoft Word.
  • Go to: Help > Check for Updates and then press the “Check for Updates” button.
  • You should now see an update; for me it was update 14.2.5.
  • Quit Microsoft Word and install the update.
  • Go back to Terminal and type: sudo mv Automator_Old Automator followed by your password again.
  • Launch Microsoft Word and your icons should be restored.

I think Microsoft Office tried to update some time ago, but failed. I didn’t worry much about it then, but that could have been the catalyst for the icons getting mixed up. By temporarily moving the Automator folder, it will download and install the update again. After that’s completed, we just move the Automator folder back.

I hope this helps someone else. It definitely beats reinstalling and reconfiguring all Microsoft products again — especially Outlook.

How to get Sass support in Sublime Text

I was working with a few .scss files in Sublime Text 2 today and noticed that it didn’t support Sass syntax out of the box. There’s actually a really awesome Sublime package for installing other packages called Package Control. Here’s how you can get that up and running.

1. Install Package Control

  1. Make sure Sublime Text is closed.
  2. Download Package Control and save it in ~/Library/Application Support/Sublime Text 2/Installed Packages.
  3. Next time you launch Sublime Text, that package is going to be there.

2. Install the Sass/Scss Packages

  1. Open Sublime Text.
  2. Go to Preferences > Package Control.
  3. Type in “Install Packages” and hit ENTER.
  4. Search for “scss” and hit ENTER to install the first package.
  5. After that’s done, you can also get the “sass” package if you need it.
  6. Restart Sublime and you’re set.

If you have any questions, let me know in the comments.