Drupal Sandbox Project: CAS Username Link

22 Kudos

I’ve just finished working on a new Drupal Sandbox Project: CAS Username Link

This project came about while working on a Single Sign On (SSO) solution. The product I was checking out was CAS. Low and behold, CAS has a Drupal module, aptly named: CAS.

After fiddling around with module and having it not working for a while, I finally realized that each existing Drupal account needed to have a CAS username linked to it. This could be done manually on the user configuration screen, or by running a bulk update on the database to populate the cas_user table. This wasn’t going to work for me since my accounts are creating using LDAP and I need accounts to linked automatically without my involvement. That is why I created CAS Username Link

The process is very simple and was easy to create because of the great work done in the CAS module itself. In fact, it has it’s one API/hooks that I was able to use for my sandbox project.

I hope someone else finds this of use, let me know if you have any questions or concerns involving this Drupal Module.

Note: This module is only for Drupal 7. if someone really needs a Drupal 6 version, I could create it.

Android: Always have your contacts synced

12 Kudos

After this post on Reddit where someone lost all their contacts, it inspired me to remind everyone to set up some sort of contact sync. I personally just use my Google Account to sync my contacts. Basically all you have to do is add your Google Account to your phone. Set it up to sync, and then when you add contacts, choose your Google account instead of the other options like “Phone contact” or “SIM contact”

Now if you ever lose your phone, or it becomes unusable for any reason, at least you will always have your contacts safe and you don’t have to make the obligatory “Send me all your numbers” Facebook post.

Android: Where is the clear all button for my running apps?

15 Kudos

On my Android phone running ICS 4.0.4 if you hold the home button, a list of running apps shows up. Here you can return to the apps by tapping them, or close them by swiping them away. Sounds pretty good, but what if I want to close all of them, which I often do since my phone is getting older and slower on a daily basis.

Please can we have a “kill all” or “clear all” button added to this screen. I can’t be bothered to swipe away 25 open apps, I’m much to important for that.

Edit: So it appears as if this list is less of “running apps” but more a “activity list” I was misinformed by this article where is says:

“…on any screen, you can hold your Home button and a list of all running applications will appear. From here, you can easily tap on one to switch to it, or swipe it away to close to completely. This is also a good way of making sure that an app is really closed when you told it to.”

With all this information, I still believe there should be a button to clear all.

Is there a good way to create redirects when launching a new site?

16 Kudos

I am quickly finding that there is no good way to do this, but this is what I’ve done.

I started with the Google Analytics from my old site and sorted the content by page views.  This gives me my most important information or at least the content that might get the most 404s.  After doing the top 100 (some which I caught through wild cards like this)

RedirectMatch permanent (?i)^/example/content(.*)    http://cvanderlinden.com/example/content

The biggest thing I have learned is that it doesn’t need to be the exact right place, and all I’m trying to do is avoid 404s.

Next after that I selected my entire alias list from the older site with an SQL command.

SELECT `pid`, `src`, `dst`, `language` FROM `url_alias` ORDER BY `dst` ASC LIMIT 10000; 

That gave me over 9700 aliases.  I removed all the duplicates (but left one entry) using excel.  After that, I removed all the ones that I had covered previously.  Then removed all the non important ones.  After I was done I had narrowed it down to about 100 more, and just did it all manually.

As I said, I couldn’t really find a great way to do it, but it was something I had to do.  Good to get it out of the way, and I feel great after finishing it.

Good luck, and if you know of a good way of doing this let me know.

Drupal 7: Installing and Configuring Date iCal to work with Events

23 Kudos

First let’s start by downloading and installing the module: Date iCal

I did this using drush, but you can do it anyway to please.

Now, with the version I was using (7.x-1.1) the timezone handling wasn’t working properly so I applied this patch to correct timezone handling.

Hopefully that get’s permanently fixed in the module soon, and you won’t have to apply the patch anymore.

Next, we need to configure the content type that we want to use the iCal settings.
I all ready have a content type setup with a date field, called “Events”.  If you don’t have one, then you’re going to have to create one.
Then go to the display settings, and turn on “iCal”

Click “Save” and then you need to choose what you want to show up in the iCal file description.  Here is what mine looks like, don’t pay too much attention to this part or how mine differs from yours, I have this setup for different display settings in “Default” display.

Next we are going to add the view functionality in to generate our iCal files.  Create a new view or choose an existing one, and add a “Feeds” section.

First let’s change the path since Views will complain about it with a message, “Display “Feed” uses a path but the path is undefined.”
Change the path option to be calendar/ical/%/calendar.ics
then change the Contexual Filter to be Content: Nid
Should look something like this:

Almost there, just need a couple more settings.
Under the heading Format we need to change RSS Feed to Date iCal Feed

