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 / test.pl
Last active November 19, 2015 12:21
Possible Memory Leak in Search::Elasticsearch
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use FindBin qw($Bin);
use lib "$Bin/../lib";
use Search::Elasticsearch;
@m0veax
m0veax / table2csv.pl
Created August 18, 2016 07:12
create csv output from the first found table with tbody in a html document string
use strict;
use warnings;
use DDP;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
use Mojo::DOM;
use Path::Tiny;
@m0veax
m0veax / MY_Controller.php
Created August 2, 2017 06:18
Codeigniter Parent Controller with "X-Clacks-Overhead: GNU Terry Pratchett" Header
<?php
/**
* application/core/MY_Controller.php
*
* All application controllers should extend Base_Controller instead of CI_Controller
*/
class Base_Controller extends CI_Controller {
@m0veax
m0veax / Vagrantfile
Last active January 15, 2018 09:21
Vagrant Setup for setting up suitecrm
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "box-cutter/ubuntu1604"
config.vm.network "public_network", ip: "192.168.2.253"
@m0veax
m0veax / Vagrantfile
Created October 23, 2017 13:02
PHP 5.4 Test Environment
Vagrant.configure("2") do |config|
config.vm.box = "blackbit/php-5.4"
config.vm.network "public_network", ip: "192.168.0.138"
config.vm.synced_folder "source/", "/var/www/html/", owner: "apache", group: "apache"
end
@m0veax
m0veax / vagrant-scp.sh
Created November 24, 2017 11:52 — forked from colindean/vagrant-scp.sh
A quick way to transfer a file to the home directory on a Vagrant VM
#!/bin/sh
OPTIONS=`vagrant ssh-config | awk -v ORS=' ' '{print "-o " $1 "=" $2}'`
scp ${OPTIONS} "$@" || echo "Transfer failed. Did you use 'default:' as the target?"
@m0veax
m0veax / websocket-check.php
Last active July 25, 2024 05:23 — forked from htp/curl-websocket.sh
Test a WebSocket using php fsockopen, bit chaotic, but working for me. You can use that for a HTTP Sensor in PRTG or Nagios
<?php
error_reporting(-1);
$host = "your-host.tld"; // your websocket url without protocol part
$SecWebsocketKey = "your key from websocket connection"; // try wireshark or developer Tools to get this
$origin = "http://$host/"; // origin for the header
$host = 'localhost'; //where is the websocket server
@m0veax
m0veax / mssql_table_locks.sql
Created July 11, 2018 05:19
How to find which process / query is locking a table in MS SQL Server
--Create Procedure WhoLock
--AS
-- found here: https://stackoverflow.com/questions/8749426/how-to-find-what-is-locking-my-tables/22887440#22887440
if object_id('tempdb..#locksummary') is not null Drop table #locksummary
if object_id('tempdb..#lock') is not null Drop table #lock
create table #lock ( spid int, dbid int, objId int, indId int, Type char(4), resource nchar(32), Mode char(8), status char(6))
Insert into #lock exec sp_lock
if object_id('tempdb..#who') is not null Drop table #who
create table #who ( spid int, ecid int, status char(30),
@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';
@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';