Skip to content

Instantly share code, notes, and snippets.

View douglasresende's full-sized avatar
💡
I'll do my best

Douglas douglasresende

💡
I'll do my best
  • San Francisco, CA
View GitHub Profile
@douglasresende
douglasresende / rede.php
Created September 11, 2012 02:31
rede.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Testando Servidores</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="author" content="Douglas Resende Camargo">
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet">
</head>
<body>
@douglasresende
douglasresende / wifi.sh
Last active August 29, 2015 13:57
Auto Connect Wifi Mac OS
#!/bin/bash
# http://magp.ie/2012/07/09/mac-osx-shell-script-to-automate-connecting-to-wifi-network/
AIRPORT="en1"; #may be en0, use networksetup -listallhardwareports to check
WIFI_NETWORK_NAME="nomedarede"
WIFI_PASSWORD="senhadarede"
SCRIPT_PATH="$(pwd)/wifi.sh"
if networksetup -getairportnetwork $AIRPORT | grep -i -a $WIFI_NETWORK_NAME ;
then
PROMPT_COMMAND='echo -ne "\033]0;"WIFI: OK"\007"'
<?php
// identificação do servidor, usuário e senha.
$ldap_server = "ldap://nome ou ip do domain controler";
$auth_user = "domínio\usuário";
$auth_pass = "senha";
// identificação da base que será acessada.
$base_dn = "Ou=principal, dc=dominio, dc=com, dc=br";
// conexão com o servidor.
# This file should be placed on the directory of ~/blog/config
upstream unicorn {
server unix:/tmp/unicorn.todo.socket fail_timeout=0;
}
server {
listen 80 default;
#server_name example.com;
root /home/username/blog/public;
@douglasresende
douglasresende / nginx.conf
Created September 27, 2015 19:46 — forked from oroce/nginx.conf
nginx config for using grafana, elasticsearch and graphite with authentication.
user www-data;
worker_processes 1;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
sendfile on;
@douglasresende
douglasresende / digital_ocean_setup.md
Created March 9, 2016 21:49 — forked from ChuckJHardy/digital_ocean_setup.md
DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3 Setup Instructions

DigitalOcean Ubuntu 14.04 x64 + Rails 4 + Nginx + Unicorn + PostgreSQL + Capistrano 3

SSH into Root

$ ssh root@123.123.123.123

Change Root Password

@douglasresende
douglasresende / platformio.txt
Created September 6, 2016 02:52 — forked from probonopd/platformio.txt
Using PlatformIO
sudo apt-get -y install python-pip git
sudo pip install -U platformio
platformio -f init --ide clion --board esp12e
sudo chmod 777 /dev/tty*
platformio serialports list
cp ~/.platformio/packages/framework-arduinoespressif/libraries/ArduinoOTA/examples/BasicOTA/BasicOTA.ino src/
# Set upload speed from 115200 to 921600
echo "upload_speed=921600" >> platformio.ini
@douglasresende
douglasresende / melvanimate.md
Created September 6, 2016 02:54 — forked from probonopd/melvanimate.md
Getting Melvanimate to fly :-)

Getting Melvanimate to fly :-)

What is Melvanimate?

Melvanimate is a library for ESP8266 that lets you control your Neopixels over WLAN easily. It supports everything imaginable besides toasting your toast, e.g.,:

  • Animate Neopixels (hence the name!) or set them to solid colors
  • Control LEDs via a web interface (for casually setting a certain color of effect)
  • Control LEDs via MQTT or DMX/E131 (for automation)
  • Adalight DIY ambient monitor lighting similar to Ambilight
@douglasresende
douglasresende / neopixel_ota.ino
Created September 6, 2016 02:55 — forked from probonopd/neopixel_ota.ino
Trying to combine ArduinoOTA with Adafruit_NeoPixel
//#######################################################
//# Trying to combine ArduinoOTA with JoDaNl/esp8266_ws2812_i2s # [ERROR]: No Answer
//#######################################################
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
@douglasresende
douglasresende / Native_FullScreen.js
Created October 17, 2016 01:20 — forked from jiahut/Native_FullScreen.js
Native FullScreen JavaScript API
/*
Native FullScreen JavaScript API
CopyRight: Johndyer, http://johndyer.name/native-fullscreen-javascript-api-plus-jquery-plugin/
-------------
Assumes Mozilla naming conventions instead of W3C for now
*/
(function() {
var
fullScreenApi = {
supportsFullScreen: false,