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 / .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 / 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 / nbrb.php
Created January 16, 2015 21:21
nbrb rates converted from xml to json (w/ mapping symbols)
<?php
try
{
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
$ex = 'http://www.nbrb.by/Services/XmlExRates.aspx?ondate=' . date("m/d/Y");
@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 / Gruntfile.js
Created November 25, 2013 05:48
Example... with Jekull
// This is the main application configuration file. It is a Grunt
// configuration file, which you can learn more about here:
// https://github.com/cowboy/grunt/blob/master/docs/configuring.md
/*jslint nomen: true*/
'use strict';
module.exports = function (grunt) {
'use strict';
grunt.initConfig({
// The clean task ensures the entire XXX folder is removed
clean: {
@rakauchuk
rakauchuk / twitterHashTags.php
Created September 16, 2013 15:28
Regex to conditionally replace Twitter hashtags with hyperlinks
<?
// (^|\s)#(\w*[a-zA-Z_]+\w*)
$str = preg_replace('/(^|\s)#(\w*[a-zA-Z_]+\w*)/', '\1#<a href="http://search.twitter.com/search?q=%23\2">\2</a>', $str);
// ...
?>
@rakauchuk
rakauchuk / CORS.php
Created September 6, 2013 07:15
Cross-Origin Resource Sharing
<?php
// Allow from any origin
if (isset($_SERVER['HTTP_ORIGIN'])) {
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Max-Age: 86400');
}
// Access-Control headers are received during OPTIONS requests
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
@rakauchuk
rakauchuk / gist:5955897
Created July 9, 2013 09:13
CentOS Web Server to a SQL Server
rpm -ivh http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
cd /etc/yum.repos.d/
wget http://rpms.famillecollet.com/enterprise/remi.repo
yum install freetds
yum install freetds-devel
yum install --enablerepo=remi php-mssql
@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"