Skip to content

Instantly share code, notes, and snippets.

@aectann
aectann / simpleHttpServer.py
Created September 16, 2015 10:50 — forked from azakordonets/simpleHttpServer.py
Python simple HTTP Server that get's two variables for launch - port and time delay( time after which server will return response) . If we do not specify this two values, then server starts on 8000 port with delay = 0
#!/usr/bin/env python
import SimpleHTTPServer, BaseHTTPServer, SocketServer, socket, time, sys
class ThreadedHTTPServer(SocketServer.ThreadingMixIn,
BaseHTTPServer.HTTPServer) :
"""
New features w/r to BaseHTTPServer.HTTPServer:
- serves multiple requests simultaneously
- catches socket.timeout and socket.error exceptions (raised from
@aectann
aectann / gist:e05be383b8a8c79cebe8
Last active August 29, 2015 14:10
Harvest time entry.
var days = ['Monday','Tuesday','Wednesday','Thursday','Friday'];
var i;
for (i in days) {
var day = days[i];
$('.test-'+day).last().trigger('click');
$('.js-new-time-entry').last().trigger('click');
$('#entry-duration').last().val('7.6');
$('.js-save').trigger('click');
}
@aectann
aectann / author-override.sh
Created May 2, 2014 17:10
Override all git commits' author & comitter.
git filter-branch -f --commit-filter 'export GIT_AUTHOR_NAME="Author name" ; export GIT_AUTHOR_EMAIL=author_email@example.com; export GIT_COMMITTER_NAME="Comitter Name"; export GIT_COMMITTER_EMAIL=comitter_email@example.com; git commit-tree "$@"'
#Append following to .bashrc
#To sync run git-sync
alias git-sync='git checkout master&&git pull origin master&&git checkout svnsync&&git svn rebase&&git merge --no-ff master -m "Auto-merge on svn sync"&&git svn dcommit&&git checkout master'
@aectann
aectann / gist:5787499
Created June 15, 2013 09:16
Update kernel on Ubuntu.
mkdir kernel v3.3.1-precise && cd kernel v3.3.1-precise
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3.1-precise/linux-headers-3.3.1-030301-generic_3.3.1-030301.201204021435_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3.1-precise/linux-headers-3.3.1-030301_3.3.1-030301.201204021435_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.3.1-precise/linux-image-3.3.1-030301-generic_3.3.1-030301.201204021435_amd64.deb
sudo dpkg -i linux-*.deb
sudo update-grub
@aectann
aectann / Eclipse Ubuntu Unity menu fix
Created June 1, 2013 02:52
Fixes eclipse menu in unity on Ubuntu 13.04. Be sure backup the libappmenu.so first.
cd /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/menuproxies
sudo sed -i 's/Eclipse/Xclipse/' libappmenu.so