Skip to content

Instantly share code, notes, and snippets.

View kashimAstro's full-sized avatar
🔒
busy

Dario Longobardi kashimAstro

🔒
busy
View GitHub Profile
@kashimAstro
kashimAstro / main.cpp
Last active June 27, 2019 18:33
HC_SR04 ofxgpio (untested)
#include "ofMain.h"
#include "ofAppNoWindow.h"
#include "ofxGPIO.h"
class HC_SR04{
public:
HC_SR04();
~HC_SR04();
long micros() {
int analog0 = A0;
int analog1 = A1;
void setup()
{
Serial.begin(9600);
}
void loop()
{
/work/kashim/android/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/memory:2157: error: undefined reference to 'ofxAndroidVideoGrabber::ofxAndroidVideoGrabber()'
/work/kashim/android/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc++/include/memory:2044: error: undefined reference to 'ofxAndroidVideoGrabber::~ofxAndroidVideoGrabber()'
/media/disk-backup/openframeworks/of_v0.10.0RC4_android_release/libs/openFrameworks/gl/ofFbo.cpp:299: error: undefined reference to 'ofxAndroidEvents()'
/media/disk-backup/openframeworks/of_v0.10.0RC4_android_release/libs/openFrameworks/gl/ofFbo.cpp:336: error: undefined reference to 'ofxAndroidEvents()'
/media/disk-backup/openframeworks/of_v0.10.0RC4_android_release/libs/openFrameworks/gl/ofFbo.cpp:451: error: undefined reference to 'ofxAndroidEvents()'
/media/disk-backup/openframeworks/of_v0.10.0RC4_android_release/libs/openFrameworks/gl/ofFbo.cpp:357: error: undefined reference to 'ofxAndroidEvents()'
/work/kashim/android/ndk/android-ndk-r15c/sources/cxx-stl/llvm-libc
@kashimAstro
kashimAstro / addon_config.mk
Last active April 17, 2018 13:57
addon_config.mk for android in ofxDlib
meta:
ADDON_NAME = ofxDlib
ADDON_DESCRIPTION = An openFrameworks wrapper for dlib.
ADDON_AUTHOR = Christopher Baker
ADDON_TAGS = "computer vision" "machine learning" "deep learning"
ADDON_URL = http://github.com/bakercp/ofxDlib
common:
ADDON_DEFINES =
@kashimAstro
kashimAstro / sig.cpp
Created March 20, 2018 10:19
sample sig
#include <signal.h>
#include <iostream>
#include <unistd.h>
// kill -9 pid
// kill -15 pid
// kill pid
// Ctrl+c
using namespace std;
@kashimAstro
kashimAstro / adaptive_histogram_equalization.cpp
Created February 15, 2018 18:32
Adaptive histogram equalization opencv
#include <opencv2/core.hpp>
#include <vector>
int main(int argc, char** argv)
{
cv::Mat bgr_image = cv::imread("image.png");
cv::Mat lab_image;
cv::cvtColor(bgr_image, lab_image, CV_BGR2Lab);
// Estrazione L channel
@kashimAstro
kashimAstro / https.conf
Created January 26, 2018 23:08
https apache
# mkdir /etc/apache2/ssl
# openssl req -x509 -nodes -days 1095 -newkey rsa:2048 -out /etc/apache2/ssl/server.crt -keyout /etc/apache2/ssl/server.key
# a2enmod ssl
# ln -s /etc/apache2/sites-available/default-ssl.conf /etc/apache2/sites-enabled/000-default-ssl.conf
# vi /etc/apache2/sites-enabled/000-default-ssl.conf
change:
## SSLCertificateFile /etc/apache2/ssl/server.crt
## SSLCertificateKeyFile /etc/apache2/ssl/server.key
# /etc/init.d/apache2 restart
@kashimAstro
kashimAstro / segment.cpp
Created January 2, 2018 19:55
ofxGPIO test 7 segment
#include <iostream>
#include "ofxGPIO.h"
#define CMD 0x80
#define ON 0x01
#define OFF 0
#define BRI 0xE0
#define ADD 0x70
I2c * i2c;
@kashimAstro
kashimAstro / ofxgpio-spi-speed.cpp
Created December 20, 2017 12:25
spi speed with ioctl ofxGPIO
#include "ofxGPIO.h"
/*
ofxGPIO
speed test SPI
*/
int main(int argc, char ** argv)
{
@kashimAstro
kashimAstro / force-sshpass.cpp
Last active March 3, 2021 13:28
c++ brute force ssh multithreading with sshpass
/*
Author: Dario Longobardi
Test ssh brute force multithreading
*/
#include <iostream>
#include <unistd.h>
#include <thread>
#include <vector>