Skip to content

Instantly share code, notes, and snippets.

View bsa7's full-sized avatar

Belevskij Sergeij bsa7

View GitHub Profile
@bsa7
bsa7 / hint.markdown
Created June 16, 2014 14:52
tightvnc-jviewer.jar - exit fullscreen
  1. close viewer
  2. in registry key \Software\JavaSoft\Prefs\com\glavsoft\viewer\connections/History\0 delete value ui...
  3. run viewer again
@bsa7
bsa7 / hint.markdown
Last active August 29, 2015 14:02
xenserver: detect vnc port of vm

select your vm:

xe vm-list

detect id of dom of its vm:

xe vm-param-list uuid=8e2dd6ac-4883-0e6e-5cce-afbf214fa916 | grep dom-id

read vnc port by that dom_id:

@bsa7
bsa7 / hint.markdown
Last active August 29, 2015 14:02
bash echo color
@bsa7
bsa7 / command
Created June 22, 2014 15:28
unicorn start
unicorn -c config/unicorn.rb
@bsa7
bsa7 / tar_and_untar.markdown
Last active August 29, 2015 14:02
tar && untar directory

tar: tar -zcvf archive_name.tar.gz dir_name

untar: tar -zxvf file.tar.gz

@bsa7
bsa7 / trick.markdown
Last active August 29, 2015 14:02
git change file in index locally

example, if you want to change gitignore, but only in your local repo, do next:

git update-index --assume-unchanged .gitignore

@bsa7
bsa7 / trick.markdown
Created June 24, 2014 13:55
git stash some files

If you are changed some files, but won't include its in your commit, do next:

  1. include files only you need:

git add filename

  1. stash other files:

git stash --keep-index

@bsa7
bsa7 / tricks
Last active August 29, 2015 14:03
redmine textile formatting
url=http://www.redmine.org/projects/redmine/wiki/RedmineTextFormatting
Email addresses
Email addresses are automatically turned into clickable links:
"Email someone":mailto:someone@foo.bar -- Email link with different text: Email someone
More complex email instructions can be added to an email link. A default subject, default body and CC information can be defined. Note that spaces in any of these fields need to be replaced with the code %20.
"Email webmaster and admin":mailto:webmaster@foo.bar?cc=admin@foo.bar -- Email to webmaster, CC admin: Email webmaster and admin
"Email someone for help":mailto:someone@foo.bar?subject=Website%20Help -- Email link with the subject "Website Help": Email someone for help
@bsa7
bsa7 / application.js
Created June 29, 2014 11:55 — forked from lexmag/application.js
Rails 3,4 streaming
//= require jquery
//= require jquery_ujs
$(function() {
var source = new EventSource('/stream');
source.addEventListener('counter', function(e) {
$('body').after(e.data + '<br />');
});
});
@bsa7
bsa7 / hint.markdown
Created July 1, 2014 04:38
ubuntu - find files in directory recursive and delete thems. Symlinks also.
find -L . -name "*.png.webp" -exec rm {} \;