Skip to content

Instantly share code, notes, and snippets.

View i-amolo's full-sized avatar

Innocent J. Blacius i-amolo

View GitHub Profile
@djangofan
djangofan / gist:2493145
Created April 25, 2012 20:36
Using etc alternatives to set default Java on CentOS
[user@www]# alternatives --install /usr/bin/java java /opt/jdk1.6.0_07/bin/java 2
[user@www]# alternatives --config java
There are 2 programs which provide 'java'.
Selection Command
-----------------------------------------------
*+ 1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
2 /opt/jdk1.6.0_07/bin/java
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@Calzzetta
Calzzetta / pool_cx_oracle.py
Created January 30, 2015 19:50
Connection pool with cx_Oracle
import cx_Oracle
def perform_query(query, bind_variables):
connection = db_pool.acquire()
cursor = connection.cursor()
cursor.execute(query, bind_variables)
result = cursor.fetchall()
cursor.close()
db_pool.release(connection)
return result
@akalongman
akalongman / php-soap.php
Created April 1, 2015 08:44
PHP soap client example
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);
$params = array('param1'=>$param1);
$wsdl = 'http://service_url/method?WSDL';
@bigsnarfdude
bigsnarfdude / gist:b6ae4dbd1b9b60d40cba
Created January 7, 2016 17:23
incident report template
Example infrastructure outage incident report
Friday, May 13, 2077
By the Example Security Team
Earlier this week we experienced an outage in our API infrastructure. Today we’re providing an incident report that details the nature of the outage and our response.
The following is the incident report for the Example Security outage that occurred on April 30, 2077. We understand this service issue has impacted our valued developers and users, and we apologize to everyone who was affected.
@nguyenkims
nguyenkims / generate_365_days.sql
Created April 4, 2016 10:24
Fill up table "dates" with all the days from 1/1/2016 till 12/31/2016
DROP PROCEDURE IF EXISTS fillupdate;
DELIMITER //
CREATE PROCEDURE fillupdate()
BEGIN
DECLARE nbdate INT DEFAULT 0;
DECLARE dt DATETIME DEFAULT 0;
SET dt = '2016-01-01';
@akkidas
akkidas / guid-sql-server.sql
Created April 13, 2016 17:59
Generate New Guid (uniqueidentifier) in SQL Server
-- If you want to generate a new Guid (uniqueidentifier) in SQL server the you can simply use the NEWID() function.
SELECT NEWID()
GO
-- This will return a new random uniqueidentifier e.g.
E75B92A3-3299-4407-A913-C5CA196B3CAB
To select this Guid in in a variable
--assign uniqueidentifier in a variable
DECLARE @EmployeeID uniqueidentifier
@zhangpengGenedock
zhangpengGenedock / git clone specific commit branch
Created October 19, 2017 03:52
git clone specific commit branch
What else can you do?
How to clone repository to a specific commit? (full clone)
# Create empty repository to store your content
git clone <url>
git reset <sha-1> --hard
More info:
How to clone single branch?
@Ryanb58
Ryanb58 / install.md
Last active October 4, 2024 11:11
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@tmkasun
tmkasun / config.md
Last active May 1, 2023 10:32
How to configure nginx as a revers proxy for WSO2 API Manager SPA apps

For APIM 3.0.0

Update deployment.toml

[transport.https.properties]
proxyPort = 443

[server]
hostname = "knnect.lk"