Skip to content

Instantly share code, notes, and snippets.

View letenkov's full-sized avatar
😀
Focusing

Eugene Letenkov letenkov

😀
Focusing
View GitHub Profile
@letenkov
letenkov / flutterw
Created April 20, 2020 00:47
Create a new project using the flutter wrapper
Create a new project using the flutter wrapper
You can create a new Flutter project without installing Flutter globally on your machine.
# 1. Create an empty git repo
mkdir flutter_wrapper_project && cd "$_"
git init
# 2. Install flutterw
sh -c "$(curl -fsSL https://raw.githubusercontent.com/passsy/flutter_wrapper/master/install.sh)"
@letenkov
letenkov / Dockerfile.mk
Created December 31, 2017 14:50 — forked from SmartFinn/DockerHelper.mk
Improved Makefile for Docker
OWNER ?= $(USER)
REPO ?= $(notdir $(CURDIR))
TAG ?= latest
IMAGE ?= $(OWNER)/$(REPO):$(TAG)
NAME ?= $(REPO)
DOCKER ?= $(shell which docker)
OPTIONS ?= --interactive --rm --tty
CMD ?=
all: build
@letenkov
letenkov / install-freeswitch-17.sh
Created December 14, 2016 06:13 — forked from areski/install-freeswitch-17.sh
Install FreeSWITCH 1.7
#!/bin/bash
#
# Arezqui Belaid <areski@gmail.com>
#
FS_CONFIG_PATH=/etc/freeswitch
FS_BASE_PATH=/usr/src
FS_VERSION=v1.7
@letenkov
letenkov / gist:d801ffa5d1043944d039c5f8d1cb0f64
Created October 13, 2016 12:00 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql
#!/bin/bash
# Source: http://toomuchdata.com/2012/06/25/how-to-install-python-2-7-3-on-centos-6-2/
# Install stuff #
#################
# Install development tools and some misc. necessary packages
yum -y groupinstall "Development tools"
yum -y install zlib-devel # gen'l reqs
/**
* Filter which adds CSRF information as response headers.
*
* @author Patrick Grimard
* @since 12/31/2013 4:48 PM
*/
public final class CsrfTokenGeneratorFilter extends OncePerRequestFilter {
@Override
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
CsrfToken token = (CsrfToken) request.getAttribute("_csrf");
/**
* CsrfTokenRepository implementation which duplicates HttpSessionCsrfTokenRepository functionality, but also
* adds the generated token to the response as a header when saving the token.
*
* @author Patrick Grimard
* @since 12/31/2013 3:44 PM
*/
public final class HttpHeaderCsrfTokenRepository implements CsrfTokenRepository {
/* other code left out for brevity */