Skip to content

Instantly share code, notes, and snippets.

View macmata's full-sized avatar

Alexandre Leblanc macmata

  • Montreal
  • 14:13 (UTC -04:00)
View GitHub Profile
FROM debian:wheezy
# Base system
RUN apt-get update && apt-get install git
RUN echo "deb http://deb.debian.org/debian jessie main" >> /etc/apt/sources.list
RUN apt-get update && apt-get install -y -t jessie gcc
WORKDIR /work
ENV PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabi/pkgconfig
@macmata
macmata / gist:25b5f1c65b776087e7dba35ee42efc55
Created November 30, 2017 20:10
fix python decorator missing
sudo python3.6 -m pip install decorator --upgrade
@macmata
macmata / firewall.sh
Created November 28, 2017 17:07
firewalld
firewall-cmd --zone=dmz --add-port=8080/tcp
vconfig add eth0 5
ifconfig eth0.5
ifconfig eth0.5 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255 up
@macmata
macmata / bash
Created November 7, 2017 00:27
openvpn selinux
sudo yum reinstall selinux-policy-targeted
setsebool -P openvpn_enable_homedirs 1
semanage fcontext -a -t home_cert_t .cert
restorecon -R -v .cert ->>> doit etre ".cert"!!
user www-data;
worker_processes 2;
error_log logs/error.log debug;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
class Article < ActiveRecord::Base
validates :title, presence: true,
length: { minimum: 5 }
end
@macmata
macmata / gist:415cdc46fd25ba3ba0f5
Created January 12, 2016 02:50
Turn Off the built in apache on OSx
Turn Off the built in apache on OSx
Apr 1, 2013, 1 minute read, 191 words
Slack - a messaging app for teams, integrating with the tools you already use.ads via Carbon
There are a handful of reasons why you would want to turn off the built in apache on OSx, you might have installed your own version, maybe you don't use apache and it is interfering with something else, whatever the reason there is one command you need to run to turn it off.
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apa
@macmata
macmata / gist:a4bbe4cefb0efd844483
Created December 14, 2015 03:53
Waveshare-Raspberry-Resistive-Interface-Rapsberry-pi
http://www.wvshare.com/product/3.2inch-RPi-LCD-B.htm
http://www.amazon.com/Waveshare-Raspberry-Resistive-Interface-Rapsberry-pi/dp/B00N0SNVQE
I have found that the initialization string is very close to fb_ili9340 driver, so after few days of testing I found this configuration is pretty stable
1) Use FBTFT drivers built into the kernel
sudo REPO_URI=https://github.com/notro/rpi-firmware BRANCH=builtin rpi-update
sudo reboot
2) After rebooting, check that SPI was created
#include <iostream>
#include "server.h"
static void ev_handler(struct mg_connection *nc, int ev, void *ev_data) {
switch (ev) {
case MG_EV_RECV:
// do something
mg_printf(nc, "alsothis_1");
break;
case MG_EV_HTTP_REQUEST: