Skip to content

Instantly share code, notes, and snippets.

@damianz5
damianz5 / README.md
Created January 27, 2024 17:01 — forked from maple3142/README.md
poor man's ngrok with cloudflared and mitmproxy

Poor man's ngrok

Prequisites

  • python3
  • tmux
  • cloudflared
  • mitmproxy

Create tunnel

@damianz5
damianz5 / 1-dnsmasq-dnscrypt-proxy-setup.md
Created April 28, 2020 10:13 — forked from irazasyed/1-dnsmasq-dnscrypt-proxy-setup.md
How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

How to Setup dnsmasq with dnscrypt-proxy and Cloudflare DNS on macOS

Using Laravel Valet for localhost development, So it installs dnsmasq with it. dnsmasq runs on port 53, The default DNS port. So we setup dnscrypt-proxy on port 5300 with the default config files in this gist.

dnscrypt-proxy Installation

brew install dnscrypt-proxy
@damianz5
damianz5 / gist:9ba2a27c5021907a9f1bf12a27771ddd
Created February 6, 2019 18:12 — forked from eniuz/gist:554e8142b418c89b1135
run behat features in parallel
# http://zalas.eu/running-behat-in-parallel-with-selenium-grid/
find features/ -iname '*.feature' | parallel --gnu 'bin/behat {}' || exit 1
java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444/grid/register
# behat.yml
default:
extensions:
Behat\MinkExtension\Extension:
@damianz5
damianz5 / php_upgrade_to_71.sh
Created August 2, 2018 14:22 — forked from pixeline/php_upgrade_to_71.sh
Update Mac Os X's php version to php 7.1 using homebrew. Includes curl and mcrypt
# 1. Install brew --> http://brew.sh/
# 2. run the following commands in your Terminal
brew tap homebrew/dupes
brew tap homebrew/versions
brew tap homebrew/homebrew-php
brew install --with-openssl curl
brew install --with-homebrew-curl --with-apache php71
brew install php71-mcrypt php71-imagick
# 3. Follow these instructions to make Apache and php-cli use the newer php executable and make the change persist after reboot.
brew info php71
#!/bin/sh
sed -i.default "s/^zend_extension=/;zend_extension=/" /usr/local/etc/php/7.1/conf.d/ext-xdebug.ini
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.php71.plist
sudo brew services restart php71
echo "xdebug disabled"
@damianz5
damianz5 / selenium.sh
Created February 16, 2018 17:32 — forked from jakzal/selenium.sh
Selenium grid runner
#!/bin/sh
command=${1:-"help"}
SELENIUM_VERSION="2.39.0"
NODE_OPTIONS="-browser browserName=phantomjs"
download() {
[ -f selenium-server-standalone.jar ] || wget http://selenium.googlecode.com/files/selenium-server-standalone-${SELENIUM_VERSION}.jar -Oselenium-server-standalone.jar
}
@damianz5
damianz5 / docker-on-mac.md
Created February 7, 2018 09:32
Docker on Mac
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve

sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

docker-machine create default --driver xhyve --xhyve-experimental-nfs-share

bash -c 'echo -e "\n$(docker-machine ip default) default.localhost" >> /etc/hosts'
<?php
# vendor/instaclick/php-webdriver/lib/WebDriver/Service/CurlService.php
# at line 40, after:
# public function execute($requestMethod, $url, $parameters = null, $extraOptions = array())
# {
# add:
$start = microtime(true);
$uuid = substr(md5(rand(1, 999999) . time()), 0 , 6);
$data = PHP_EOL . time() . '||' .date('d-m-Y H:i:s') . '||' . $uuid;
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - freek@spatie.be</title>
</head>
<body>
<outline text="PHP" title="PHP">
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/>
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/>
<outline htmlUrl="https://ocramius.github.io/" title="ocramius.github.io" xmlUrl="https://ocramius.github.io/atom.xml" type="rss" text="ocramius.github.io"/>
@damianz5
damianz5 / FeatureContext.php
Created October 18, 2016 11:23 — forked from basilfx/FeatureContext.php
JavaScript errors in Behat 3 + Mink 2 + Selenium 2
<?php
use Behat\Behat\Hook\Scope\AfterStepScope;
use Behat\MinkExtension\Context\MinkContext;
class FeatureContext extends MinkContext
{
/**
* Grab the JavaScript errors from the session. Only works in companion
* with a global window variable `errors` that contains the JavaScript