Skip to content

Instantly share code, notes, and snippets.

Khapota khapota

Block or report user

Report or block khapota

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
View How to install tmux on centos 7
tmux is a "terminal multiplexer", it enables a number of terminals to be accessed and controlled from a single terminal.
If you use Debian/Ubuntu, you can just run apt-get install tmux, and voila.
Since the title was about centos 7, then do the following step to install tmux.
(1). tmux has a library dependency on libevent which, of course, isn’t installed by default.
$ wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
$ tar xzvf libevent-2.0.21-stable.tar.gz
$ cd libevent-2.0.21-stable
@khapota
khapota / mongoperf.md
Last active Aug 25, 2017
Mongo Performance check and tune
View mongoperf.md
@khapota
khapota / mongokill.js
Created Aug 21, 2017
Kill long query
View mongokill.js
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5 && op.op == 'query') printjson(op);
}
)
@khapota
khapota / mongokill.js
Created Aug 21, 2017
Kill long query
View mongokill.js
db.currentOp().inprog.forEach(
function(op) {
if(op.secs_running > 5 && op.op == 'query') printjson(op);
}
)
@khapota
khapota / vundle.sh
Created Aug 18, 2017
Install vundle
View vundle.sh
#!/bin/bash
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
View vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
View bash-setup.sh
#!/bin/bash
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
~/.bash_it/install.sh
View zshrc
source ~/.zplug/init.zsh
## Prezto
zplug "modules/directory", from:prezto
zplug "modules/environment", from:prezto
zplug "modules/history", from:prezto
zplug "modules/completion", from:prezto
zplug "modules/spectrum", from:prezto
zplug "modules/git", from:prezto
zplug "modules/utility", from:prezto
@khapota
khapota / linnworksUpdatePrice.php
Last active Dec 27, 2016
linnworks update price
View linnworksUpdatePrice.php
function updatePrice($itemId, $price, $title) {
$header = array('Host' => 'eu1.linnworks.net',
'Connection' => 'keep-alive',
'Accept' => 'application/json, text/javascript, */*; q=0.01',
'Origin' => 'https://www.linnworks.net',
'User-Agent' => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36',
'Content-Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer' => 'https://www.linnworks.net/',
'Authorization' => '6f004779-0784-45bd-86b5-7bec6bc475',
'Accept-Encoding' => 'gzip, deflate');
@khapota
khapota / upload.py
Created Apr 13, 2016
upload files python request
View upload.py
import requests
files = {"upload_file": open('path/to/file.txt', 'rb')}
data = {"content": "test upload"}
requests.post(url, files=files, data=data)
You can’t perform that action at this time.