Skip to content

Instantly share code, notes, and snippets.

View Morabaraba's full-sized avatar
🐍
Snake! Snake! Oooh it is a snake!

Morabaraba Morabaraba

🐍
Snake! Snake! Oooh it is a snake!
  • Digital Nomad
View GitHub Profile
@Morabaraba
Morabaraba / hello.py
Created September 25, 2018 15:19
modified `hello.py` [connexion](https://github.com/zalando/connexion/) example to include `Accept` header validation decorator.
#!/usr/bin/env python3
import connexion
import flask
from decorator import decorator
@decorator
def requires_header(f: callable, *args, **kwargs):
accept = flask.request.headers.get('Accept')
print(accept)
if not accept or accept != 'application/xml':
@Morabaraba
Morabaraba / c9.v2.ace.build.issue.md
Created May 10, 2017 19:18
GET http://localhost:3131/static/ace/build/ace.js 404 (Not Found) Cloud9 v2

Did a npm install and npm update and got the following WARN.

npm WARN cannot run in wd cloud9@2.1.5 cd node_modules/ace; make clean pre_build; ./Makefile.dryice.js minimal; cd ../.. (wd=/opt/cloud9)

When I started the server cloud9 reported:

GET http://localhost:3131/static/ace/build/ace.js 404 (Not Found) Cloud9 v2
@Morabaraba
Morabaraba / cloud9.issues.21.md
Created May 10, 2017 13:12
cloud9 v2 gpl ctrl+v cmd+v copy paste issue: https://github.com/exsilium/cloud9/issues/21

For pylonide/pylon#21

Tested on Win 10, thanks. Will test on a mac soon.

First tried a npm update on the project to get your ctrl+v change. Realised I need to git clone https://github.com/exsilium/term.js.git instead.

It to crude?

ubuntu@ubuntu-xenial:~/bin/cloud9/node_modules/term.js$ npm update
@Morabaraba
Morabaraba / qici-projects.md
Last active March 10, 2017 09:30
List of QICI Projects with source

Firstly I want to thank the QICI team for their extensive list of demos. If you want to know how to do something you will most probably find a example there.

This list is more of projects I found scattered on github, self promotion, etc. If you want something added please let me know!

note atm most projects is just prototypes, toys or just someone checking the env and sharing their knowledge.

@Morabaraba
Morabaraba / git-tricks.md
Created February 25, 2017 18:35
GIT tricks

change name and surname in all previous commits?

git filter-branch --commit-filter 'if [ "$GIT_AUTHOR_NAME" = "Your Name" ];
  then export GIT_AUTHOR_NAME="Morabaraba May"; export GIT_AUTHOR_EMAIL=TOPS3CR3T;
  fi; git commit-tree "$@"'

http://stackoverflow.com/a/4494037

// hacked from the code at https://github.com/qiciengine/qiciengine-server
var port = 8900;
var bodyParser = require('body-parser')
var express = require('express');
var app = express();
var http = require('http').Server(app);
// 监听端口重复事件以进行重试
http.on('error', function(e) {
console.error('端口监听失败:%s', e.code);
@Morabaraba
Morabaraba / ClockingIT-Ubuntu-10.04.md
Created January 9, 2017 20:52
How to install ClockingIT on Ubuntu 10.04
@Morabaraba
Morabaraba / README.md
Created November 30, 2016 08:17
Oracle PDO OCI PHP Driver on CentOS 6

Oracle PDO OCI PHP Driver on CentOS 6

rpm -ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
cp pdo_oci.so /usr/lib64/php/modules/pdo_oci.so
cp oracle.conf /etc/ld.so.conf.d/oracle.conf
/etc/init.d/httpd reload
@Morabaraba
Morabaraba / erlang+epgsql.md
Created August 27, 2016 22:28
Basic erlang.mk and epgsql

PostgreSQL + Erlang

erlang.mk

Create a Makefile, see the erlang.mk getting started guide.

PROJECT = example1
DEPS = epgsql
include erlang.mk
@Morabaraba
Morabaraba / pi-zabbix-readme.md
Last active August 8, 2016 13:02
Raspbian Zabbix 3.0.4

Zabbix 3.0.4 [PostgreSQL] on a Rasberry Pi from Source

Install dependancies:

apt-get install make gcc libc6-dev libcurl4-openssl-dev libssh2-1-dev \
libsnmp-dev libiksemel-dev libsqlite3-dev libopenipmi-dev fping php5-gd \
snmp libsnmp-base openjdk-7-jdk unixodbc unixodbc-dev libxml2 libxml2-dev \
snmp-mibs-downloader snmpd snmptt python-pywbem php5-ldap php5-pgsql traceroute \
libldap2-dev apache2 php5 libapache2-mod-php5 libpq-dev