Skip to content

Instantly share code, notes, and snippets.

View ereli's full-sized avatar

Ereli ereli

View GitHub Profile
@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
# 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 / gist:e868fcaeb660e420d7a6
Last active April 3, 2024 10:01
Installing Centos using DHCP, TFTP and Kickstart

Installing Centos using DHCP, TFTP and Kickstart Files.

We want to deploy physical nodes before cluster installation, in order to speed up the deployment, we'd like to automate most of the process, requiring us only to enter hostnames and IP address. we will need:

  • A DHCP Server
  • TFTP Server
  • HTTP Server
  • Centos ISO file
  • Optionally: local repo server, local dns server, local ntp server.
@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