Press Apply and you an leave the settings black or put in what you like.
Next you need to change the Show part, and change it from Content to Date iCal Entities

Click Apply, then you need to chose the field that contains your date information.

Click apply, save your view, and you are ready to get iCal files for your events.

To test your iCal files, get a node ID for an event you have created and then go to the URL http://example.com/calendar/ical/%/calendar.ics except you need to replace example.com with your site, and % with the node ID (nid).

You can integrate this into your theme template files with some code like this.

$nodeid = $node->id;
<a href=”http://example.com/calendar/ical/<?php echo $nodeid; ?>/calendar.ics”>Add to your calendar</a>

Drupal: Making Media: YouTube more user friendly

18 Kudos

I have a client that needs their editors to be able to quickly embed YouTube videos into posts.  Usually one can just do this by copying and pasting embed codes into the source. However in this case, the client required that the user not touch the source code.  Enter Media: YouTube, in conjunction with the Media module this allows the user to paste a YouTube link into the plugin and have the embed code be generated for the user.  Perfect!
However, I find that it’s usability is a little off and needed to be retouched for my purposes.  My two problems:

  1. The icon needs to be changed to a YouTube icon.
  2. The user shouldn’t have to change the current tab over to “Web”

The solution, replace the icon, and remove the “Upload” and “Library” tabs.

Well simple enough, you can just replace the media/images/wysiwyg-media.gif icon with a 16×16 gif like this one:

And then apply this patch I wrote for 7.x-1.x:

Voila, a more usable WYSIWYG YouTube plugin

New computer means time for Ninite.com

13 Kudos

Just got a new laptop today for work and my first stop is always Ninite.com. It’s a quick tool that lets you install a bunch of popular software all within one installer.  It’s extremely efficient, accepts all the liscese terms, chooses directories, skips ads and toolbars, and gets you on your way.  They keep everything updated so when you go there you get the most recent software.  Here is a list of what is one their site as of today.

This list won’t be updated as new versions of software/ninite are released.
Web Browsers
Chrome – Fast Browser by Google 17.0.963.79

Safari – Alternative Browser by Apple 5.1.4

Opera – Alternative Browser 11.61

Firefox – Extensible Browser 11.0

Skype – Internet Telephone

Messenger – Windows Live IM Client 2009 14.0.8117

Pidgin – Multi-IM Client 2.10.2

Digsby – Multi-IM Client Build 30192

Google Talk – Google Talk IM Client

Thunderbird – Email Reader by Mozilla 11.0

Trillian – Trillian IM

AIM – AOL Instant Messenger

Yahoo! – Yahoo! IM Client

iTunes – Music/Media Manager

Songbird – Music Manager

Hulu – Internet TV

VLC – Great Video Player 2.0.0

KMPlayer – Video Player

AIMP – Music Player 2.61.583

foobar2000 – Music Player 1.1.11

Winamp – Music Player

Audacity – Audio Editor 1.3.14 Beta

K-Lite Codecs – Video decoders plus Media Player Classic 8.4.0

GOM – Video Player

Spotify – Online Music Service

CCCP – Video decoders plus MPC 2011.11.11

MediaMonkey – Music Organizer

QuickTime – Video Player 7.7.1

Flash – Flash Player for other browsers

Flash (IE) – Flash Player for Internet Explorer

Java – Java Runtime Environment (JRE) 6 update 31

.NET – Microsoft .NET 3.5 SP1

Silverlight – Microsoft Silverlight 5.0.61118.0

Air – Adobe Air

Shockwave – Shockwave Player

Paint.NET – Image Editor 3.5.10 (requires .NET 3.5 SP1)

Picasa – Photo Manager by Google

GIMP – Open Source Image Editor 2.6.12

IrfanView – Image Viewer 4.32

XnView – Image Viewer 1.98.8

Inkscape – Vector Graphics Editor 0.48.2

FastStone – FastStone Image Viewer 4.6

Office – Microsoft Office 2007 Standard (Trial Version)

OpenOffice – Free Office Suite 3.3.0 (JRE recommended)

Reader – Adobe PDF Reader 10.1.2

SumatraPDF – Lightweight PDF Reader 1.9

Foxit Reader – Alternative PDF Reader

CutePDF – Print Documents as PDF Files 2.8

LibreOffice – Free Office Suite 3.5.1 (JRE recommended)

PDFCreator – Print Documents as PDF Files 1.3.0

Essentials – Great Antivirus by Microsoft 2.1.1116.0

Avast – Avast Free Antivirus 7.0.1426

AVG – AVG Free Antivirus 2012 12.0.1913

Malwarebytes – Malware Remover

Ad-Aware – Free Adware Remover 9.6

Spybot – Spyware Remover 1.6.2

