Skip to content

Instantly share code, notes, and snippets.

View jurka's full-sized avatar

Iurii Ogiienko jurka

  • Sentinel Software
  • Morrisville, NC, USA
  • 03:31 (UTC -05:00)
  • LinkedIn in/ogiienko
View GitHub Profile
@jurka
jurka / gist:3953048
Created October 25, 2012 14:53
svn 2 git migration
sudo apt-get install git-core git-svn ruby rubygems
sudo gem install svn2git
mkdir svn-repo
cd svn-repo
svn co [SVN URL] .
svn log -q | awk -F '|' '/^r/ {sub("^ ", "", $2); sub(" $", "", $2); print $2" = "$2" <"$2">"}' | sort -u > authors-transform.txt
# edit authors-transform.txt to this format:
@jurka
jurka / duh.sh
Created July 12, 2012 10:33
normal data usage for linux
# display data usage in megabytes for each file in folder sorted from biggest to lowes
du -shm *| sort -rg
@jurka
jurka / gist:3027104
Created July 1, 2012 06:19
Installing supervisor under ubuntu
#run as sudo
apt-get install python-setuptools curl
easy_install supervior
curl https://raw.github.com/gist/176149/88d0d68c4af22a7474ad1d011659ea2d27e35b8d/supervisord.sh > /etc/init.d/supervisord
#to run it
chmod +x /etc/init.d/supervisord
#adding to autostart
@jurka
jurka / gist:2999593
Created June 26, 2012 22:05
Install sublime text 2 on ubuntu from PPA
sudo add-apt-repository ppa:webupd8team/sublime-text-2
sudo apt-get update
# Optional: remove any installed Sublime Text 2 packages:
sudo apt-get remove sublime-text*
sudo apt-get install sublime-text*
@jurka
jurka / muli_run.sh
Created April 19, 2012 09:51
Run several same commands simultaniously
# this command allow to run "python test.py" 10 times
# useful for different types of tests
# declare -i i=0 ; while [ "$i" -l "10" ]; do python test.py & i=$i+1; done
# this is just draft variant.
# todo: create separate command with syntax mrun.sh <num> <command>
@jurka
jurka / gist:1941107
Created February 29, 2012 14:06
wildcard self signed certificate generation
# Generating 2048 key file with RSA
openssl genrsa 2048 > host.key
# Generating certificate for 10 years with our new key
# couple of question will be promted
# when you will be asked for Common Name, you need to specify *.domain.com
openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert
# getting info for our certificate
openssl x509 -noout -fingerprint -text < host.cert > host.info
@jurka
jurka / gist:1759829
Created February 7, 2012 14:01
Install nginx on ubutntu 10.04 LTS via PPA
#you need to have root rigths
sudo su
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx-full
/etc/init.d/nginx restart
@jurka
jurka / cron task
Created November 20, 2011 23:19
cron task
#!/bin/sh
# file location: /var/project/jobs/fetch-and-update.sh
echo "Started at $(date +%Y-%m-%d\ %H:%M)"
echo ">>> fetch >>>"
time /var/project/fetch.sh
echo ">>> prepare >>>"
time /var/project/prepare.sh