Skip to content

Instantly share code, notes, and snippets.

@MikeWills
MikeWills / chg2americalink.sh
Last active April 23, 2020 04:31
Use this script on your pi-star hotspot to automatically change rooms. Just make a copy for each room you want to go into.
@MikeWills
MikeWills / backupDatabases.sql
Created December 2, 2014 06:00
Backup all databases on Microsoft SQL Server. Make sure to update the @path before running.
DECLARE @name VARCHAR(50) -- database name
DECLARE @path VARCHAR(256) -- path for backup files
DECLARE @fileName VARCHAR(256) -- filename for backup
DECLARE @fileDate VARCHAR(20) -- used for file name
-- specify database backup directory
SET @path = 'E:\DB_Backups\'
-- specify filename format
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
// SQL Error Status Fields (Numeric Order)
D SQL_SUCCESS C CONST('00000')
D SQL_NO_MORE_ROWS...
D C CONST('02000')
D SQL_DUPLICATE_RECORD...
D C CONST('23505')
D SQL_ROW_LOCKED...
D C CONST('57033')
@MikeWills
MikeWills / AMORT.RPGLE
Created January 21, 2014 22:25
A test program to create an amortization schedule in RPG.
H ActGrp(*caller) BndDir('MODULES') DftActGrp(*no)
//*************************************************************************
// Program . . . . . AMORT
//
// Created on . . .
// by . . .
//
// Description . . .
//
// CHANGE LOG:
@MikeWills
MikeWills / DUMPALLSRC.RPGLE
Created January 21, 2014 22:21
A simple tool to dump all source in a library
FDSPFDP IF E DISK
C eval *inlr = *on
C read QWHFDML
C dow (not %eof)
C callList plist
@MikeWills
MikeWills / ALERT.RPGLE
Created January 21, 2014 22:15
A simple tool to monitor for MSGW on your IBM i
/* ********************************************************************** */
/* Program . . . . . ALERT */
/* */
/* Created on . . . 04/09/2010 */
/* by . . . Mike Wills (http://mikewills.me) */
/* */
/* Description . . . */
/* */
/* CHANGE LOG: */
/* Date | Name | Description */
@MikeWills
MikeWills / ADPfilters
Created January 21, 2014 21:15
AdBlock Plus filters for Mankato Free Press website to remove paywall.
www.mankatofreepress.com###ta_background
www.mankatofreepress.com###ta_invisible
www.mankatofreepress.com###ta_pagesLeftPopup
www.mankatofreepress.com##.ta_bottomLeftPopup
www.mankatofreepress.com##.ta_popup
@MikeWills
MikeWills / rss-subscribers.sh
Created September 26, 2012 13:18
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="[email protected]"
LOG_FILE="/var/log/httpd/access_log"
@MikeWills
MikeWills / IbmISql.cs
Created December 9, 2011 15:44
A generic method that can pull data from the IBM i to a DataTable for processing. Comments? http://mikewills.me/projects/ibm-i-to-c-database-class/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using IBM.Data.DB2.iSeries;
namespace Mike.Wills.IbmI
{
public static class IbmISql
@MikeWills
MikeWills / VBMacro.vbs
Created August 15, 2011 19:51
This Excel Macro will split a sheet of thousands of rows and break them into multiple sheets with 2000 rows each.
// This code was taken off the PCTECH mailing list from the following message thread:
// http://archive.midrange.com/pctech/201108/msg00084.html
// Written by Jim O. and slj
Sub split_up()
Dim rLastCell As Range
Dim rCells As Range
Dim strName As String