Skip to content

Instantly share code, notes, and snippets.

View sanfx's full-sized avatar
🎯
Focusing

Sanjeev Kumar sanfx

🎯
Focusing
  • Northampton
  • 17:51 (UTC)
View GitHub Profile
#!/usr/bin/env python
# Copyright (C) 2006 by Johannes Zellner, <[email protected]>
# modified by [email protected] to fit my output needs
# modified by [email protected] to fit my output needs
# Source: http://emerg3nc3.wordpress.com/2012/07/28/full-256-color-support-for-vim-andor-xterm-on-ubuntu-12-04/
import sys
import os
def echo(msg):
"""
Find maximum memory consumed by a process specified at the command-line.
Usage:
$ python memory-usage-wait3.py cmd arg1 arg2
"""
import os
import sys
import threading
@sanfx
sanfx / JSONPSensorServer.ino
Created December 28, 2016 14:40 — forked from sfentress/JSONPSensorServer.ino
Arduino Server for JSON-P pin values
/*
Web Server returning data as JSON-P, adapted from http://arduino.cc/en/Tutorial/WebServer
A simple web server that returns the value of the analog input pins as
a JSON-P object, using an Arduino Wiznet Ethernet shield.
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13 (standard configuration)
* Analog inputs attached to pins A0 through A5 (optional)
* Example of reading LM35 on pin A0:
@sanfx
sanfx / apache2.conf
Created February 2, 2017 17:16 — forked from deletosh/apache2.conf
default Apache2 conf file
#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure

ESP8266 Web Server to storing ap config to EEPROM.

Original by chriscook8 from esp8266.com I just modified to use ESP8266WebServer library for easy to handle the http request.

This is sample code not yet complete.

Todo

  • when Wifi connected need to close the softAP.
@sanfx
sanfx / backup_script.py
Created June 9, 2017 18:08 — forked from jvkersch/backup_script.py
Python wrapper around to rsync to facilitate backup
#!/usr/bin/env python
"""
A simple wrapper around rsync for backup.
Usage: create a text file with on each line a resource that you wish to
backup. Paths should be relative to the user's home directory. Entries
starting with '#' are ignored, as are blank lines. Call this script via
python backup_script.py -i [backup_files.txt] [rsync_target_folder]
@sanfx
sanfx / custom_ui_docked.py
Last active July 25, 2017 07:26 — forked from fredrikaverpil/custom_ui_docked.py
Create custom PySide GUI and dock it into Nuke UI
import PySide.QtCore as QtCore
import PySide.QtGui as QtGui
from nukescripts import panels
## https://docs.thefoundry.co.uk/nuke/70/pythonreference/nukescripts.panels-module.html
class PanelTest(QtGui.QWidget):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.setLayout(QtGui.QVBoxLayout())
@sanfx
sanfx / geonames.py
Created July 31, 2017 08:49 — forked from pamelafox/geonames.py
Geonames Python wrapper
import sys
import urllib
import urllib2
import json
import logging
class GeonamesError(Exception):
def __init__(self, status):
@sanfx
sanfx / Galaxy Of Tutorial Torrents
Created September 25, 2017 19:47 — forked from iHassan/Galaxy Of Tutorial Torrents
Ultimate Galaxy Of Tutorial Torrents
=============================
**http://kickass.to/infiniteskills-learning-jquery-mobile-working-files-t7967156.html
**http://kickass.to/lynda-bootstrap-3-advanced-web-development-2013-eng-t8167587.html
**http://kickass.to/lynda-css-advanced-typographic-techniques-t7928210.html
**http://kickass.to/lynda-html5-projects-interactive-charts-2013-eng-t8167670.html
**http://kickass.to/vtc-html5-css3-responsive-web-design-course-t7922533.html
*http://kickass.to/10gen-m101js-mongodb-for-node-js-developers-2013-eng-t8165205.html
*http://kickass.to/cbt-nuggets-amazon-web-services-aws-foundations-t7839734.html
@sanfx
sanfx / devpi-server-article.md
Created May 28, 2018 16:49 — forked from chronossc/devpi-server-article.md
Article/how to about how install devpy-server (not finished yet)

dev-pi install howto

This guide follow instructions in the devpi quickstart server guide. We will install in own user home using virtualenvs, than, will setup a nginx instance. Server used here is Ubuntu Server 12.04 LTS in one virtualbox instance.

Create devpi user

root ~ # useradd -m -U -s /bin/bash devpi
root ~ # passwd devpi