Skip to content

Instantly share code, notes, and snippets.

edmhs

Block or report user

Report or block edmhs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@edmhs
edmhs / daksa.php
Last active Mar 20, 2019
Very old hack to run multiple php processes. Named "daksa" in translation from Latvian mean "Fork"
View daksa.php
<?php
echo date('Y-m-d H:i:s')."\n";
// filename to run
$filename = "check_count.php";
// max processes
$processes = 8;//rand(0,1);
$total = 0;
@edmhs
edmhs / rsa.py
Created Nov 30, 2018 — forked from dennislwy/rsa.py
Python helper class to perform RSA encryption, decryption, signing, verifying signatures & generate new keys
View rsa.py
# RSA helper class for pycrypto
# Copyright (c) Dennis Lee
# Date 21 Mar 2017
# Description:
# Python helper class to perform RSA encryption, decryption,
# signing, verifying signatures & keys generation
# Dependencies Packages:
# pycrypto
@edmhs
edmhs / 1_kubernetes_on_macOS.md
Created Jun 24, 2018 — forked from zulhfreelancer/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry
View 1_kubernetes_on_macOS.md

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@edmhs
edmhs / coupons.php
Created May 29, 2017
Generate unique coupon codes
View coupons.php
<?php
//prefi for coupons
$prefix = 'ABCD';
//how many codes you need?
$need = 200;
$codes = array();
while(count($codes)!=$need){
//choose format
@edmhs
edmhs / php_subnet_function.php
Last active May 24, 2017
Return array with all ip addreses from ip addresses subnet - PHP Subnet mask calculator
View php_subnet_function.php
<?php
$range = "194.8.42.0/24";
function ipListFromRange($range){
$parts = explode('/',$range);
$exponent = 32-$parts[1].'-';
$count = pow(2,$exponent);
$start = ip2long($parts[0]);
$end = $start+$count;
return array_map('long2ip', range($start, $end) );
@edmhs
edmhs / grep_zip_search.sh
Created May 24, 2017
Search string recursively within zipped files, works good with searching string in TB of data.
View grep_zip_search.sh
for file in 201705/prefix*.zip; do
if ( unzip -c "$file" | grep -q "123456789"); then
echo "$file"
fi
done
You can’t perform that action at this time.