Skip to content

Instantly share code, notes, and snippets.

View tejastank's full-sized avatar

Tejas Tank tejastank

View GitHub Profile
@zed
zed / ping.py
Created December 12, 2009 19:04
#!/usr/bin/env python
"""
A pure python ping implementation using raw socket.
Note that ICMP messages can only be sent from processes running as root.
Derived from ping.c distributed in Linux's netkit. That code is
@dahnielson
dahnielson / UUID.php
Last active May 31, 2024 23:54
Pure PHP UUID generator
<?php
/**
* UUID class
*
* The following class generates VALID RFC 4122 COMPLIANT
* Universally Unique IDentifiers (UUID) version 3, 4 and 5.
*
* UUIDs generated validates using OSSP UUID Tool, and output
* for named-based UUIDs are exactly the same. This is a pure
* PHP implementation.
@skydiablo
skydiablo / gist:1122473
Created August 3, 2011 12:04
PHP SSH2 Wrapper
<?php
class ssh2 {
const SSH_COMMAND_FINISHED_FLAG = '___SSH_COMMAND_FINISHED___';
private $host = 'localhost';
private $port = 22;
private $username = 'root';
private $password = '';
private $connectionMethods = array(
@pazdera
pazdera / object_pool.py
Created August 4, 2011 09:33
Example of `object pool' design pattern in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `object pool' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
<?php
require __DIR__.'/includes/BarcodeBase.php';
require __DIR__.'/includes/QRCode.php';
require __DIR__.'/includes/DataMatrix.php';
require __DIR__.'/includes/PDF417.php';
require __DIR__.'/includes/Code39.php';
require __DIR__.'/includes/Code128.php';
$bcode = array();
@studioijeoma
studioijeoma / WebGL_Canvas_Texture_Text_Example.html
Created September 1, 2011 18:47
Three.js WebGL Canvas Texture Text Example
<!doctype html>
<html>
<head>
<title>Three.js : WebGL Canvas Texture Text Example</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}
body {
@wrunk
wrunk / jinja2_file_less.py
Last active September 19, 2023 15:05
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
@tedhagos
tedhagos / install-steps-gnu-health
Created January 2, 2012 03:07
Installation notes for GNU Health
1. Make sure you have the following requisites
- Debian or Ubuntu
- Postgresql
- Python
- Tryton
2. Install requisite software
2.1 apt-get install python-pip python-lxml python-relatorio python-psycopg2 posgresql python-tz
@alotaiba
alotaiba / google_speech2text.md
Created February 3, 2012 13:20
Google Speech To Text API

Google Speech To Text API

Base URL: https://www.google.com/speech-api/v1/recognize
It accepts POST requests with voice file encoded in FLAC format, and query parameters for control.

Query Parameters

client
The client's name you're connecting from. For spoofing purposes, let's use chromium

lang
Speech language, for example, ar-QA for Qatari Arabic, or en-US for U.S. English

@frne
frne / auth_response.xml
Created February 16, 2012 13:19
ejabberd, BOSH und Strophe.js
<body xmlns="http://jabber.org/protocol/httpbind"
sid="e0408bf8d86f0a7f44afda59aa8f81b75d029bb6"
wait="60"
requests="2"
inactivity="30"
maxpause="120"
polling="2"
ver="1.6"
from="ymc-pg-ejabberd"
secure="true"