Skip to content

Instantly share code, notes, and snippets.

@fn-alves
fn-alves / csv_import.py
Last active April 17, 2019 13:04
Importa usuários contidos no csv em massa para o samba 4 AD. headers do csv: nome,sobrenome,email,senha,departamento,empresa
#!/usr/bin/env python
import csv, sys,os
try:
file = open(sys.argv[1], "rt")
reader = csv.DictReader(file)
# Function que adiciona os usuairos no samba e define para mudar a senha no proximo login
def add_user(username,senha,email,sobrenome,nome,descr,departamento,empresa,user_ou):
os.system("/usr/bin/samba-tool user add %s \
# Custom Configurations for atom powered by sync-settings
@fn-alves
fn-alves / alias_git.txt
Created October 2, 2017 20:29
Custom alias of bash windows/unix for gitz
#__Alias do git__#
git config --global alias.co checkout
git config --global alias.lg 'log --all --graph --decorate --oneline --abbrev-commit'
git config --global alias.hist 'log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit'
git config --global alias.cm commit
git config --global alias.ac '!git add -A && git commit'
git config --global alias.st 'status -sb'
git config --global alias.tags 'tag -l'
git config --global alias.branches 'branch -a'
git config --global alias.remotes 'remote -v'
@fn-alves
fn-alves / bootstrap.sh
Last active October 9, 2017 17:05
Computer bootstrap
#!/bin/bash
##############################################################################
# Install system packages #
##############################################################################
# if apt-get exists, probably it's a Linux
if which apt-get > /dev/null; then
# update & clean up
###############################################################################
# Source .profile #
###############################################################################
source ~/.profile
source ~/.colors
###############################################################################
# Third party packages settings and configuration #
###############################################################################
[user]
name = Fernando Alves
email = fNxONE@users.noreply.github.com
[color]
diff = auto
status = auto
branch = auto
ui = true
.DS_Store
.python-version
.ropeproject
*.swp
*.pyc
*.sublime-project
*.sublime-workspace
readme.html
@fn-alves
fn-alves / .profile
Last active October 23, 2017 16:40
###############################################################################
# General settings and configuration #
###############################################################################
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
#source ~/.env
###############################################################################
# Third party packages settings and configuration #
###############################################################################
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Set leader key & Python bin (neovim only) "
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let mapleader="\<Space>"
if has('nvim')
let g:python_host_prog = '/home/fNxONE/.virtualenvs/neovim3/bin/python'
endif
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
@fn-alves
fn-alves / .zshrc
Last active October 22, 2017 18:55
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/home/fnx01lv3/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="robbyrussell"