Skip to content

Instantly share code, notes, and snippets.

View elyezer's full-sized avatar

Elyézer Rezende elyezer

View GitHub Profile
@elyezer
elyezer / compile.sh
Created October 22, 2013 11:56
Create and use a shared library using Python's ctypes module
# Compile a shared library
gcc -shared -o libmean.so.1 mean.c
@elyezer
elyezer / ring_buffer.sql
Last active May 16, 2024 03:38
How to create a ring buffer table in SQLite
-- Example table
CREATE TABLE ring_buffer (id INTEGER PRIMARY KEY AUTOINCREMENT, data TEXT);
-- Number 10 on where statement defines the ring buffer's size
CREATE TRIGGER delete_tail AFTER INSERT ON ring_buffer
BEGIN
DELETE FROM ring_buffer WHERE id%10=NEW.id%10 AND id!=NEW.id;
END;
@elyezer
elyezer / gist:1505833
Created December 21, 2011 12:20
Find a contact name from phone number in Android
Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
String[] projection = {PhoneLookup.DISPLAY_NAME};
Cursor c = contentResolver.query(uri, projection, null, null, null);
if (c.moveToFirst()) {
name = c.getString(c.getColumnIndex(PhoneLookup.DISPLAY_NAME));
}
@elyezer
elyezer / gist:6594539
Created September 17, 2013 13:48
How to install OpenVPN on BeagleBone Black
# Change the version 2.3.2 as needed
wget http://swupdate.openvpn.org/community/releases/openvpn-2.3.2.tar.gz
tar zxf openvpn-2.3.2.tar.gz
cd openvpn-2.3.2
./configure
make
make install

Keybase proof

I hereby claim:

  • I am elyezer on github.
  • I am elyezer (https://keybase.io/elyezer) on keybase.
  • I have a public key ASAXJ1HBwswA7eejf4hwjdLnSjnoZjpjgOM9q53o_2lhngo

To claim this, I am signing this object:

#!/usr/bin/env bash
#
# For each file found by `find`, generate a entry on the toctree in
# `docs/api.rst`.
#
# NOTE: This script should be run from the repository docs directory. That is,
# this script should be run from this script's ../docs directory.
set -euo pipefail
@elyezer
elyezer / running_different_drivers.md
Last active February 16, 2018 18:43
widgestastic + pytest-selenium POC
.\" Man page generated from reStructuredText.
.
.TH "BETELGEUSE" "1" "Sep 14, 2017" "0.12.0" "Betelgeuse"
.SH NAME
betelgeuse \- Betelgeuse Documentation
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
diff --git a/rho/scancommand.py b/rho/scancommand.py
index f222c92..7fe446e 100644
--- a/rho/scancommand.py
+++ b/rho/scancommand.py
@@ -491,13 +491,23 @@ class ScanCommand(CliCommand):
ansible_vars = {'facts_to_collect': self.facts_to_collect,
'report_path': report_path}
- playbook = utilities.PLAYBOOK_DEV_PATH
- if not os.path.isfile(playbook):
help:
@echo "Please use \`make <target>' where <target> is one of:"
@echo " help to show this message"
@echo " all to to execute test-coverage and lint"
@echo " docs-clean to remove documentation"
@echo " docs-html to generate HTML documentation"
@echo " install to install in editable mode"
@echo " install-dev to install in editable modeplus the dev packages"
@echo " lint to run flake8"
@echo " package to generate installable Python packages"