Super – SUPERAntiSpyware Free 5.0.1146

File Sharing
uTorrent – Great BitTorrent Client

eMule – File Sharing Client 0.50a

Dropbox – Great Online Backup/File Sync 1.2.52

Evernote – Online Notes

Google Earth – Online Atlas by Google

Steam – App Store for Games

KeePass – Password Manager 1.21

Everything – Local File Search Engine

Mozy – MozyHome Online Backup

TeamViewer – Remote Access Tool 7.0.12799.0

ImgBurn – Disc Burner

Auslogics – Great Disk Defrag

RealVNC – Free Remote PC Access 4.1.3

TeraCopy – Better File Copy 2.2.7

CDBurnerXP – Disc Burner (requires .NET)

TrueCrypt – Disk Encryption Tool 7.1a

Revo – App Uninstaller/Reverse Ninite 1.93

Launchy – Hotkey Launcher 2.5

Glary – System Utilities

InfraRecorder – Disc Burner 0.52

7-Zip – Great Compression App 9.20

PeaZip – File Compression Tool 4.4

WinRAR – Another Compression Tool 4.11 (Trial)

Developer Tools
Python – Great Programming Language 2.7.2

FileZilla – FTP Client 3.5.3

Notepad++ – Programmer’s Editor 5.9.8

JDK – Java Development Kit 7u2

WinSCP – SCP Client 4.3.6

PuTTY – SSH client 0.62

WinMerge – Compare and Merge Files 2.12.4

Eclipse – IDE for Java 3.7.2 Indigo (requires Java)

So Many options to choose from

Share: 26 Free Retro Fonts

12 Kudos

There are some great free fonts in this post, check it out if you are interested – www.demilked.com/free-retro-fonts/

Apple iPad 3 (iPad HD) Available March 16th

14 Kudos

New and Old Features:

  • Apple Quad-Core A5X processor + graphics
  • Higher Resolution Retina Display 2048 x 1536 for a total 3.1 million pixels
  • 1080p video recording with video stabilization
  • Voice Dictation in six languages – English, British, Australian French, German, Japanese
  • 4G LTE by AT&T, Verizon, Bell, Rogers, and Telus (Other providers outside North America)
  • 3G HSPA+ fallback
  • 10 hours of battery life
  • 1.4 pounds
  • 9.4 mm thin


Wifi Enabled

  • 16 GB – $499 USD ($519 CAD)
  • 32 GB – $599 USD ($619 CAD)
  • 64 GB – $699 USD ($719 CAD)

4G/Wifi Enabled

  • 16 GB – $629 USD ($649 CAD)
  • 32 GB – $729 USD ($749 CAD)
  • 64 GB – $829 USD ($849 CAD)



Drupal 7: WYSIWYG YouTube Embed Tutorial (Media_YouTube)

2 Kudos

Why would you need a YouTube plugin for Drupal? Can’t you just use the embed code?
Yes, yes you can. However, you may run into a client where copying and pasting the embed code becomes too technical.  So lets forget about why we need this and I’ll explain how to get it set up.

After switching over to Drupal 7, I decided to use the WYSIWYG module to implement text editors instead of custom built modules for text editors.  This now allows us to keep up to date with the latest release of editors like CKEditor, TinyMCE, etc.  Since you just drop them into the libraries folder and they will work.
However, after changing this process I found that normal plugins for the editors are handled differently.  They aren’t implemented into the editor and then just added with a simple JavaScript addition, but require a custom Drupal module to enable them in the UI of WYSIWYG.  So you if have an custom plugins for your editor then you will either need to write/find a custom Drupal module to enable them or find and alternative.  If you are looking for more information on this, look in the WYSIWYG module folder and open the files wysiwyg.api.php and wysiwyg.api.js for the nessesary hooks and documentation.

What you need:
Drupal 7.x
Media 7.x
Media Youtube 7.x
Views 7.x
CTools 7.x
File Entity 7.x
Your favorite editor (TinyMCE, CKEditor etc.)

I am going to start by assuming you have your site, and editor installed and working properly.
Next download and enable the media and media_youtube modules.

Go to:
for Full HTML – admin/config/content/wysiwyg/profile/full_html/edit
for Filtered HTML – admin/config/content/wysiwyg/profile/filtered_html/edit

Then under “Buttons and Plugins” enable “Media” and also “Media browser

Save it.

Two things left.  Enabling the markup, and setting the permissions.

To enable the markup on Full HTML go to – admin/config/content/formats/full_html
To enable the markup on Filtered HTML go to – admin/config/content/formats/filtered_html

Check on the box – “Converts Media tags to Markup

Then all that is left is to make sure every role has the correct permissions, look under the “Media” category.

Comment below if you have any problems.