Skip to content

Instantly share code, notes, and snippets.

View chayn1k's full-sized avatar

Pavel Tchaikovsky chayn1k

View GitHub Profile
@chayn1k
chayn1k / Instructions.md
Created March 29, 2019 07:36 — forked from pgilad/Instructions.md
Git commit-msg hook to validate for jira issue or the word merge

Instructions

  • copy the file commit-msg to .git/hooks/commit-msg
  • make sure your delete the sample file .git/hooks/commit-msg.sample
  • Make commit msg executable. chmod +x .git/hooks/commit-msg
  • Edit commit-msg to better fit your development branch, commit regex and error message
  • Profit $$

Shell example

@chayn1k
chayn1k / .gitconfig
Created January 4, 2019 09:27 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
username = pksunkara
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
@chayn1k
chayn1k / gist:56e7a36a8169c40843749f2725a912f9
Created October 7, 2018 22:54 — forked from cowboyd/gist:1045642
Restart racoon on OSX
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.racoon.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.racoon.plist
@chayn1k
chayn1k / ipsec-ios.md
Created October 7, 2018 10:35 — forked from skion/ipsec-ios.md
Racoon config that works with MacOS 10.11, iOS 8, Android 6.0
  • Add VPN Configuration
  • IPSEC
  • Server: your-ip
  • Account: shell user
  • Password: shell password
  • Use certificate: Off
  • Group name: Blank
  • Secret: your-strong-secret
@chayn1k
chayn1k / README.md
Created October 4, 2018 17:57 — forked from evandrix/README.md
Headless web browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@chayn1k
chayn1k / comparison.md
Last active September 8, 2018 23:27 — forked from kchida/gist:d1c15f3968f4f8272c49
etcd vs consul vs ???
  • What do Etcd, Consul, and Zookeeper do?
    • Service Registration:
      • Host, port number, and sometimes authentication credentials, protocols, versions numbers, and/or environment details.
    • Service Discovery:
      • Ability for client application to query the central registry to learn of service location.
    • Consistent and durable general-purpose K/V store across distributed system.
      • Some solutions support this better than others.
      • Based on Paxos or some derivative (i.e. Raft) algorithm to quickly converge to a consistent state.
  • Centralized locking can be based on this K/V store.
@chayn1k
chayn1k / is_installed.sh
Created July 15, 2018 20:37 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
@chayn1k
chayn1k / lodash-fp-documentation.md
Created July 15, 2018 20:17 — forked from jfmengels/lodash-fp-documentation.md
Generated docs for Lodash/fp. Help make them better at https://github.com/jfmengels/lodash-fp-docs
@chayn1k
chayn1k / FiddlerScript.cs
Created January 26, 2018 22:36 — forked from antelle/FiddlerScript.cs
Change response in Fiddler
static function OnBeforeRequest(oSession: Session) {
if (oSession.RequestMethod == 'GET' && oSession.PathAndQuery.IndexOf('part_of_your_url') > 0) {
oSession.utilCreateResponseAndBypassServer();
oSession.oResponse.headers.HTTPResponseCode = 401;
oSession.oResponse.headers.HTTPResponseStatus = '401 Not Authorized';
oSession.oResponse.headers['Access-Control-Allow-Origin'] = '*';
oSession.utilSetResponseBody('response_body');
}
}
@chayn1k
chayn1k / convertImgToBase64.js
Created May 18, 2017 14:38 — forked from MarkoCen/convertImgToBase64.js
Read Image (PNG/JPEG) From Disk and Convert it to base64-encoded string on Node Server
var express= require('express');
var http = require('http');
var fs = require('fs');
var path = require('path');
var app = express();
server = http.createServer(app);
app.set('view engine', 'jade');