Greasemonkey script to remove "People Who Dugg This Also Dugg"

I've made a simple script to remove the beta box.

Link

Batch migration of users into Drupal

The $new_user array can contain any field with the name matching a field in the "users" database table.
$new_user = array(
'name' => $username,
'pass' => $password,
'mail' => $email,
'status' => true,
);
"mail" can be omitted, but the important one is the username.
Once the data is filled, call user_save() to create the user.
$new_user_object = user_save(NULL, $new_user);
The important part is to give the first parameter NULL, as we want to be creating new users.

Be sure to check "$new_user_object afterwards != FALSE" in case the registration process failed.

This code was checked and working with Drupal 6.x.

Firefox Dynamic Bookmarking

If you're like me who uses the Firefox history to quickly access pages, you're more than likely to search for a link in the dropdown, modify it a little and then view it.

An example is viewing bug tasks in Trac.
At work, ticket numbers get passed around rather than the whole link.
I tend to type in "trac" so the Firefox Awesome Bar returns a few results.
I select the result that closely resembles the ticket url, and then modify the ticket ID so it takes me to the ticket I want to view.

Now imagine that could be quicker.
Luckily, Firefox supports bookmark keywords which DOES make it quicker!
I can just type "trac 1234" and it'd take me to that very link.

For example, the link http://www.youtube.com/watch?v=HXi-8nLK_dc
  1. Bookmark the page and edit it.
  2. Edit the link so you keep the "http://www.youtube.com/watch?v=" chunk, but replace the video ID with "%s" so it becomes "http://www.youtube.com/watch?v=%s"
  3. Give the bookmark a keyword such as "yt"
  4. Test by typing "yt HXi-8nE65JshkU" into the Firefox address bar.
[ Source ]

Detecting PHP output buffer leaks

If you want to check for "ob_start()" leaks or incorrectly closed buffers, add the check at the end of each file you wish to check.

If running PHP in command line mode, by default there are no buffer levels.
However, when the request is from a browser, the default buffer level is 1.

So, at the end of the script, add the following.
if (ob_get_length() && ob_get_level() > 1) {
error_log("ERROR: Output buffering leakage detected: ({$_SERVER['REQUEST_METHOD']}) {$_SERVER['REQUEST_URI']}");
error_log("ERROR: Output buffering args:\n" . print_r($_SERVER['argv'], true));
}
The "ob_get_length()" checks if there is any data in the current buffer.
Typically this would be sufficient in command line, but since a browser request has one level of buffer set, we need to also check "ob_get_level()".

Adobe CS4 Disable Updates

I hate automatic updates, especially ones that aren't easy to disable.

Heres how to disable it from the CS4 iteration of their software offerings.
  1. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\
  2. Set "AdobeOnlineDefault" to "0" (zero).
    If it doesnt exist, create it as a new String Value.
  3. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\CSXSPreferences\
  4. Set "UpdatesAllowed" to "0" (zero).
    If it doesnt exist, create it as a new String Value.
These should work for both XP/Vista and presumably Windows 7.

[ Source ]

*edit - 29/01/2009*
Just to make things a little easier, I've translated the instructions above into a command you can run from the start menu.

REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Adobe" /f /v AdobeOnlineDefault /d "0"
and
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\CSXSPreferences" /f /v UpdatesAllowed /d "0"

*edit - 24/03/2009*
Sadly, the instructions from Adobe just don't work.
After being annoyed even futher, I've discovered yet another way to disable the updates.

Go to "C:\Program Files\Common Files\Adobe\Updater6" and run "Adobe_Updater.exe".
Now before you think I've gone completely insane and given in, just let the initial scan finish.

It'll present you with a notification dialog and you can select "Preferences".
Untick everything!
Hopefully, this will work.

*edit  - 29/11/2010* [ Source ]

Anonymous (who deleted his/her own comment) gave this helpful tip.
An option for system admins to disable the updater altogether is to create a registry key which blocks it from running, even if the user tries to update manually by running "Adobe_Updater.exe".

  1. Using Regedit.exe, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Adobe
  2. Create a new key in this folder named "Updater"
  3. Create a new DWORD value within this key named "Enterprise" with a value of "1"

Basic SVN commands and configuration

Pathnames
Linux and Windows pathnames are used in the same way, except in Windows we need to specify the drive letter also.

ie.
Linux
/repositoryRoot/newProject

Windows
C:\repositoryRoot\newProject


Create Repository
Command: svnadmin create [repository_location]

Then modify the following files:
  • /conf/svnserve.conf
    Disable anonymous access and allow password file usage.
  • /conf/passwd
    Create yourself a login.

Migrate Repository
Firstly we need to dump it into a portable file so we can transfer it.
Command: svnadmin dump [repository_location] > ./outputfile

Transfer the output file to the new server.
Once the new repository has been created, we can in the old repository data.

Command: svnadmin load [new_repository_location] < ./inputfile

Note: this does not transfer your settings such as passwords or access configurations.
 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog