Skip to content

Instantly share code, notes, and snippets.

🇺🇦
Ukraine

Victor Bocharsky bocharsky-bw

🇺🇦
Ukraine
Block or report user

Report or block bocharsky-bw

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bocharsky-bw
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
bocharsky-bw / pr.md
Created Feb 2, 2017 — forked from piscisaureus/pr.md
Checkout github pull requests locally
View pr.md

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 = git@github.com:joyent/node.git

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
bocharsky-bw / README.md
Created Nov 19, 2015 — forked from agnoster/README.md
My ZSH Theme
View README.md

agnoster.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
bocharsky-bw / Dockerfile
Last active Jun 12, 2019
The full-stack [Ubuntu, Nginx, php-fpm] Docker image example
View Dockerfile
FROM ubuntu
MAINTAINER Victor Bocharsky <bocharsky.bw@gmail.com>
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
bocharsky-bw / upgrade.sh
Last active Jul 25, 2019
Shell Script for Upgrade Ubuntu via APT in one step
View upgrade.sh
#!/bin/bash
TEXT_RESET='\e[0m'
TEXT_YELLOW='\e[0;33m'
TEXT_RED_B='\e[1;31m'
sudo apt-get update
echo -e $TEXT_YELLOW
echo 'APT update finished...'
echo -e $TEXT_RESET
@bocharsky-bw
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
bocharsky-bw / hgfs-shared-folder-permissions
Created Jul 5, 2014
Permissions on Shared Folders on Ubuntu
View hgfs-shared-folder-permissions
http://viraj-workstuff.blogspot.com/2013/07/vmware-fusion-permissions-on-shared.html
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/services.sh
2. Search for 'vmhgfs_mnt="/mnt/hgfs"'. After this line add: 'vmuser=${VMWARE_MNT_USER:-root}'
@bocharsky-bw
bocharsky-bw / vmware-fix
Created Jun 22, 2014
Resolving VMware’s “Unable to update run-time folder sharing status: Unknown error”
View vmware-fix
http://jesseforrest.name/resolving-vmwares-unable-to-update-run-time-folder-sharing-status-unknown-error/305
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
bocharsky-bw / elephants
Created Jun 20, 2014
Console elephants when Vagrant up
View elephants
_
/ )
.--.; | _...,-"""-,
.-""-.-""""-. / _`'-._.' /` \
/' \ \| (/'-._/ ) ;
.-""""-; ( '--' /-' _ |
.' | ; e / a , ;
/ \ | __.'`-.__, ; /
/ `._ ; .-' `--.,__.\ /`
//| \ \,-' /\_.'
@bocharsky-bw
bocharsky-bw / .htaccess
Created Jun 19, 2014
The .htaccess example for Symfony Framework project that deployed on shared hosting.
View .htaccess
#path/to/project/.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]
</IfModule>
You can’t perform that action at this time.