Skip to content

Instantly share code, notes, and snippets.

View pulsejet's full-sized avatar

Varun Patil pulsejet

View GitHub Profile
@pulsejet
pulsejet / wpa_supplicant.conf
Created November 3, 2018 11:53 — forked from nihal111/wpa_supplicant.conf
Connect to IITB-Wireless through RPi. This config can be used to connect to any WPA2 Enterprise network in general. Just change the ssid, identity and password fields.
network={
ssid="IITB-Wireless"
scan_ssid=1
key_mgmt=WPA-EAP
identity="<your_username>"
password="<your_password>"
eap=PEAP
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}
@pulsejet
pulsejet / jpg2pdf.py
Created October 10, 2018 11:51
Convert all JPEG files in a directory to PDF
"""Converts all JPEG files in INPUT DIR to full size PDF.
requirements.txt
========================================
fpdf==1.7.2
========================================
Requires python 3.5+
"""
@pulsejet
pulsejet / resize-images.py
Created September 28, 2018 15:30
Resize images and convert to progressive JPG with pillow
from os import listdir
from os.path import isfile, join
from PIL import Image
mypath = '.'
onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f)) and '.jpg' in f]
MAX_DIM = 800
for path in onlyfiles:
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pulsejet
pulsejet / login.sh
Created June 2, 2018 05:42
Script to login to IITB Network
#!/bin/bash
if [[ -n $1 ]]
then
UNAME=$1
else
read -p 'Username: ' UNAME
[[ -z $UNAME ]] && exit 1
fi
import nltk
import xml.etree.ElementTree as ET
import copy
import difflib
tree = ET.parse('xmlsdev.xml')
root = tree.getroot()
def xml_stringify(node):
return "".join(node.itertext())
@pulsejet
pulsejet / diff_from_xml.py
Created May 31, 2018 13:47
Gets the diffs direct from XML
# NOTE: Currently this prints the diff for the second data element and exits
import nltk
import xml.etree.ElementTree as ET
import copy
import difflib
tree = ET.parse('xmlsdev.xml')
root = tree.getroot()
@pulsejet
pulsejet / sep_xml.py
Created May 31, 2018 10:49
Separate xml files removing tags (CRUDE)
import xml.etree.ElementTree as ET
tree = ET.parse('xmlsdev.xml')
root = tree.getroot()
with open('corrected', 'w', encoding='utf-8') as file:
i = 0
for sentence in root.iter('sentence'):
for child in sentence.findall('del'):
tail = child.tail
child.clear()
@pulsejet
pulsejet / verbs.csv
Created May 21, 2018 07:19
Verb dataset
present thrid_person continuous past
abandon abandons abandoning abandoned
abase abases abasing abased
abate abates abating abated
abbreviate abbreviates abbreviating abbreviated
abdicate abdicates abdicating abdicated
abduct abducts abducting abducted
abet abets abetting abetted
abhor abhors abhorring abhorred
abide abode abided abides
@pulsejet
pulsejet / mkxp_mruby.md
Last active May 5, 2018 06:33
Guide for mkxp with mruby

mkxp + mruby = ❤

RGSS Script Changes

Language differences

Replace all instances of

begin
    statement
end until condition

with