Skip to content

Instantly share code, notes, and snippets.

View antsankov's full-sized avatar

Alex Tsankov antsankov

View GitHub Profile
@antsankov
antsankov / Process Killer
Last active December 12, 2015 04:18
Process Killer (Helpful for your server) So I was doing some research and I found this script to use for your server, I have tested it out and tweaked it on my own machine, so if you are interested contact me so I can start making the tweaks so it is optimized for the retrograde server. Regards, Alex Tsankov
#!/bin/bash
##Note: will kill the top-most process if the $CPU_LOAD is greater than the $CPU_THRESHOLD.
#################### FOR TEST PURPOSES ONLY STILL NEEDS TO BE TWEAKED!!!#################
echo
echo checking for run-away process ...
CPU_LOAD=$(uptime | cut -d"," -f4 | cut -d":" -f2 | cut -d" " -f2 | sed -e "s/\.//g")
CPU_THRESHOLD=75 # This needs to be customized for the server so it knows when to start killing programs.
PROCESS=$(ps aux r)
TOPPROCESS=$(ps -eo pid -eo pcpu -eo command | sort -k 2 -r | grep -v PID | head -n 1)
group population income
Under 05 21434 8
05 to 09 20785 9
10 to 14 19893 10
15 to 19 21086 13
20 to 24 21154 16
25 to 29 21453 27
30 to 34 19632 32
35 to 39 19888 35
40 to 44 20559 36
sourcetype=* host="hack" | chart payplan by AppointmentTerm
@antsankov
antsankov / gist:a8cd5410f37e267f48b8
Created October 16, 2014 03:37
Final project idea for Big Data

Peiman,

I’m in the Big Data class and I noticed an awesome library: Melopy which transforms python code and simple method calls into musical notes on a .wav file to be played through a media player.

I was wondering if you would like to collaborate on this idea for a final project:

  1. Take the input from the arudino
  2. Parse it with python.
  3. Use it as a random seed to generate a note OR
  4. make a mapping of arrays of decibel measurements gathered each second to sound notes and arrange a song from the 100s of measurements every couple of seconds.
@antsankov
antsankov / watchdogTest.py
Last active February 1, 2016 16:22
Watchdog Test
import sys
import time
import logging
from watchdog.observers import Observer
from watchdog.events import *
#http://stackoverflow.com/questions/18599339/python-watchdog-monitoring-file-for-changes
class MyHandler(LoggingEventHandler):
#this creates the list of paths
def __init__(self):
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDe/P/RUSyyS9zlX4XU4fJkR5srQE3V+REJ81RSCp45154EHvItlBXcAtwPY1DEIljADiAaO/j51vP0Y2b9XQ++ccmCYkx3IhdQ/aRCGLTNeI2uw02fT38ekDgBBxpBvqgwl6tKd1uG2La+hFnFwScBJwbICL6ofuSwl50i3IW9XIx8eGIkImapPIfPrSYjNE5DJh3enQHqWsrPHQJroFCJl74/LFJiIEY7xdDmUD2WB2gRrw0erIC3+eQ+H4DRzbJ9oIb/3gg4cWlngJQBABvb4S5pXaJmjmy/bxqJJJsLklwjB/CG0GAMIMqItyxfbZnBBpT4kT3sXKwvF2CK38tz antsankov@Alexanders-MacBook-Air.local
import sys
import time
import logging
from watchdog.observers import Observer
from watchdog.events import *
#http://stackoverflow.com/questions/18599339/python-watchdog-monitoring-file-for-changes
class MyHandler(LoggingEventHandler):
#this creates the list of paths
def __init__(self):
#!flask/bin/python
from flask import Flask,jsonify,request
app = Flask(__name__)
recipes = [
{
'id' : 1,
'title' : u'lasagna',

Keybase proof

I hereby claim:

  • I am antsankov on github.
  • I am antsankov (https://keybase.io/antsankov) on keybase.
  • I have a public key ASAMb9TNsYW-b7E8pSWz_5UKSyfIjw6xqL5K4JtbrvVpfAo

To claim this, I am signing this object: