Skip to content

Instantly share code, notes, and snippets.

View pmachapman's full-sized avatar

Peter Chapman pmachapman

View GitHub Profile
@pmachapman
pmachapman / IsLocal.asp
Created May 14, 2015 04:03
Determine if the request is local
<%
' Returns whether or not the request is local
Function IsLocal
' If the local address is the remote address, we are running locally
IsLocal = Request.ServerVariables("remote_addr") = Request.ServerVariables("local_addr")
End Function
' Show that this is a local request
@pmachapman
pmachapman / CD Eject.vbs
Created May 14, 2015 09:48
Ejects the CD-ROM Drive
Set player = CreateObject("WMPlayer.OCX")
player.cdromCollection.item(0).eject()
Set player = Nothing
@pmachapman
pmachapman / blink.js
Created June 13, 2015 00:04
jQuery and the <blink> tag: a match made in heaven
var oShell = new ActiveXObject("WScript.Shell");
oShell.SendKeys(String.fromCharCode(0xAD));
@pmachapman
pmachapman / virus-killer.bas
Created June 27, 2015 00:28
"The ultimate virus killer" program from the book "More Tricks & Tips for the Amiga"
OPEN "sys:c/Virus chk" FOR OUTPUT AS 1
FOR i=l TO 800
READ a$
a%=VAL("&H"+a$)
PRINT #l,CHR$(a%);
NEXT
CLOSE 1
KILL "sys:c/Virus_chk.info"
datas:
DATA 0,0,3,F3,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0
@pmachapman
pmachapman / virus-killer.asm
Last active August 29, 2015 14:23
"The ultimate virus killer" assembly source code. Taken from the book "More Tricks & Tips for the Amiga"
;VIRUS-KILLER V1.O; by SM'87
start:
move.l 4,a6 ;EXECBASE at a6
moveq #0,d1 ;Flags: no Virus here
tst.l 46(a6) ;Test, for distorted Cool-Capture
beq.s noSCA ;Wasn't SCA-Virus
clr.l 46(a6) ;Cool-Capture clear
addq.b #1,d1 ;Bit 0 set
noSCA:
cmpi.w #$FC,148(a6) ;Vertical Blank Interrupt normal?
@pmachapman
pmachapman / eicar.bas
Created August 21, 2015 02:25
EICAR Anti-Virus Test File Creator
DIM F AS INTEGER
F = FREEFILE
OPEN "EICAR.COM" FOR OUTPUT AS #F
PRINT #F, "X5O!P%@AP[4\PZX54(P^)7CC)7}";
PRINT #F, "$EICAR-STANDARD-ANTIVIRUS-TEST-FILE";
PRINT #F, "!$H+H*";
CLOSE #F
@pmachapman
pmachapman / crackit32.c
Created October 4, 2015 06:12
crackit.c updated for 32-bit systems. Original code from http://guideme.itgo.com/atozofc/ch64.pdf
/* This file has been altered to run correctly on 32-bit systems */
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <nmmintrin.h>
#define ZIP (0x04034b50) /* signature */
typedef short BOOLEAN;
#define TRUE (1)
@pmachapman
pmachapman / fill.c
Created October 15, 2015 22:51
Program to fill empty hard disk space with zeros, for MS-DOS (Similiar to SysInternal's SDelete for Windows)
/*
* Copyright (C) 2010 Shao Miller <shao.miller@yrdsb.edu.on.ca>
* Licensed under the GNU General Pulic License version 2 or later.
*/
#include <stdio.h>
#include <malloc.h>
int main(int argc, char *argv[])
{
FILE *f;
@pmachapman
pmachapman / Disable Zip File Searching.bat
Created January 8, 2016 01:36
Remove zip file searching from Windows XP
@echo off
rem Remove zip file searching from Windows XP
rem By Peter Chapman <peter@conglomo.co.nz>
echo Before continuing be sure to have zip files associated with another program
pause
echo.
echo Unregistering ZIP Folder DLL
regsvr32 /u /s zipfldr.dll
echo Unregistering Cabinet Viewer DLL
regsvr32 /u /s cabview.dll