Skip to content

Instantly share code, notes, and snippets.

View mkeneqa's full-sized avatar
♣️
Chaos EnCode

Mike mkeneqa

♣️
Chaos EnCode
View GitHub Profile
@mkeneqa
mkeneqa / symfony_console_app.php
Created January 29, 2020 00:10
place in `app/src/Commmand/console_app.php` . Run App with this command: `php bin\console app:add-cols`
<?php
// place in app/src/Commmand/console_app.php
namespace App\Command;
use RedBeanPHP\RedException\SQL;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use App\Helper\Database;
@mkeneqa
mkeneqa / 403.html
Last active December 29, 2019 21:39
Forbidden City 403 Template
<!DOCTYPE html>
<html>
<head>
<title>Forbidden Site</title>
<meta charset="UTF-8">
<style>
@import url(https://fonts.googleapis.com/css?family=Permanent+Marker);
@import url(https://fonts.googleapis.com/css?family=Roboto+Mono);
body,html{width:100%;height:100%;margin:0;padding:0}body{background:#f3e2cb;display:flex;flex-direction:column;align-items:center;align-content:center}.wrapper{height:100%;width:100%;display:flex;flex-direction:column-reverse;align-items:center;align-content:center;position:absolute;bottom:0;overflow:hidden}.wrapper:hover .sun{-webkit-transform:translateY(-200px);transform:translateY(-200px)}.pedastal{width:1000px;height:90px;background:#fff;position:relative}.pedastal-block1,.pedastal-block1::before{width:125px;height:30px;background:#a24d4c;box-sizing:border-box}.pedastal-block1::before{content:'';position:absolute;right:0}.pedastal-block2,.pedastal-block2::before{width:63px;height:30px;background:#a24d4c;box-sizing:border-box}.pedastal-block2::before{content:'';posit
@mkeneqa
mkeneqa / 01-WpBashBackUp.md
Last active November 8, 2019 09:26
Bash script to backup WordPress

WP Bash Backup Script

This bash script quickly does the backup of the wp-content directory and uses the WPCLI command to export the database.

Place the script in the WordPress root directory and run sh bkup.sh .

After the script executes an archive should be located in the WordPress root directory similar to this: site_wpcontent_bkup_12_30_2019.zip.

@mkeneqa
mkeneqa / local_for_symfony_projects.md
Created November 8, 2019 09:17
Configuring Local by Flywheel for Symfony Projects

To be Started . . . . . .

@mkeneqa
mkeneqa / flywheel_local_multi_vhosts.conf
Created October 28, 2019 22:35
Apache config for multiple virtual hosts (i.e. frontend and backend) on Local ( \etc\apache\sites-enabled\000-default.conf )
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /app/public/frontend/public
Header set Access-Control-Allow-Origin "*"
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /app/public/backend/>
Options Indexes FollowSymLinks ExecCGI
@mkeneqa
mkeneqa / php_date_helper_class.php
Last active April 27, 2022 17:34
PHP Dates Helper Class
<?php
namespace App\Onstream;
class DateHelper
{
public static function GetDaysRemaining($date_from,$date_to): float
{
###############################################################################################################
# I've analysed the Spotify network. Assuming you are using a(n) (ad block) #
# hosts file on your computer or router, most advertisement site are already #
# blocked. If you find/spot a DNS entrie(s) that not listed yet please contact me #
# on twitter (@0xUID) or via blog (blogpirate.net).
#
# github link: https://raw.githubusercontent.com/x0uid/SpotifyAdBlock/master/hosts
# #
# Block Spotify Ads! #
# More info about this hosts file at #
@mkeneqa
mkeneqa / php.xml
Last active September 13, 2019 23:36
flywheel local phpstorm debug config files
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PhpIncludePathManager">
<include_path>
<path value="$PROJECT_DIR$/revdash/vendor/zendframework/zend-eventmanager" />
<path value="$PROJECT_DIR$/revdash/vendor/zendframework/zend-code" />
<path value="$PROJECT_DIR$/revdash/vendor/webmozart/assert" />
<path value="$PROJECT_DIR$/revdash/vendor/twig/twig" />
<path value="$PROJECT_DIR$/revdash/vendor/symfony/yaml" />
<path value="$PROJECT_DIR$/revdash/vendor/symfony/web-server-bundle" />
@mkeneqa
mkeneqa / Python_Symple_ssh_Client
Created July 5, 2019 17:53
A quick python script to send linux server commands from windows,mac or linux over ssh.
import sys, paramiko
# help src: https://stackoverflow.com/a/48826690 , https://gist.github.com/mlafeldt/841944#file-ssh_demo-py
hostname = "10.10.01.01"
password = "pass"
command = "ps aux |grep python"
username = "userme"
port = 22
@mkeneqa
mkeneqa / UnixEpochToHRD.php
Last active December 7, 2018 18:32
PHP Epoch unix time conversion to HRF
<?php
//How to do proper epoch unix time conversion to Human Readable Date (HRD) in php
//How to do proper epoch unix time conversion to HRD in php
$time = 1531116000000;
date_default_timezone_set('America/Edmonton');
echo date('r', substr($time, 0, 10));
echo '<br/><br/>';
echo date('D, Y-M-d', substr($time, 0, 10));