Skip to content

Instantly share code, notes, and snippets.

View boseji's full-sized avatar
💭
Accelerating dreams into infinity.

Abhijit Bose boseji

💭
Accelerating dreams into infinity.
View GitHub Profile
@boseji
boseji / runner.py
Created February 24, 2014 04:54
Runner function for executing Python scripts from inside a Python script
import os,sys,importlib
from os import path
def Runner(sRootPath):
''' Runs all the scripts in lower directories
@param sRootPath Specifies the Path from which Script Running should start
@return None
'''
try:
for root, dirs, files in os.walk(sRootPath):
#bypass dir with _ and __ , Process only if some files
@boseji
boseji / runscript.py
Created February 24, 2014 05:00
Run Script to actually execute a Python script from inside a Python File
import os,sys,importlib
from os import path
def RunScript(sPath,sFile,bDirect=2):
''' Run a Python Script via differenct Methods
@param sPath Sting containing Only the
Absolute Path of the File to Execute
@param sFile String containing Only the File Name to Execute
@param bDirect Flag indicates how to run the Script
0 = Run using Exec Technique
1 = Run directly in Shell
@boseji
boseji / main.py
Created February 24, 2014 05:17
Execution Program for the Runner Scripts to execute python scripts by parsing directories through a single python file.
#!/usr/bin/python
###########################################################################
### @file main.py
### Execution Engine for the Site Generator
### @Author Abhijit Bose <info@adharlabs.in>
### @License
### Copyright 2014 Abhijit Bose <info@adharlabs.in>
### Licensed under the Apache License, Version 2.0 (the "License");
### you may not use this file except in compliance with the License.
### You may obtain a copy of the License at
@boseji
boseji / test.py
Created February 24, 2014 08:40
Example for the Runner Script that can be run individually or via Import or Compile techniques
import os,sys
from os import path
#the config file lites in the top py directory
try:
from config import *
except:
#fix for Direct Running
sys.path.insert(0, \
path.abspath(path.join(os.getcwd(),"..")))
@boseji
boseji / Log1
Created July 12, 2014 16:26
Uboot Logs - Riot Board
U-Boot 2009.08-00695-g055df3a (Dec 25 2013 - 09:56:12)
CPU: Freescale i.MX6 family TO1.1 at 792 MHz
Thermal sensor with ratio = 188
Temperature: 42 C, calibration data 0x5a45225f
mx6q pll1: 792MHz
mx6q pll2: 528MHz
mx6q pll3: 480MHz
@boseji
boseji / interfaces
Last active August 29, 2015 14:05
Raspberry Pi Wifi Configuration
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
# adb protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e12", MODE="0600", OWNER="<username>"
# fastboot protocol on passion (Nexus One)
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0fff", MODE="0600", OWNER="<username>"
# adb protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e22", MODE="0600", OWNER="<username>"
# fastboot protocol on crespo/crespo4g (Nexus S)
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e20", MODE="0600", OWNER="<username>"
# adb protocol on stingray/wingray (Xoom)
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}=="70a9", MODE="0600", OWNER="<username>"
@boseji
boseji / update.sh
Created November 2, 2014 03:54
Raspberry Pi Update
#!/bin/sh
sudo apt-get update
sudo apt-get upgrade -y
sudo rpi-update
sudo reboot
@boseji
boseji / py-commandline-executable-program.py
Last active August 29, 2015 14:13
Python command line executable Example
# This is the example program to be used
# Rename the file to `program.py'
print("Aum")
@boseji
boseji / register.py
Last active August 29, 2015 14:13
Windows Python Path Registration Script
#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
#
# written by Joakim Low for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# Websource: