Skip to content

Instantly share code, notes, and snippets.

@sfelde
sfelde / typo3-nginx
Created February 1, 2014 13:10
nginx-typo3
server {
# listen 80; ## listen for ipv4; this line is default and implied
root /srv/dlf;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
location = /favicon.ico {
@sfelde
sfelde / static-page
Created December 3, 2017 21:43
static-page
wget -P ./static -mpck --user-agent="" -e robots=off --wait 1 -E http://www.page.de/
@sfelde
sfelde / wget
Created September 29, 2017 18:08 — forked from jasperf/wget
Wget examples
#Spider Websites with Wget – 20 Practical Examples
Wget is extremely powerful, but like with most other command line programs, the plethora of options it supports can be intimidating to new users. Thus what we have here are a collection of wget commands that you can use to accomplish common tasks from downloading single files to mirroring entire websites. It will help if you can read through the wget manual but for the busy souls, these commands are ready to execute.
1. Download a single file from the Internet
wget http://example.com/file.iso
2. Download a file but save it locally under a different name
wget ‐‐output-document=filename.html example.com
/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@sfelde
sfelde / nginx.conf
Created November 13, 2016 13:01 — forked from Stanback/nginx.conf
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender).Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
# Note (November 2016):
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
@sfelde
sfelde / gist:1aeac7937abda27248b926222425fed1
Created August 22, 2016 15:33 — forked from mikhailov/gist:9639593
Nginx S3/Unicorn Proxy with backend keep alive
# The Nginx configuration based on https://coderwall.com/p/rlguog
http {
ssl_certificate server.crt;
ssl_certificate_key server.key;
ssl_session_timeout 15m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:SSL:10m;
@sfelde
sfelde / kiev-map-example.json
Created March 11, 2016 19:47
kiev-map-example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Tools and libraries which I prefer to use in Python stack

Development Environment

  • Ubuntu Linux for both development and production
  • Git version control system
  • Jenkins CI build server (but recently I'm moving to git server-side hooks with ssh from git server to dev/stage/prod servers)
  • Redmine bug tracking system
  • JetBrains PyCharm IDE

Production Environment

@sfelde
sfelde / gitlab
Created December 22, 2013 14:03
gitlab
#они напишут если вдруг чтото не так
sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
# чтоб запустить перезапустить или еше чтото
:/home/git/gitlab# /etc/init.d/gitlab
Usage: sudo service gitlab {start|stop|restart|reload}
@sfelde
sfelde / auth-subdomain
Created October 12, 2013 15:58
auth for subdomain
...
if ($host ~ "(beta|alpha).domain.com" ) {
return 555;
}
error_page 555 = @auth;
location @auth {
auth_basic "Restricted";
auth_basic_user_file /home/..../.htpasswd;