Skip to content

Instantly share code, notes, and snippets.

View tecoholic's full-sized avatar

Arunmozhi tecoholic

View GitHub Profile
@tecoholic
tecoholic / process.py
Last active October 6, 2023 10:48
Python script to replace an image file in the PDF
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 / tiny_projects.md
Last active January 17, 2019 11:54
List of tiny projects to learn and showcase

1. Metro

Realtims OS metrics dashboard

Topics covered

  1. Ansynchronous Communication
  2. Server side push
  3. Websockets

2. Student Score Graph

A graph generator for the marks of students from CSV files

Topics covered

@tecoholic
tecoholic / Sample_input.txt
Last active February 7, 2018 17:24
Flash Card Generator - Python LaTeX
Question 1
Answer 1
Question 2
Answer 2
diff --git a/clusterapp.py b/clusterapp.py
index 46d85d1..685b482 100644
--- a/clusterapp.py
+++ b/clusterapp.py
@@ -4,9 +4,6 @@ from clustermgr.application import create_app, init_celery
from clustermgr.extensions import celery
from flask.cli import FlaskGroup
-app = create_app()
-init_celery(app, celery)
from oxdpython import Client
client = Client("/location/to/conf")
client.register_site()
auth_url = client.get_authorization_url()
# code = parse_callback_url_querystring() # Refer your web framework
# state = parse_callback_url_querystring() # Refer your web framework
tokens = client.get_tokens_by_code(code, state)
user = client.get_user_info(tokens.access_token)
# The claims can be accessed using the dot notation.
print user.username
macroset = {
"oxObjectClass": "oxPublished:4",
"oxReserved": "oxOrgOID:0",
"oxSyntax": "oxPublished:1",
"oxOrgOID": "1.3.6.1.4.1.48710",
"oxSomething": "oxAttribute:0",
"oxThird": "oxSomething:3",
"oxMatchRules": "oxPublished:2",
"oxPublished": "oxOrgOID:1",
"oxAttribute": "oxPublished:3",
#!/usr/bin/python
# Requires JSON Merge library
# wget https://github.com/avian2/jsonmerge/archive/master.zip
# unzip master.zip
# cd jsonmerge-master
# python setup.py install
# Also requires ldif.py in same folder
#!/usr/bin/python
# Requires JSON Merge library
# wget https://github.com/avian2/jsonmerge/archive/master.zip
# unzip master.zip
# cd jsonmerge-master
# python setup.py install
# Also requires ldif.py in same folder
@tecoholic
tecoholic / tmp_gluu_openldap_setup.md
Last active October 24, 2016 19:00
A temporary procedure to setup and test openldap in alpha versions of Gluu Server 3.0.0

Pre-requisites

  • Ubuntu 14.04
  • OpenLDAP Binary as a deb package - Preferably Symas Openldap Gold

Procedure for migrating an existing Gluu Server 2.4.4

  1. Export the ldap data using the export_opendj script
service gluu-server-2.4.4 login
wget https://raw.githubusercontent.com/GluuFederation/community-edition-setup/master/static/scripts/export_opendj.py
@tecoholic
tecoholic / 05oct2016
Last active October 6, 2016 19:30
Notes on OpenLDAP migration
Today's Research
================
OpenDJ Setup steps in Setup.py
------------------------------
* installObject.configure_opendj_install()
- sets the load ldif command
- sets the ldap_backend_type
- writes the ldap password to file ldapPass
* installObject.setup_opendj()
- add_ldap_schema