Skip to content

Instantly share code, notes, and snippets.

View furagu's full-sized avatar

Egor Balyshev furagu

  • XING
  • Hamburg, Germany
View GitHub Profile
sudo bash
cd /System/Library/Caches/com.apple.coresymbolicationd
rm -v grow.*
### Keybase proof
I hereby claim:
* I am furagu on github.
* I am furagu (https://keybase.io/furagu) on keybase.
* I have a public key whose fingerprint is B58D 735F 2393 B3C9 9BC3 22E6 F91E DC8C F71E 0B6F
To claim this, I am signing this object:
@furagu
furagu / .profile
Created July 15, 2014 01:40
My virtualenv setup for Mac OS X
# Python virtualenv setup
export WORKON_HOME=~/Envs
export VIRTUALENVWRAPPER_PYTHON=/opt/local/bin/python2.7
export VIRTUALENVWRAPPER_VIRTUALENV=/opt/local/bin/virtualenv-2.7
export VIRTUALENVWRAPPER_VIRTUALENV_CLONE=/opt/local/bin/virtualenv-clone-2.7
source /opt/local/bin/virtualenvwrapper.sh-2.7
has_virtualenv() {
if [ -e .venv ]; then
workon `cat .venv`
@furagu
furagu / hostname.mc
Created April 25, 2014 06:13
Sendmail tweaks
define(`confTO_CONNECT', `1m')
define(`confTO_IDENT', `0')
define(`confTO_COMMAND', `2m')
# For gmail to work on the hostname.ru
define(`MAIL_HUB', `hostname.ru.')
define(`LOCAL_RELAY', `hostname.ru.')
@furagu
furagu / svg-data-uri-snippet.md
Created March 16, 2014 07:43
Cleanup svg and make a data uri background

Requirements

  1. Python and Perl 5 (both come with any modern linux/unix operating system).
  2. Scour – an SVG scrubber. Install pip and then install Scour with pip install scour.

Usage

Export your graphics in plain SVG format with, for example, Incscape.

Open the folder where your files are located with terminal and run the following snippet:

@furagu
furagu / mojo-websocket-pubapp.pl
Last active April 8, 2022 19:13
Mojolicious websocket redis publish/subscribe example
#!/usr/bin/env perl
# Usage:
# cpanm Mojolicious Mojo::Redis
# ./mojo-websocket-pubapp.pl daemon
use Mojolicious::Lite;
use Mojo::Redis;
websocket '/' => sub {
@furagu
furagu / gist:8951806
Created February 12, 2014 08:23
git config
push.default=current
pull.rebase=true
filter.media.clean=git-media-clean %f
filter.media.smudge=git-media-smudge %f
alias.st=status
alias.ci=commit
alias.co=checkout
alias.br=branch
color.branch=auto
color.diff=auto
@furagu
furagu / destroy.pl
Created December 23, 2013 14:32
Simple Nginx & ipfw based ddos protection system.
#!/usr/bin/perl
use v5.10.0;
use strict;
use warnings;
use POSIX;
my $ipfw = '/sbin/ipfw';
my @bad_guys = map {/(\d+(?:\.\d+){3})/ ? $1 : ()} <>