Skip to content

Instantly share code, notes, and snippets.

Champ champ!

Kirill Rakauchuk rakauchuk

Champ champ!
View GitHub Profile
rakauchuk /
Created Apr 18, 2019 — forked from darrenpmeyer/
open-vm-tools and VMWare Shared Folders for Ubuntu guests

(NB: adapted from this Ask Ubuntu thread -- tested to work with Ubuntu 16 LTS branches and Ubuntu 17.10)

Unlike using VMWare Tools to enable Linux guest capabilities, the open-vm-tools package doesn't auto-mount shared VMWare folders. This can be frustrating in various ways, but there's an easy fix.


Install open-vm-tools and run:

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other
rakauchuk /
Created Apr 12, 2017 — forked from ralphschindler/
Docker (For Mac) De-facto Host Address Alias ( - "The 10254 Trick".

Docker (Mac) De-facto Standard Host Address Alias

This launchd script will ensure that your Docker environment on your Mac will have as an alias on your loopback device ( The command being run is ifconfig lo0 alias


Copy/Paste the following in terminal with sudo (must be root as the target directory is owned by root)...

sudo curl -o /Library/LaunchDaemons/com.ralphschindler.docker_10254_alias.plist
View .bash_profile
# ---------------------------------------------------------------------------
# Description: This file holds all my BASH configurations and aliases
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
rakauchuk / gist:97d2080daf29dac4c5f9
Last active Jul 1, 2016
Generate a Random Password
View gist:97d2080daf29dac4c5f9
$ date +%s | sha256sum | base64 | head -c 32 ; echo
$ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
$ openssl rand -base64 32
$ tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1
$ strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo
$ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c6
$ dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev
$ </dev/urandom tr -dc '12345!@#$%qwertQWERTasdfgASDFGzxcvbZXCVB' | head -c8; echo ""
$ randpw(){ < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;}
$ date | md5sum
rakauchuk /
Created Oct 19, 2015
Use self git-fork in composer

"behat/behat" is the original library and "dev-fork" is the branch is needed. "rakauchuk/Behat" is a fork of "dev-master" branch. "composer update" should get the modified version of "behat/behat"

rakauchuk / gist:3db172005db0b61f151b
Last active Aug 29, 2015
wget as download manager
View gist:3db172005db0b61f151b
donwload links:
$ vi links.txt
$ wget -c -i links.txt
download all site:
$ wget -m
site with 5 nodes:
$ wget -c -nc -N -E -r -l 5 -k -p -np
rakauchuk / gist:45df853f6a4e9ef5172b
Created Jun 24, 2015
Dumping MySQL Stored Procedures, Functions and Triggers
View gist:45df853f6a4e9ef5172b
MySQL 5 has introduced some new interesting features, like stored procedures and triggers. I will show in this small post how we can backup and restore these components using mysqldump.
mysqldump will backup by default all the triggers but NOT the stored procedures/functions. There are 2 mysqldump parameters that control this behavior:
—routines – FALSE by default
—triggers – TRUE by default
This means that if you want to include in an existing backup script also the triggers and stored procedures you only need to add the —routines command line parameter:
$ mysqldump <other mysqldump options> --routines outputfile.sql
View gist:1b24b796df208cdb755e
echo ip = $(vagrant ssh -c "ip address show eth0 | grep 'inet ' | sed -e 's/^.*inet //' -e 's/\/.*$//'")
View gist:0d3b2885df901d1896a9
Checkstyle (for processing PHP_CodeSniffer logfiles in Checkstyle format)
Clover PHP (for processing PHPUnit's Clover XML logfile)
Crap4J (for processing PHPUnit's Crap4J XML logfile)
DRY (for processing phpcpd logfiles in PMD-CPD format)
HTML Publisher (for publishing documentation generated by phpDox, for instance)
rakauchuk / chrome_ajax_2.js
Created Jan 19, 2015
handle ajaxComlete in chrome ext (jquery) v2
View chrome_ajax_2.js
var actualCode = '(' + function () {
$(document).ajaxComplete(function () {
} + ')();';
var script = document.createElement('script');
script.textContent = actualCode;
(document.head || document.documentElement).appendChild(script);