Skip to content

Instantly share code, notes, and snippets.

Avatar

Arunmozhi tecoholic

View GitHub Profile
View chatgpt_models.py
"""
This entire file is from ChatGPT generated code.
Here are the list of prompts that led to this output:
1. Create a Django model to record bank transactions from a personal bank
account
2. add currency, foreign currency related fields to the model to handle
international transactions
3. Create an account model to hold the bank account information and update
@tecoholic
tecoholic / symbol_xml2db.py
Created May 28, 2012 10:01
[GSoC] Python Script which converts the symbols XML file to a SQLite DB
View symbol_xml2db.py
#!/usr/bin/python
"""
/***************************************************************************
symbol_xml2db.py
-------------------
begin : 26-5-2012
copyright : (C) 2012 by Arunmozhi
email : aruntheguy at gmail dot com
***************************************************************************/
@tecoholic
tecoholic / wireshark_http_extractor.py
Created February 6, 2019 07:56
Extract the flow of requests and responses from a Wireshark dump JSON exported file
View wireshark_http_extractor.py
import sys
import json
from urllib.parse import urlparse, parse_qs
def parse_multimap(ordered_pairs):
"""JSON loads object_pairs_hook, which creates a list of values when
duplicate keys are found in the JSON file being parsed
View TNEA_2022_Seats_25_09_2022.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 11 columns, instead of 4. in line 6.
COLLEGE CODE,COLLEGE NAME,BRANCH CODE,BRANCH NAME,OC,BC,BCM,MBC,SC,SCA,ST
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",BY,BIO MEDICAL ENGINEERING (SS),0,0,0,0,0,2,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",CE,CIVIL ENGINEERING,0,0,0,0,3,2,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",CM,COMPUTER SCIENCE AND ENGINEERING (SS),0,0,0,0,0,0,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",CS,COMPUTER SCIENCE AND ENGINEERING,0,0,0,0,0,0,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",EC,ELECTRONICS AND COMMUNICATION ENGINEERING,0,0,0,0,0,0,0
1,"University Departments of Anna University, Chennai - CEG Campus, Sardar Patel Road, Guindy, Chennai 600 025",EE,ELECTRICAL AND ELECTRONICS EN
@tecoholic
tecoholic / ubuntu.sh
Created May 24, 2011 08:10
Useful Ubuntu Commands
View ubuntu.sh
# Package to install, to get an open terminal in Right-Click context menu.
sudo apt-get install nautilus-open-terminal
# To move window controls in your Ubuntu from left to right…
gconftool-2 --type string --set /apps/metacity/general/button_layout "menu:minimize,maximize,close"
# To switch back
gconftool-2 --type string --set /apps/metacity/general/button_layout "close,maximize,minimize:menu"
# Repeat last command with sudo
sudo !!
@tecoholic
tecoholic / process.py
Last active February 16, 2022 16:43
Python script to replace an image file in the PDF
View process.py
import sys
import os
from PIL import Image
# Include the \n to ensure extact match and avoid partials from 111, 211...
OBJECT_ID = "\n11 0 obj"
def replace_image(filepath, new_image):
@tecoholic
tecoholic / .bashrc
Last active May 4, 2021 14:13
My .bashrc file with a little tweak to show 'git' repo status
View .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@tecoholic
tecoholic / osm2geo.js
Created November 27, 2011 04:57
OSM2GEO - A JS Converter to convert OSM to GeoJSON
View osm2geo.js
/**************************************************************************
* OSM2GEO - OSM to GeoJSON converter
* OSM to GeoJSON converter takes in a .osm XML file as input and produces
* corresponding GeoJSON object.
*
* AUTHOR: P.Arunmozhi <aruntheguy@gmail.com>
* DATE : 26 / Nov / 2011
* LICENSE : WTFPL - Do What The Fuck You Want To Public License
* LICENSE URL: http://sam.zoy.org/wtfpl/
*
@tecoholic
tecoholic / 01-11-2020.txt
Last active November 25, 2020 04:31
CovidBulletinExtractor.ipynb
View 01-11-2020.txt
COVID-19 Positive Deaths without comorbidities – Total: 2
Death in Private health facilities without comorbidities
Death Case No. 11133
A 58 Years old Male from Vellore having COVID-19 RTPCR Positivity on
29.10.2020 admitted on 18.10.2020 at 09.32 AM in a private medical college
and hospital, Vellore with Complaints of Fever, Cough for 5 days and
Difficulty in Breathing for 2 days died on 29.10.2020 at 04.30 AM due to
ARDS / COVID-19 Pneumonia.
Death in Government health facilities (DMS) without comorbidities
Death Case No. 11134
@tecoholic
tecoholic / category.js
Created August 11, 2020 15:20
Strapi Controller file implementing the IsOwner Policy
View category.js
'use strict';
const { parseMultipartData, sanitizeEntity } = require("strapi-utils");
/**
* Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers)
* to customize this controller
*/
module.exports = {