Skip to content

Instantly share code, notes, and snippets.

View m0veax's full-sized avatar
🐱
🥙

Patrick Kilter m0veax

🐱
🥙
  • Vivawest Wohnen GmbH
  • Germany, Gladbeck
View GitHub Profile
@m0veax
m0veax / processlist.php
Created March 19, 2019 09:08
Small improved MySQL Process Monitor
<html>
<head>
<meta http-equiv="refresh" content="10">
</head>
<body>
<?php
ini_set('display_errors',1);
@m0veax
m0veax / output.txt
Last active March 11, 2019 10:42
Problems while trying to setup an shiori account
ERRO[0000] [./go/bin/shiori account add accountname]: default addr for network 'localhost' unknown
@m0veax
m0veax / MySQL.ps1
Created January 25, 2019 18:02 — forked from ptflp/MySQL.ps1
Using MySQL from powershell
Param(
[Parameter(
Mandatory = $true,
ParameterSetName = '',
ValueFromPipeline = $true)]
[string]$Query
)
$MySQLAdminUserName = 'USER'
$MySQLAdminPassword = 'PASSWORD'
$MySQLDatabase = 'MYDBNAME'
@m0veax
m0veax / Migrate-Db.ps1
Created January 25, 2019 17:59 — forked from mkropat/Migrate-Db.ps1
Run schema migration scripts on a SQL Server databse
<#
.SYNOPSIS
Run schema migration scripts on a SQL Server databse
.DESCRIPTION
The database version is kept track of in an extended property ('db-version') on
the SQL Server database. The version number comes from the prefix of the
filename of each .sql migration script (see -SchemaDir parameter help for more
information).
@m0veax
m0veax / compare.sql
Created January 25, 2019 06:24
Compare two MSSQL Server database schemas for differences
/*
SOURCE: https://dba.stackexchange.com/a/183991
*/
set nocount on;
-- Set the two variables newmodel and oldmodel to the appropriate database names and execute the script
declare @newmodel varchar(50), @oldmodel varchar(50);
Set @newmodel = '[NewModel to Compare]'; -- e.g. Dev environment
@m0veax
m0veax / web.config
Created December 7, 2018 12:38
IIS Custom 404 Redirect
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Custom">
<remove statusCode="404" />
<error statusCode="404" path="/my_path/" responseMode="Redirect"/>
</httpErrors>
</system.webServer>
</configuration>
@m0veax
m0veax / find_by_column_name.sql
Created November 6, 2018 06:10
Find column by name in SQL Server Database
/*
Source: https://stackoverflow.com/a/32724748 (thx Todd ECU)
*/
SELECT Table_Name, Column_Name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_CATALOG = 'YOUR_DATABASE'
AND COLUMN_NAME LIKE '%YOUR_COLUMN%'
@m0veax
m0veax / fakesmtpd.pl
Last active July 25, 2018 06:28
Fakesmtpd with bugfix for strict mode. Source: http://www.jera.com/tools/fakesmtpd/
#!c:\Perl\bin\perl.exe
# A Fake SMTP Daemon for debugging SMTP connections
# (c) 2000,2001 John Brewer DBA Jera Design
# You are permitted to use, modify and redistribute this
# code under the terms of the Perl Artistic License.
use strict;
use IO::Socket;
@m0veax
m0veax / test.js
Created July 24, 2018 20:05
working enzyme example
// thanks to realPatriot_ from freenode/#react for his code
import { configure, shallow, mount } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import {Form, Dropdown} from 'semantic-ui-react';
import React from 'react';
import ScheduleVisualizerForm from './ScheduleVisualizerForm';
@m0veax
m0veax / LoginActions.js
Created July 13, 2018 06:46
trying to encapsulate a rest api in a backend class in a react-redux-thunk environment
import backend from '../backend';
export const LOGIN_START = 'LOGIN_START';
export const LOGIN_ERROR = 'LOGIN_ERROR';
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS';
export const CHANGE_USERNAME = 'CHANGE_USERNAME';
export const CHANGE_PASSWORD = 'CHANGE_PASSWORD';