Blogs
managing private files in Drupal
Posted August 13th, 2008 by EvanI am currently working on a small Drupal contract and part of the work is to allow files to be attached to content that only a particular user can see (User A); the trick is that the person uploading the files (User B) isn't the person that should be allowed to see them.
This technique requires a few settings and modules to work.
Setup Drupal to serve files privately, not through HTTP in admin/settings/file-system
Ensure you have the following modules installed and enabled: CCK, FileField (a CCK file field), ACL (access control lists) and Content Access.
Create a new CCK content type and in the Access Control tab enable "Enable per node access control settings" for that content type
Enable "administer access control" for the user/role of the person uploading the files
Create a new node using the CCK content type and once published change the access permissions on the node to allow only User A to see the files.
Done!
This seems to be working so far but I have more testing to do.
- Evan's blog
- Login or register to post comments
DNS Cache Poisoning Attacks on your ISP
Posted August 1st, 2008 by EvanA bit more than a month ago a DNS attack was reported by Dan Kaminsky that stated there was a fundamental problem with the DNS protocol that could result in web site requests being sent to the wrong location. This is a great opportunity for phishing and other evil doer's to grab personal information without our knowledge.
I decided to use the tool on his web site to test if my ISP (Northwestel) had patched their DNS servers to better protect against this particular attack. I clicked on the button that says "Check My DNS" and was presented with a potential failure notice as follows:
Your name server, at 216.108.8.8, appears vulnerable to DNS Cache Poisoning.
All requests came from the following source port: 50341
...
I wonder when Northwestel will update their DNS servers to protect against this issue?
Check your own ISP at the above link and see if they are doing any better. Leave comments to the failure/success of the test!
Tips for Lllllllloyd
Posted July 27th, 2008 by EvanLlllllllloyd IM'd me to ask for my top 3 tips of using OS X so I figured it would be a quick and short post. I have 3 sections instead: OS Tips, Apps I Use, Etc!. These are only valid for Leopard 10.5.2+.
.:OS Tips:.
Get a mouse with many buttons and set the non useful ones (e.g. beyond left/right/middle) to things like show desktop, show Spaces (a.k.a virtual desktops), show all windows of app. Very useful.
I don't use TimeMachine. I do regular backups with CarbonCopyCloner. This reminds me to donate some funds to the project...
I am not paranoid enough to turn on FileVault but I do use the screensaver password utility.
I have a UPS plugged into my Mac so it will gracefully shutdown when (not if) the power goes out.
Install Bonjour on Windows clients and you can do printer sharing with 2 clicks on the Mac.
.:Apps I Use:.
I use apps that have lots of goodness and/or Mac'ness baked in so ports of Windows apps and ugly Java apps really need to kick bottom for me to use them. Cool doesn't cut it for me.
Email/RSS feed management: GMail and Reader - I just find it easier to keep it all online (or in the cloud as the cool kids says these days) than sync with various products. Mail is nice but meh, Calendar is nice but meh, Address Book is really lacking.
Skype: IM & Voice calling
AdiumX: Instant messaging for everyone
VoodooPad Lite: a personal wiki, still kicking the tires on this one to see if I should buy it or not (i.e. do I use it regularly)
Firefox3 and Safari: some sites don't like one or the other. FF3 wins on plugins/extensibility and Safari wins on native OS integration.
VirtualBox: for free virtualization - it runs Ubuntu Server 8.04 lovely
AppFresh: keeps everything up to date or at least lets me know when I am lagging
OpenOffice 3 Beta: works, a bit buggy, definitely an early beta in the classical sense
.:Etc!:.
I will not use MobileMe/.Mac. It costs too much and doesn't offer a compelling feature set for me to use. I am savvy enough to emulate the functionality through other means or just don't need the tools they offer at that price point.
iPhoto: you will either love it or not. I love it but wish it had better metadata gathering functionality.
I really like our HP printer it works great with OS X.
Always, Always, Always buy AppleCare. Always.
- Evan's blog
- Login or register to post comments
Running Ubuntu in VirtualBox on OS X 10.5/Leopard
Posted July 24th, 2008 by EvanI am now consulting for myself and one of the things that I need to have is a test Linux box to play with. I am also lazy and do not want to maintain yet another computer (with it's associated costs) so I immediately turned to my good friend, virtualization. This also came around because my Leopard MySQL, PHP and Apache configuration is not working very well these days.
I had heard VirtualBox (1.6.2) had recently acquired Mac OS X support so I decided to give the platform a spin on my Intel-based iMac and report the results.
Installation
Easy as download, mount the disk image and run the installer.
Configuration
I wanted to create a new Ubuntu installation so I grabbed the latest Ubuntu server ISO. While that was downloading I started to configure the new VM image. The wizard walked me through the steps fairly painlessly but I do have to admit to being a bit confused by some of the defaults selected. I had to boost the amount of RAM allocated to the image to 512MB. I had to ensure I enabled PAE/NX (for Ubuntu to even start) and I also had to use NAT (Network Address Translation) to for network connectivity as the other options do not work with OS X yet, or at least that is what the documentation says. Once I had my image configured I set the guest VM's CD/DVD drive to point to the ISO image I downloaded, set the drive boot order to CD/DVD first and Blamo! I was installing Ubuntu.
Quick Caveats
The use of NAT for the networking makes for some headaches if you want to actually talk to the Guest VM from the host VM, as I wanted to do - this is my LAMP test box after all, and it requires the use of port forwarding on the Guest VM.
The documentation is a little light on how this is done on OS X so for my future referral the commands I ran are as follows:
- Shut down the guest VM
- Open the Terminal application and change directory to /Applications/VirtualBox.app/Contents/MacOS
- At the command line run the following commands to enable port forwarding, using the VBoxManage command. I am forwarding SSH, MySQL's ports and Apache. In essence you setup a port on the Host that will forward into the guest VM. The name guesthttp that I am using is meaningless; I used guesthttp for HTTP (Guest port 80 to Host port 8080), guestssh for SSH (Guest port 22 to Host port 2222) and guestsql for MySQL's port (Guest port 3306 to Host 3306). It is not advisable to forward to ports below 1024 if you are not running as root. My Guest VM's name is "Linux Test Box" - original, I know. Repeat for each protocol you wish to access on the Guest VM.
evan@foo /Applications/VirtualBox.app/Contents/MacOS
$VBoxManage setextradata "Linux Test Box" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/Protocol" TCP
VirtualBox Command Line Management Interface Version 1.6.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.evan@foo /Applications/VirtualBox.app/Contents/MacOS
$VBoxManage setextradata "Linux Test Box" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/GuestPort" 80
VirtualBox Command Line Management Interface Version 1.6.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.evan@foo /Applications/VirtualBox.app/Contents/MacOS
$VBoxManage setextradata "Linux Test Box" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guesthttp/HostPort" 8080
VirtualBox Command Line Management Interface Version 1.6.2
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.
After I made these changes and restarted the guest VM I was able to setup a Drupal 6 install with no problems. It is visible at http://localhost:8080 and is running entirely on an Ubuntu server install. I get the bonus of running a true LAMP install that can be instantly restored to a previous running state as well as the great features of Ubuntu! All for free.