Skip to content

Instantly share code, notes, and snippets.

View vpotap's full-sized avatar

Vladimir Potapov vpotap

View GitHub Profile
@vpotap
vpotap / full-ffmpeg.sh
Last active December 14, 2017 23:38
Install full ffmpeg 2.7 in debian wheezy (with aac(m4a) and x264 support and VP8(libvpx))
#remove all old ffmpeg
sudo apt-get autoremove $(dpkg -l | grep ffmpeg | awk '{print $2}' | tr '\n' ' ')
sudo apt-get --purge remove $(dpkg -l | grep ffmpeg | awk '{print $2}' | tr '\n' ' ')
sudo find / | grep -w ffmpeg | sudo xargs rm -r -f
#add repo
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
@vpotap
vpotap / gunicorn_with_virtualenv
Created December 3, 2016 15:36 — forked from shrkw/gunicorn_with_virtualenv
CentOS init script for Gunicorn with Virtualenv
#!/bin/sh
#
# gunicorn_sr Startup script for gunicorn for sr
#
# chkconfig: - 86 14
# processname: gunicorn
# pidfile:
# description: Python application server
#
### BEGIN INIT INFO
@vpotap
vpotap / _gvimrc
Created March 5, 2017 22:34 — forked from GopinathMR/_gvimrc
GVim config file (for both Windows and Unix)
" Gopi's _gvimrc file https://github.com/GopinathMR
" This file has been modified to make it work on both Windows and Linux
" Github gist location : https://gist.github.com/1100054
" If you find any issues or add any enhancements, please submit revised version as gist
"----------------------------------------------------------------------------------------------------------
" 1. OS specific
if ($OS == 'Windows_NT')
" Windows specific settings
/**
* Determine whether the file loaded from PhoneGap or not
*/
function isPhoneGap() {
return (window.cordova || window.PhoneGap || window.phonegap)
&& /^file:\/{3}[^\/]/i.test(window.location.href)
&& /ios|iphone|ipod|ipad|android/i.test(navigator.userAgent);
}
window.isMobileApp = !!isPhoneGap();
<script type='text/javascript'>
if(is_width_above('l')) {
var ox_u = 'http://advert.rigasvilni.lv/www/delivery/al.php?zoneid=125&layerstyle=introbaner&keywords=' + window.relay_ad_keywords ;
if (document.context) ox_u += '&context=' + escape(document.context);
document.write("<scr"+"ipt type='text/javascript' src='" + ox_u + "'></scr"+"ipt>");
}
</script>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Test DFP Ads</title>
<!-- google cdn -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>(function (w, d, s, l, i) {
<script type='text/javascript'>
if (is_width_above('l')) {
var ox_u = 'http://advert.rigasvilni.lv/www/delivery/al.php?zoneid=127&layerstyle=introbaner&keywords=' + window.relay_ad_keywords;
if (document.context) ox_u += '&context=' + encodeURIComponent(document.context);
document.write("<scr" + "ipt type='text/javascript' src='" + ox_u + "'></scr" + "ipt>");
}
</script>
@vpotap
vpotap / iterm2-solarized.md
Created April 11, 2017 22:13 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@vpotap
vpotap / install-comodo-ssl-cert-for-nginx.rst
Created May 21, 2017 12:08 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@vpotap
vpotap / nginx-tuning.md
Created May 29, 2017 20:17 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.