Skip to content

Instantly share code, notes, and snippets.

View artistio's full-sized avatar

Benny Chandra artistio

View GitHub Profile
@artistio
artistio / blinky.ino
Last active September 5, 2015 11:03 — forked from ericevenchick/blinky.ino
Blinking LED sketch for Arduino
/*
* copyleft 2005 DojoDave <http://www.0j0.org>
* http://arduino.berlios.de
*
* based on an orginal by H. Barragan for the Wiring i/o board
*/
int ledPin = 13; // LED connected to digital pin 13
void setup()
@artistio
artistio / Vagrant.chef.rb
Last active September 29, 2015 03:06 — forked from hgilani/Vagrant.chef.rb
Vagrant VM running with latest version of chef and ruby
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty32"
config.omnibus.chef_version = :latest
@artistio
artistio / nginx.conf
Created July 14, 2016 13:46
The nginx.conf file used in my NGINX for Wordpress Multisite with Domain Mapping
user www-data;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
@artistio
artistio / wp-ms
Created July 14, 2016 13:51
NGINX site specification to run Wordpress Multisite with Domain Mapping. This site use fastcgi cache to speed up PHP execution Support HTTPS is also available. To use, put this file in /etc/nginx/site-available, and symlink to /etc/nginx/site-enabled
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=WP:32m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
add_header X-Cache $upstream_cache_status;
server {
listen [::]:80 ipv6only=off;
listen [::]:443 ipv6only=off ssl;
# Change the line below according to domain served by this Wordpress. Include all domain
server_name example.com *.example.com example.org *.example.org;
@artistio
artistio / fpm-pool.conf
Created July 14, 2016 13:56
Configuation file of php-fpm, used by fastcgi (NGINX or Wordpress)
; Start a new pool named 'fpm-pool'.
; the variable $pool can we used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'slowlog'
; - 'listen' (unixsocket)
; - 'chroot'
@artistio
artistio / my.cnf
Created July 14, 2016 13:58
MySQL configuration file for low memory server. This config disable InnoDB so MySQL use less memory. Might not work for MySQL 5.7, where InnoDB can't be disabled
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@artistio
artistio / NodeMCU_DHT22.ino
Last active December 9, 2018 08:42
Contoh program untuk membaca data sensor DHT22 dengan NodeMCU.
/**
* Program untuk membaca suhu dan kelembaban dari sensor DHT22
* menggunakan NodeMCU
*
* Hak cipta (c) 2016 x.benny.id. All rights reserved.
* https://x.benny.id
*/
// Konfigurasi DHT22
#include <DHT.h>
@artistio
artistio / startWiFi.ino
Created December 9, 2018 09:22
Fungsi wrapper untuk memulai koneksi WiFi di NodeMCU
/**
* File startWiFi.ino
*
* int startWiFi(char* ssid, char* pass)
*
* Fungsi: Memulai koneksi ke WiFi sesuai dengan ssid dan pass
*
* Return Value:
* - 0: Koneksi sukses. Hasil koneksi akan terbaca di Serial Monitor
* - 1: Koneksi gagal. Hasil koneksi akan terbaca di Serial Monitor
/**
* Program untuk membaca suhu dan kelembaban dari sensor DHT22
* menggunakan NodeMCU
*
* Hak cipta (c) 2016 x.benny.id. All rights reserved.
* https://x.benny.id
*/
// Konfigurasi DHT22
#include <DHT.h>
@artistio
artistio / NodeMCU_DHT22_WiFi_TS.ino
Created December 9, 2018 10:54
Membaca suhu dan kelembaban dengan sensor DHT22, lalu mengirimkan ke ThingSpeak
/**
* Program untuk membaca suhu dan kelembaban dari sensor DHT22
* menggunakan NodeMCU
*
* Hak cipta (c) 2016 x.benny.id. All rights reserved.
* https://x.benny.id
*/
// Konfigurasi DHT22
#include <DHT.h>