Author Archives: Stephen Scotter

JFDI

JFDI – My new favourite acronym!

Require a password login into your Delphi Application

unit login; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TLoginForm = class(TForm) LogInButton: TButton; pwdLabel: TLabel; passwordEdit: TEdit; procedure LogInButtonClick(Sender: TObject) ; public class function Execute : boolean; end; implementation {$R *.dfm} class function TLoginForm.Execute: boolean; begin with TLoginForm.Create(nil) do try Result := ShowModal = mrOk; finally Free; end;… Read More »

ADSL checks

http://www.samknows.com/ http://www.speedtest.net/ http://www.speedtester.bt.com/ http://www.bbc.co.uk/iplayer/diagnostics http://www.vwlowen.co.uk/internet/files.htm – Monitoring software

Delphi & Crystal Reports – Steves way

Choose Type Library “Crystal Report Control” (version 5.2 on my system) – CRYSTL32.OCX Gives me TCrystalReport If you get a complaint during compling saying it can’t find Crystal_TLB go to the PROJECT OPTIONS, click Delphi Compiler then add “E:\My Programs\Delphi2010\[packages]\TCrystalReport” to Search Path.

Using Automation with Crystal Reports and Delphi

In order to use the automation features in Crystal Reports 8.0 and higher, you must first import the type libraries into Delphi. 1. From the Delphi IDE main menu, go to Project | Import Type Libary. 2. Highlight ‘Crystal Report 8 Active X Designer Run Time Libary’. 3. In the Class Names box, change the… Read More »

Kix Script – kixtart.kix

include “functions.kix” $startTime = @Ticks $welcome = “Weclome to @Domain, @Fullname (@WkSta)” SetTitle($welcome) cls COLOR W+/n ? $welcome /************************************************** ** ** Mapping network drivers ** **************************************************/ COLOR Y+/n ? ? “Mapping drives” ? “————–” map_drive(“S:”, “\\econel\shared”) map_drive(“T:”, “\\econel\talisman”) /************************************************** ** ** Sync workstations times with cadserv for ** Teamwork software to work. ** **************************************************/ COLOR… Read More »

Kix script – functions.kix

Function map_drive($drive_letter, $unc) COLOR W+/n ? “Mapping $drive_letter to $unc” USE $drive_letter /del /persistent USE $drive_letter “$unc” If @ERROR == 0 COLOR G+/n ? ” Connection succesful” Else print_error(@Error, @SError) EndIf EndFunction Function print_error($errorno, $errorstr) COLOR R+/n ? ” Error $errorno – $errorstr” EndFunction Function connect_printer($unc) COLOR W+/n ? “Connecting to $unc” If ADDPRINTERCONNECTION ($unc)… Read More »

How to Move WordPress Blog to New Domain or Location

To update WordPress options with the new blog location, use the following SQL command: UPDATE wp_options SET option_value = replace(option_value, ‘http://www.old-domain.com’, ‘http://www.new-domain.com’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’; After that you will need to fix URLs of the WordPress posts and pages, which translated from post slug, and stored in database wp_posts table… Read More »

htaccess surpress / display PHP errors

# supress php errors php_flag display_startup_errors off php_flag display_errors off php_flag html_errors off php_value docref_root 0 php_value docref_ext 0 # display php errors php_flag display_startup_errors on php_flag display_errors on php_flag html_errors on php_value docref_root 1 php_value docref_ext 1

Mobile Phone codes to manage your diverts

If you’re not reachable, you can: * Activate diverts by pressing * * 62 * 901 # [send] * Cancel diverts by pressing # # 62 # [send] * Check the status of your divert by pressing * # 62 # [send] To divert calls when your phone is busy: * Press * * 67… Read More »

Vertical text in an image

<?php header (“Content-type: image/png”); // imagecreate (x width, y width) $text = str_replace(‘_’, ‘ ‘, $_GET[‘text’]); $text = ucwords($text); $img_handle = @imagecreatetruecolor (30, 180) or die (“Cannot Create image”); // ImageColorAllocate (image, red, green, blue) $background_color = ImageColorAllocate($img_handle, 0, 0, 0); //to become transparent later in the script $txt_color = ImageColorAllocate($img_handle, 255, 255, 255); //… Read More »

Category: PHP

BT Fibre and Draytek routers

You may already have a BT Business Hub. The BT engineer will bring a Fibre modem with them on installation day. Let the BT engineer setup the new connect. Once they’ve finished plus the BT Fibre Modem into the ethernet WAN port of the Draytek (in my case a 2820). Configured the draytek to enable… Read More »

301 redirection with Apache config or .htaccess file

<VirtualHost *:80> DocumentRoot “/home/apache/http/example.co.uk/www” ServerName www.example.co.uk ServerAlias example.co.uk ServerAlias example-ltd.co.uk www.example-ltd.co.uk ServerAlias example.net www.example.net ServerAlias example.com www.example.com ServerAdmin webmaster@www.example.co.uk #Log files CustomLog logs/access/www.example.co.uk.log combined ErrorLog logs/error/www.example.co.uk.log # redirect all non-www traffic Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.co\.uk$ RewriteRule ^.*$ http://www.example.co.uk%{REQUEST_URI} [R=permanent,L] </VirtualHost>

My linux personalisations

.bashrc # .bashrc # User specific aliases and functions alias rm=’rm -i’ alias cp=’cp -i’ alias mv=’mv -i’ # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi .bashrc_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup… Read More »