Skip to content

Instantly share code, notes, and snippets.

Avatar
👑
Champ champ!

Kirill Rakauchuk rakauchuk

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

(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.

TL;DR

Install open-vm-tools and run:

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

Docker (Mac) De-facto Standard Host Address Alias

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

Installation

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 https://gist.githubusercontent.com/ralphschindler/535dc5916ccbd06f53c1b0ee5a868c93/raw/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
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
rakauchuk / README.md
Created Oct 19, 2015
Use self git-fork in composer
View README.md

"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
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 http://example.com/
site with 5 nodes:
$ wget -c -nc -N -E -r -l 5 -k -p -np http://example.com/catalogue/bla-bla-bla
@rakauchuk
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
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 () {
console.log('ajaxComplete');
});
} + ')();';
var script = document.createElement('script');
script.textContent = actualCode;
(document.head || document.documentElement).appendChild(script);