Skip to content

Instantly share code, notes, and snippets.

View airtonzanon's full-sized avatar

Airton Zanon airtonzanon

View GitHub Profile
@airtonzanon
airtonzanon / raspberry_pi_zero_w.md
Last active February 19, 2019 09:38 — forked from gbaman/HowToOTGFast.md
Simple guide for start using the Raspberry Pi Zero! With network connection

1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card with etcher. 2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. Create a new file simply called ssh in the SD card as well. By default SSH is now disabled so this is required to enable it. Remember - Make sure your file doesn't have an extension (like .txt etc)!
4. Finally, open up the cmdline.txt. Insert modules-load=dwc2,g_ether after rootwait.
5. That's it, eject the SD card from your computer, put it in your Raspberry Pi Zero and connect it via USB to your computer. It will take up to 90s to boot up (shorter on subsequent boots). It should then appear as a USB Ethernet device. You can SSH into it using raspberrypi.local as the address.
6. If it doesn't work, try to install [bonjour print

@airtonzanon
airtonzanon / palestranstes.md
Last active February 18, 2019 14:58
palestrantes PHP

Internacionais

  • Sara Goleman
  • Michelangelo VanDan
  • Rasmus Lerdorf
  • Marco Pivetta
  • Bruno Neves
  • Airton Zanon
  • Ricardo Tulio
  • Taylor Otwell
  • Ben Ramsey
@airtonzanon
airtonzanon / TestFizzBuzz.py
Created October 19, 2018 16:13
FizzBuzz implementation
import unittest
from fizzbuzz import FizzBuzz
class TestFizzBuzz(unittest.TestCase):
def test_display(self):
fizzBuzz = FizzBuzz()
self.assertEqual([1, 2, "fizz", 4, 'buzz', "fizz", 7, 8, "fizz", 'buzz', 11, "fizz", 13, 14, "fizzbuzz", 16, 17, "fizz", 19, 'buzz'], fizzBuzz.display())
@airtonzanon
airtonzanon / explanation.md
Created March 10, 2018 13:16
Windows 10 Docker error - Cannot start service

Error on start a docker container (docker run or docker-compose)

Cannot start service driver failed programming external connectivity on endpoint

Error starting userland proxy: mkdir /port/tcp:0.0.0.0:9000:tcp:172.18.0.3:9000: input/output error

  • TL;DR: Go to your docker settings -> daemon -> disable experimental features (This "solved" the problem on 10/03/2018)
ERROR: for docker_webserver_1  Cannot start service webserver: driver failed programming external connectivity on endpoint docker_webserver_1 (969e9ae035707ccbae4e29573d9c07ea32ab2858d48673f3fCreating docker_php-fpm_1   ... error
@airtonzanon
airtonzanon / keyboard-toggle.sh
Created May 13, 2017 14:40
Keyboard Disable and Enable Toggle
#!/bin/bash
status=$(xinput list --long "AT Translated Set 2 keyboard" | grep "disabled")
if [[ "$status" =~ "disabled" ]]
then
echo "Enabling keyboard"
xinput enable "AT Translated Set 2 keyboard"
exit;
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@airtonzanon
airtonzanon / v-exim-queue-12later
Last active October 26, 2016 16:02
E-mail log para verificar a fila do exim (emails que estão por mais de 12 horas nela)
#!/bin/bash
# info: Send email log to email
# options: NONE
#
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
@airtonzanon
airtonzanon / exim-commands.md
Last active October 25, 2016 11:48
Some Exim Commands

Some Exim Commands

  • exim -bp or mailq - List queue
  • exim -bpc - Count e-mails in queue
  • exim -qff - Force try to send queue, even freeze e-mails (if you use -qf, just try to send queue without freeze e-mails)
  • exiqgrep -i -z | xargs exim -Mrm - Remove all freeze e-mails from queue - if you use without -z, you can remove all e-mails from queue
  • exim -Mrm message-id - Remove a message from queue
  • exim -Mvh message-id - View a message's header
  • exim -Mvb message-id - View a message's body
  • exim -v -M message-id - Try to send again some message
<?php
class Pessoa {
private $nome;
private $sexo;
private $idade;
public function __construct($nome = null, $sexo = null, $idade = null){
$this->nome = $nome;
@airtonzanon
airtonzanon / developer-mode.md
Last active October 18, 2016 13:34
Enable Developer Mode Chromebook

#How enable Developer Mode Chromebook

Warning

  • When you enable developer mode all of your files, directorys and accounts will be deleted.
  • Google doesn't support your Chromebook in developer mode.

Enabling

  • Turn on your Chromebook.