Skip to content

Instantly share code, notes, and snippets.

View igor822's full-sized avatar

Igor Carvalho igor822

View GitHub Profile
@igor822
igor822 / tutorial.md
Created September 19, 2018 02:51
OpenFaaS tutorial

Create Functions

Start docker swarm

$ docker swarm init --advertise-addr lo # {network}

FaaS

@igor822
igor822 / documentation.md
Created April 22, 2018 16:36
Simple documentation template

Project / Module Name

What (vision or end result)

Eg.: This system will....

Why (motivation or logic)

// Why the system is used for

@igor822
igor822 / customer-import.php
Created October 23, 2017 01:35
Import Magento Customer
<?php
require __DIR__. '/../app/Mage.php';
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);
$count = 0;
$file = fopen('customers.csv', 'r');
$indices;
import sys
num = input()
num = int(num)
n = 0
for i in range(1000):
sys.stdout.write("N[%d] = %d\n" % (i, n))
n += 1
if n >= num:
n = 0
@igor822
igor822 / .vimrc
Last active February 28, 2019 23:54
Meu vim
set shell=bash\ --login
set shellcmdflag=-c
set encoding=utf-8
set t_Co=256
set t_ut=
set tabstop=4
set shiftwidth=4
set softtabstop=4
set expandtab
set lazyredraw
@igor822
igor822 / tmux.conf
Last active April 23, 2018 18:27
Tmux
source /usr/share/tmux/powerline.conf
set-option -g default-terminal "screen-256color"
set-window-option -g automatic-rename off
set-option -g allow-rename off
# main command
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
@igor822
igor822 / command.sh
Created April 10, 2016 20:12
Enter USB directory from Live USB
# http://unix.stackexchange.com/a/204613
sudo mount -o remount,rw /lib/live/mount/medium
@igor822
igor822 / boot-usb.sh
Created April 9, 2016 12:33
Boot USB using Qemu
# lsusb to get bus and id
# https://weluse.de/blog/test-your-bootable-usb-drive-with-qemu.html
sudo qemu-system-x86_64 -m 512 -enable-kvm -usb -device usb-host,hostbus=1,hostaddr=8
@igor822
igor822 / learn-oop.md
Created September 13, 2015 16:22
Learn OOP with PHP
@igor822
igor822 / configurator_mac.sh
Created June 18, 2015 11:43
Symfony environment configurator
#!/bin/sh
path_project="$1"
DISTRO="unknown"
if [[ -z $path_project ]]; then
echo "Please add the path of project"
exit 1
fi