I just found out about MySQL “SQL modes”. This allows you to now turn off some of the features that make MySQL so easy to use.
Why would you do that? For the same reason that in Perl, you should use strict, and in PHP, turn off all global variables and GPC variables and turn on all warnings.
In other words, you should lock down your MySQL to not allow any sloppy work. This will train you to write correct code in the future.
What I will be doing is to lock down my home machine to the strictest possible setting, then work on getting my company‘s CMS working with it. Once that’s done, I’ll gradually lock down our development server (can’t just do it immediately, as there are always at least 15 sites in constant development, not all of which I’ve fixed up yet).
What I will /not/ be doing is locking down our production server, for at least a few years! With hundreds of sites of different CMS design, it is not predictable what will work smoothly and what will explode.
This took me a while to figure out. The scenario is that I have a TV in the main sitting-room, and my main computer is in the kitchen (it’s a small house…). I want to be able to watch my vids (video.google.com, youtube.com, dvd backups, etc) on my TV.
The hardware you need is a video card with a TV-out on it (this article uses the nvidia GeForce FX 5500), an s-video to scart connector, and appropriate cables for the audio and s-video connectors.
Connect the video card’s s-video connection to the Scart thing’s s-video (or Video, if that’s the cable you bought), and connect your audio card’s loudspeaker connection to the audio connectors on the Scart thing.
Once the hardware is all hooked up, you need to configure your Xorg to use your monitor as the main display (:0.0), and your TV as a second monitor (:0.1). Here is the content of my /etc/X11/xorg.conf file:
When you restart your X server, you should see your normal desktop (otherwise, somethings wrong – fix it, and comment about your fix!)
When you run into your TV room and change channel to your AV channel (usually 0 or below). You should see a pretty plain desktop. Note that my setup above is specific to Ireland (PAL-I), and other countries using the above may see their desktop in black and white, or broken up and flickering. If it’s in black/white, then change the “-I” in PAL-I to whatever your local format is (BG, DE, etc). If it’s flickering madly, you probably need NTSC instead.
Okay – it’s all set up!
There are two main ways now to use this – piping the video onto display :0.1, or using the :0.1 desktop directly.
To use the desktop directly, you can use x11vnc, which allows you to export the desktop to a VNC session, which can then be connected to and used from another machine. Anything you do on the local VNC client will be shown on the TV as well.
To do that, open a console window using the desktop user’s account, and type:
x11vnc -display :0.1
The other way is useful if you’re sitting in the sitting-room with a laptop on your lap, and want to play a video without going through the whole VNC thing.
Open a console on your laptop and ssh to the main computer, logging in as the desktop user. Then find the video you wand to display, and open it like this:
DISPLAY=:0.1 mplayer -fs "/archive/films/t/they came from beyond space (public domain, 1967).avi"