Skip to content

Instantly share code, notes, and snippets.


Victor Bocharsky bocharsky-bw

View GitHub Profile
bocharsky-bw / webpack.config.js
Created Jan 5, 2018 — forked from plfort/webpack.config.js
Symfony Encore trick for completion in PHPStorm (Can't analyse webpack.config.js)
View webpack.config.js
let config = Encore.getWebpackConfig();
if(!Encore.isProduction()) {
fs.writeFile("fakewebpack.config.js", "module.exports = "+JSON.stringify(config), function(err) {
if(err) {
return console.log(err);
console.log("fakewebpack.config.js written");
bocharsky-bw /
Created Feb 2, 2017 — forked from piscisaureus/
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

bocharsky-bw /
Created Nov 19, 2015 — forked from agnoster/
My ZSH Theme


A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

bocharsky-bw / Dockerfile
Last active Aug 3, 2020
The full-stack [Ubuntu, Nginx, php-fpm] Docker image example
View Dockerfile
FROM ubuntu
MAINTAINER Victor Bocharsky <>
RUN apt-get update
RUN apt-get install -y nginx php5 php5-fpm php5-intl php5-mysql php5-xdebug
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
RUN sed -i -e "s/;\?daemonize\s*=\s*yes/daemonize = no/g" /etc/php5/fpm/php-fpm.conf
# Nginx config
RUN rm /etc/nginx/sites-enabled/default
bocharsky-bw /
Last active Jul 14, 2021
Shell Script for Upgrade Ubuntu via APT in one step
sudo apt-get update
echo -e $TEXT_YELLOW
echo 'APT update finished...'
echo -e $TEXT_RESET
bocharsky-bw / sublime-preferences.json
Created Jul 8, 2014
Sublime Text Editor Preferences
View sublime-preferences.json
// Settings in here override those in "Default/Preferences.sublime-settings",
// and are overridden in turn by file type specific settings.
// The encoding to use when the encoding can't be determined automatically.
// ASCII, UTF-8 and UTF-16 encodings will be automatically detected.
"fallback_encoding": "Cyrillic (Windows 1251)",
// OS X only: When files are opened from finder, or by dragging onto the
// dock icon, this controls if a new window is created or not.
"open_files_in_new_window": false,
bocharsky-bw / hgfs-shared-folder-permissions
Created Jul 5, 2014
Permissions on Shared Folders on Ubuntu
View hgfs-shared-folder-permissions
VMware Fusion - Permissions on Shared Folders on Ubuntu
VMware Fusion provides a nice functionality of sharing folder from host (Mac OSX) to guest (Ubuntu). But then, it seems they are more focused on windows guests, because they screwup on file permissions of shared folders.
"ls -al /mnt/hgfs" will show 501 dialout as user and group, which is sure to cause permission issues on linux guest.
Update: Found a more persistent alternative
1. sudo vim /etc/vmware-tools/
2. Search for 'vmhgfs_mnt="/mnt/hgfs"'. After this line add: 'vmuser=${VMWARE_MNT_USER:-root}'
bocharsky-bw / vmware-fix
Created Jun 22, 2014
Resolving VMware’s “Unable to update run-time folder sharing status: Unknown error”
View vmware-fix
The Problem
Sometimes when upgrading VMware, I noticed that I can no longer share directories between my local file system and the VMs file system.
In an effort to get shared folders working, I would then go to the following location in VMware:
Virtual Machine -> Sharing -> Sharing Settings …
I would accurately see the folders I want to share and I would see that Shared Folders is “ON”. In an attempt to re-share the folders I toggled Shared Folders to “OFF”. I then toggled it back to “ON” and noticed the following error:
bocharsky-bw / elephants
Created Jun 20, 2014
Console elephants when Vagrant up
View elephants
/ )
.--.; | _...,-"""-,
.-""-.-""""-. / _`'-._.' /` \
/' \ \| (/'-._/ ) ;
.-""""-; ( '--' /-' _ |
.' | ; e / a , ;
/ \ | __.'`-.__, ; /
/ `._ ; .-' `--.,__.\ /`
//| \ \,-' /\_.'
bocharsky-bw / .htaccess
Created Jun 19, 2014
The .htaccess example for Symfony Framework project that deployed on shared hosting.
View .htaccess
# Rewrite all requests to subdirectory, except exists file requests
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /web/$1 [QSA,L]