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 / check_syntax.php
Created October 29, 2020 13:36
Recursive PHP Syntax Check
<?php
$it = new RecursiveIteratorIterator( new RecursiveDirectoryIterator('.'));
$regx = new RegexIterator($it, '/^.*\.php$/i', // only matched text will be returned
RecursiveRegexIterator::GET_MATCH);
foreach ($regx as $file) {
$file = $file[0];
exec('php -l ' . $file); //check the syntax here
}
@m0veax
m0veax / redirect_console_to_div.js
Created July 22, 2020 09:14
Redirect console output to a given div
// SOURCE https://stackoverflow.com/questions/16616722/sending-all-javascript-console-output-into-a-dom-element
var baseLogFunction = console.log;
console.log = function(){
baseLogFunction.apply(console, arguments);
var args = Array.prototype.slice.call(arguments);
for(var i=0;i<args.length;i++){
var node = createLogNode(args[i]);
@m0veax
m0veax / pattern.regex
Created March 30, 2020 19:43
Find XLSX Sheet Protection element by regex
/<sheetProtection algorithmName="SHA-512" hashValue=".*" saltValue=".*" spinCount="\d+" sheet="\d+" objects="\d+" scenarios="\d+"\/>/
@m0veax
m0veax / W3_APP_GEN_Doctrine.sql
Last active October 15, 2021 07:03
Generate Doctrine Entity from SQLServer
USE [DB_NAME]
GO
/****** Object: StoredProcedure [dbo].[W3_APP_GEN_Doctrine] Script Date: 03.09.2019 09:18:59
FOUND HERE: https://stackoverflow.com/a/35901836
Updates I did:
- Save some lines, because SQL Server Terminates at some number of lines
- Added timestamp type
@m0veax
m0veax / excel_cheat_sheet.md
Last active May 15, 2019 12:42
excel cheat sheet (german)

Excel Befehle die ich immer wieder brauche

Erste 3 Zeichen löschen

    =RECHTS(A1;LÄNGE(A1)-3) 

Ver"und"dieren bzw concat

Um beispielsweise mal Flott einen SQL Query aus einer Excel Datei zu erzeugen ist folgendes hilfreich

@m0veax
m0veax / symfony_cheat_sheet.md
Created May 10, 2019 06:52
symfony console cheat sheet

Symfony Console Cheat Sheet

Serve

php bin/console server:start *:8080

Listen on all Interfaces at port 8080

@m0veax
m0veax / commands.md
Last active May 9, 2019 08:11
Useful dev CMD command collection

Commands i need from time to time on windows boxes

Remote CMD

winrs -r:<REMOTEHOST> cmd.exe

Spawns a cmd.exe shell per remote connection which is nice, because you don't need to do a full RDP Connection

@m0veax
m0veax / prevent_lockscreen.vbs
Last active April 23, 2019 08:56
Disable auto the Windows Lock-Screen feature for reasons
REM Source: https://stackoverflow.com/a/4507364
set wsc = CreateObject("WScript.Shell")
Do
WScript.Sleep (60*1000)
wsc.SendKeys ("{SCROLLLOCK 2}")
Loop
@m0veax
m0veax / otrs_fastforward.vbs
Created April 1, 2019 10:15
Jump directly into an OTRS Ticket
'author Patrick Kilter
'email [email protected]
'OTRS Base URL
DIM strOtrsBaseUrl
strOtrsBaseUrl = "http://otrs.local"
'get TN
DIM strTn
strTn =InputBox("Ticket Number", "OTRS FastForward")
@m0veax
m0veax / analysis.md
Last active April 29, 2019 09:16
logparser.exe Analysis

commands for analysis of IIS Logfiles

Average Taken Time for Requests DESC

logparser.exe "SELECT  cs-uri-stem, cs-uri-query, COUNT(*) AS TotalCount, MAX(time-taken) AS MaximumTime, AVG(time-taken) AS AverageTime FROM *.log GROUP BY cs-uri-stem, cs-uri-query ORDER BY AverageTime DESC" -i:w3c

HTTP Status and Time-Taken for cs-uri-stem

take an cs-uri-stem value from the report above and replace it in the following command