Skip to content

Instantly share code, notes, and snippets.

Install Openshift OC Tool in Ubuntu 16.04

What is OC Tool?

OC tool stands for OpenShift Origin Client Tools

Environment

  • Operating System : Ubuntu 16.04 LTS (64-bit)
@BrajeshKhare
BrajeshKhare / hubspot_config.php
Created October 14, 2016 05:17 — forked from adrianmott/hubspot_config.php
HubSpot to SugarCRM Integration Code Sample
<?php
$hubspot_config = array (
'hsportalid' => '######',
'hapikey' => 'XXXXXX',
'hapiuser' => 'XXXXXX',
'hapipassword' => 'XXXXXX',
'sugarinstallpath' => 'http://somesite.com/sugarcrm/',
'hapilogfile' => './sycnlog.txt');
?>
@BrajeshKhare
BrajeshKhare / gf-hubspot-sugar.php
Created October 14, 2016 05:16
Gravity Forms integration for Hubspot and SugarCRM
<?php
/**
* Includes extensions for Gravity Forms to SugarCRM and Hubspot
* The demo code with all fields is located at the bottom of the file
* for future reference so we don't have to hunt it down later
*
* Don't forget to read the link on how to finish off the SugarCRM
* integration. I'll blog about it eventually so it's all in one
* spot.
*
@BrajeshKhare
BrajeshKhare / supervisor.conf
Created June 13, 2016 07:08 — forked from tsabat/supervisor.conf
Sample supervisor config file
; Sample supervisor config file.
[unix_http_server]
file=/tmp/supervisor.sock ; (the path to the socket file)
;chmod=0700 ; sockef file mode (default 0700)
;chown=nobody:nogroup ; socket file uid:gid owner
;username=user ; (default is no username (open server))
;password=123 ; (default is no password (open server))
;[inet_http_server] ; inet (TCP) server disabled by default
@BrajeshKhare
BrajeshKhare / graceful_shutdown_tornado_web_server.py
Created June 10, 2016 09:39 — forked from mywaiting/graceful_shutdown_tornado_web_server.py
The example to how to shutdown tornado web server gracefully...
#!/usr/bin/env python
"""
How to use it:
1. Just `kill -2 PROCESS_ID` or `kill -15 PROCESS_ID` , The Tornado Web Server Will shutdown after process all the request.
2. When you run it behind Nginx, it can graceful reboot your production server.
3. Nice Print in http://weibo.com/1682780325/zgkb7g8k7
"""
@BrajeshKhare
BrajeshKhare / odoo_connector.py
Created June 2, 2016 13:47 — forked from dpr-odoo/odoo_connector.py
Odoo Python Connector (JSON RPC)
import httplib2,random, json
odoo_url = 'SERVER_URL'
class OdooConnector:
context = {}
http = False
cookies = ''
def __init__(self):
@BrajeshKhare
BrajeshKhare / animated_brain.py
Created May 24, 2016 06:08 — forked from Zulko/animated_brain.py
Animated brain (Vispy) turned into a video/GIF (MoviePy)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 2
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
#
# Modified for animation with MoviePy by Zulko
# See result here: http://i.imgur.com/sSCBkFd.gif
#
class MP3UploadHandler(tornado.web.RequestHandler):
def get(self):
self.render('mp3upload.html')
def post(self):
mp3=self.request.files['mp3'][0] #mp3 post data from form
mp3body=mp3['body'] #body of mp3 file
mp3name = mp3['filename'] #mp3 name and path
conn = S3Connection('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY') #amazon s3 connection
bucket = conn.create_bucket('foundsound_mp3') #bucket for images
{% extends "main.html" %}
{% autoescape None %}
{% block body %}
{% for news_item in news%}
<p>
<b>{{str(news_item['datetime_added'])}}</b>
</p>
<p>
{{ news_item.get('text', '') }}
</p>
from bs4 import BeautifulSoup
import requests
r = requests.get("http://www.metmuseum.org/collection/the-collection-online/search/36484")
bs = BeautifulSoup(r.content)
imgs = bs.findAll('img', src=True)
for img in imgs:
print img['src']