Skip to content

Instantly share code, notes, and snippets.

@kossoy
kossoy / whatsize.sh
Last active February 26, 2016 17:18
WhatSize in shell
#!/usr/bin/env bash
# Thanks to bolk http://bolknote.ru/2011/09/14/~3407#07
function PrintBar {
if [[ $TERM =~ 256 || $TERM_PROGRAM = "iTerm.app" ]]; then
local colors=("38;5;34" "38;5;220" "38;5;160")
else
local colors=(32 33 31)
fi
@kossoy
kossoy / dumper.phtml
Created October 4, 2011 14:35
Dummy file dumper
<?php
header('Content-Type: text/html; charset=UTF-8');
# Folder-DB no in web root
define('DB_FOLDER', dirname(__FILE__) . '/../svalka/');
if (isset($_REQUEST['submit'])) {
// Handle the form submit
if('' == $_REQUEST['file-name']) die('Empty filename');
file_put_contents(
@kossoy
kossoy / 1 Install nginx.sh
Created August 30, 2011 12:14
Nginx on Mac OS X
#!/usr/bin/env bash
PCRE_DIR="pcre-8.12"
PCRE_LINK="ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/$PCRE_DIR.tar.gz"
NGNIX_DIR="nginx-0.8.54"
NGNIX_LINK="http://nginx.org/download/$NGNIX_DIR.tar.gz"
## DOWNLOADS
curl -OL h $PCRE_LINK > $PCRE_DIR.tar.gz
@kossoy
kossoy / sshgit.sh
Created August 26, 2011 05:57
SSH + git quick cheatsheet for Mac
cd ~/.ssh
ssh-keygen -t rsa -C "[email protected]"
cat ~/.ssh/id_rsa.pub | pbcopy
# scp somewhere or paste to github keys
git config --global user.name "name"
git config --global user.email [email protected]
# may be proxy