Skip to content

Instantly share code, notes, and snippets.

View ereli's full-sized avatar

Ereli ereli

View GitHub Profile
# 10/5/2014
# so if you're using google finance and wanted to export your porfolio, including your transactions to a CSV format -> here is a script that lets you do that.
# you can also print the current portflio - located on ofx.security_list
# inspired by https://github.com/chrisroos/ofx-to-csv
from ofxparse import OfxParser
import csv
ofx = OfxParser.parse(file('portfo.ofx'))
import fileinput
import json
for line in fileinput.input():
try:
print(json.dumps(json.loads(line)))
except:
pass
curl --resolve www.google.com:443:74.125.239.116:443 https://www.google.com
#
# AT commands ref :http://www.fccps.cz/img.asp?attid=24590
# credit to: https://gist.github.com/pmarti/11120153
import serial
from smspdu import SMS_SUBMIT
def send_text(number, text):
# encode the SMS
p = SMS_SUBMIT.create('sender', number, text)
#!/usr/bin/env python
import serial
from datetime import datetime
import winsound
#import msvcrt
ser = serial.Serial("COM4", 9600)
while True:
s = str(ser.readline())
ls *.rpm | \
xargs rpm --query --filesbypkg --package | \
grep configure.py
@ereli
ereli / gist:5cc39cff8bbb19b16997
Last active August 29, 2015 14:15
create screetshot from the command-line using Python and Ghost
from ghost import Ghost
from sys import argv
def main():
url = argv[1]
path = argv[2]
screenshot(url,path)
def screenshot(url,path):
ghost = Ghost()
@ereli
ereli / b
Created March 9, 2015 11:02
How to convert a color pdf into greyscale from the command line
convert -density 600 -colorspace gray input.pdf output_greyscale.pdf
@ereli
ereli / gist:8ea1892e362fbac92d8c
Last active August 29, 2015 14:18
regain admin access to hue after you've enabled LDAP/AD integration on Hue 2.5 and change group names that cannot be changed in the web UI
sqlite3 /var/lib/hue/desktop.db
UPDATE auth_user SET is_superuser=1 WHERE username='hadoop-user-admin';
UPDATE auth_group SET name='default_group' where id=3;
@ereli
ereli / gist:6174406
Last active December 20, 2015 18:18
#!/bin/bash
password="xxxx"
for OUTPUT in $(find|grep "\.zip"|cut -c 3-)
do
length=$(expr length $OUTPUT)
addtive=`expr substr $OUTPUT $((length-4)) 1`
finalpass="$password$addtive"
unzip -P $finalpass $OUTPUT
done