Skip to content

Instantly share code, notes, and snippets.

View rakauchuk's full-sized avatar
🦄
Champ champ!

Kirill Rakauchuk rakauchuk

🦄
Champ champ!
View GitHub Profile
@rakauchuk
rakauchuk / open-vm-tools-vmware-ubuntu-sharing.md
Created April 18, 2019 11:00 — forked from darrenpmeyer/open-vm-tools-vmware-ubuntu-sharing.md
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.

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 April 12, 2017 20:11 — forked from ralphschindler/README.md
Docker (For Mac) De-facto Host Address Alias (10.254.254.254) - "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 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
@rakauchuk
rakauchuk / .bash_profile
Last active December 8, 2017 15:32
.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 July 1, 2016 11:05
Generate a Random Password
$ 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 October 19, 2015 07:42
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
rakauchuk / gist:3db172005db0b61f151b
Last active August 29, 2015 14:27
wget as download manager
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 June 24, 2015 08:32
Dumping MySQL Stored Procedures, Functions and Triggers
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
echo ip = $(vagrant ssh -c "ip address show eth0 | grep 'inet ' | sed -e 's/^.*inet //' -e 's/\/.*$//'")
@rakauchuk
rakauchuk / gist:0d3b2885df901d1896a9
Created April 25, 2015 12:53
Jenkins Plugins PHP
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 January 19, 2015 12:40
handle ajaxComlete in chrome ext (jquery) v2
var actualCode = '(' + function () {
$(document).ajaxComplete(function () {
console.log('ajaxComplete');
});
} + ')();';
var script = document.createElement('script');
script.textContent = actualCode;
(document.head || document.documentElement).appendChild(script);