Skip to content

Instantly share code, notes, and snippets.

@khapota
khapota / vundle.sh
Created August 18, 2017 07:57
Install vundle
#!/bin/bash
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
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
@khapota
khapota / bash-setup.sh
Created August 18, 2017 04:23
Bash it
#!/bin/bash
git clone --depth=1 https://github.com/Bash-it/bash-it.git ~/.bash_it
~/.bash_it/install.sh
@khapota
khapota / .zshrc
Last active July 23, 2020 04:01
Zsh zplug
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 December 27, 2016 15:06
linnworks update price
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 April 13, 2016 02:16
upload files python request
import requests
files = {"upload_file": open('path/to/file.txt', 'rb')}
data = {"content": "test upload"}
requests.post(url, files=files, data=data)
@khapota
khapota / self_sign.sh
Created April 12, 2016 08:00
ssl self sign
openssl req -newkey rsa:2048 -sha256 -nodes -keyout khapota.key -x509 -days 365 -out khapota.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=khapota.info"
@khapota
khapota / letencrypt_creator.sh
Last active March 30, 2016 09:13
Letencrypt create with current web server
# need to setup dns of your domain first
# cert will be stored in /etc/letencrypt
# renew command without --force-renew will not get new certificate if old certificate has long live til expired
./letsencrypt-auto certonly --webroot -w /usr/share/nginx/www -d domain.com --email phankhanh@gmail.com --agree-tos
@khapota
khapota / sources.list
Created March 30, 2016 08:32
debian 7 source list
deb http://debian.xtdv.net/debian/ wheezy main contrib non-free
@khapota
khapota / notify.py
Last active March 9, 2016 01:50
Telegram CLI (tg) mac os notify script
import tgl
import os
# This is a python script that run with tg and notify when get new message
# Using terminal-notifier https://github.com/julienXX/terminal-notifier
# The notifier function
def notify(title, subtitle, message):
t = '-title "%s"' % title
s = '-subtitle "%s"' % subtitle