Skip to content

Instantly share code, notes, and snippets.

View bocharsky-bw's full-sized avatar
💔
#StandWithUkraine 🇺🇦

Victor Bocharsky bocharsky-bw

💔
#StandWithUkraine 🇺🇦
View GitHub Profile
@bocharsky-bw
bocharsky-bw / Makefile
Created February 21, 2022 09:01 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@bocharsky-bw
bocharsky-bw / webpack.config.js
Created January 5, 2018 11:07 — forked from plfort/webpack.config.js
Symfony Encore trick for completion in PHPStorm (Can't analyse 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 February 2, 2017 16:43 — forked from piscisaureus/pr.md
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 = [email protected]: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 November 19, 2015 08:42 — forked from agnoster/README.md
My ZSH Theme

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 January 14, 2022 10:25
The full-stack [Ubuntu, Nginx, php-fpm] Docker image example
FROM ubuntu
MAINTAINER Victor Bocharsky <[email protected]>
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 October 17, 2024 09:02
Shell Script for Upgrade Ubuntu via APT in one step
#!/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 July 8, 2014 19:24
Sublime Text Editor Preferences
// 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 July 5, 2014 11:00
Permissions on Shared Folders on Ubuntu
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 June 22, 2014 21:31
Resolving VMware’s “Unable to update run-time folder sharing status: Unknown error”
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 June 20, 2014 11:55
Console elephants when Vagrant up
_
/ )
.--.; | _...,-"""-,
.-""-.-""""-. / _`'-._.' /` \
/' \ \| (/'-._/ ) ;
.-""""-; ( '--' /-' _ |
.' | ; e / a , ;
/ \ | __.'`-.__, ; /
/ `._ ; .-' `--.,__.\ /`
//| \ \,-' /\_.'