Making PHP session expire (in Drupal and in general)

(...) Modern Linux distro's, say Ubuntu (8.10) comes with a default PHP configuration of session.gc_probability = 0. This means that in general, session GC will never run(!). There is a unix cron job that runs every half hour and checks for old sessions to delete (see more at /etc/cron.d/php5) but this is done only if you're using the standard "files" as your session handler (check out the directive of session.save_handler on your machine to learn what php default sessions handler is but make sure to check that your application doesn't overwrite this), so for Drupal users using plain Debian/Ubuntu, stock LAMP packages and stock Drupal applications, this means that the PHP garbage collection, despite your best intentions, will also never run. (...)

How to update a primary key value referenced by child records (foreign keys) in MySQL

It's quite easy actually. In MySQL you can disable all foreign key checks by setting the foreign_key_checks variable to zero.

Using awk/sed to detect/remove the byte order mark (BOM)

BOM is nothing more than a nuisance. Detecting and removing it is plain simple. There's a utility called bomstrip that pretty much does what is says and there's the one-liner AWK implementation that you find on stackoverflow (I've added whitespaces for better readability):
awk '{ if (NR == 1) sub(/^\xef\xbb\xbf/, ""); print }' INFILE > OUTFILE
Or a sed version (replaces in place):
sed -i -e '1s/^\xEF\xBB\xBF//' FILE
To do this (or just simply detect BOM) recursively in a dir, you'll find tons of ideas in this other stackoverflow article.

Why Firewall Reject Rules Are Better Than Firewall Drop Rules

"Most firewalls come pre-configured to quietly drop traffic rather than reject it. But what’s the difference between the two and is it truly better to drop instead of reject? If you have never given this question much thought, the answer might surprise you."
An interesting POV. I've been dropping packets all my life (just like 99% of firewall admins), but Chris's explanation makes sense. Some of his statements are trivially true, while others would need some investigation to prove or disprove.

Starting Internet Explorer in a separate process

In Internet Explorer 8 a new feature called Frame Process Merging was introduced. This means that if you open new tabs/windows (even if you try to start a new IE instance using the Quick Launch icon) only a new subprocess is created for the already running IE instance. This new process will share lots of resources with the main IE process, eg. session cookies. This prevents you from logging in to any website (web application) multiple times (potentially with different credentials) at the same time which can be pretty annoying if you're a developer. The problem is easy to fix: use the -noframemerging command line option of IE to disable this feature. You can create a separate IE shortcut with this option or just add it to the Quick Launch icon.

How to prepare a Windows XP/2000 installation before cloning/moving to a new PC or disk

"After you move the Microsoft Windows XP system (boot) disk to a backup computer, you may receive the following Stop error when you try to start the Windows XP-based backup computer:
STOP: 0x0000007B (0xF741B84C,0xC0000034,0x00000000,0x00000000)
INACCESSIBLE_BOOT_DEVICE


Mac OS X v10.6: Starting up with the 32-bit or 64-bit kernel

The available methods are:
  • To start up in 32-bit mode, press the keys "3" and "2" during boot. To start in 64-bit mode, press the keys "6" and "4" during boot.
  • To make your system boot in a specific mode persistently, use one of these commands:
    sudo systemsetup -setkernelbootarchitecture x86_64
    or
    sudo systemsetup -setkernelbootarchitecture i386

facepaste - a Facebook album downloader

I wonder how long will this keep working. Shock There must be a reason for this being the only Fx extension (at least for now) that allows you to download FB albums. I guess FB changes way too fast for most 3rd party apps to keep up in the long term.

Java libraries/wrappers for FFMPEG

There're quite some. Here's a short list as a result of some googling:
  • jffmpeg (an extension of JMF, last release in Jan 2006)
  • FMJ and FFMPEG-Java (aka. Freedom for Media in Java, a more up-to-date alternative of JMF/jffmpeg, last release in Sep 2007)
  • Xuggler (yet another Java lib for FFMPEG Smile, last release in Feb 2010)
  • JAVE (Java Audio Video Encoder, last release in Apr 2009)
Syndicate content