This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vim:ft=make:ts=8:sts=8:sw=8:noet:tw=80:nowrap:list | |
### | |
### Reference Makefile for Python stuff | |
### | |
### Mv: ferreira.mv[ at ]gmail.com | |
### 2019-07 | |
### | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# List unique values in a DataFrame column | |
pd.unique(df.column_name.ravel()) | |
# Convert Series datatype to numeric, getting rid of any non-numeric values | |
df['col'] = df['col'].astype(str).convert_objects(convert_numeric=True) | |
# Grab DataFrame rows where column has certain values | |
valuelist = ['value1', 'value2', 'value3'] | |
df = df[df.column.isin(valuelist)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/skel/.bashrc <<'EOF' | |
# .bashrc | |
[ -f /etc/.env-verbose ] && echo "# Inside ~/.bashrc: [$0]" | |
# Source global definitions | |
if [ -f /etc/bashrc ] | |
then . /etc/bashrc | |
fi | |
# Uncomment the following line if you don't like systemctl's auto-paging feature: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/vimrc <<'EOF' | |
syntax on | |
filetype indent plugin on | |
set nocompatible " Use Vim defaults (much better!) | |
set bs=indent,eol,start " allow backspacing over everything in insert mode | |
set viminfo='20,\"50 " read/write a .viminfo file, don't store more than 50 lines of registers | |
set history=50 " keep 50 lines of command line history | |
set fileencodings=utf-8,latin1 | |
" Only do this part when compiled with support for autocommands |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/profile.d/aliases.sh <<'EOF' | |
#!/bin/bash | |
# | |
# /etc/profile.d/aliases.sh | |
# | |
alias ls='ls -hAF --color=auto --time-style=long-iso' | |
alias ll='ls -l' | |
alias la='ls -a' | |
alias lr='ls -ltr' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/profile.d/ps1.sh <<'EOF' | |
#!/bin/bash | |
# Ref: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html | |
# Attribute codes: | |
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed | |
# Text color codes: | |
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white | |
# Background color codes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/bashrc <<'EOF' | |
# /etc/bashrc | |
# System wide functions and aliases | |
# (environment variables goes in /etc/profile) | |
## | |
## ferreira.mv@gmail.com: | |
## | |
## /etc/bashrc does the following: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat > /etc/profile <<'EOF' | |
# /etc/profile | |
# System wide environment and startup programs, for login setup | |
# (look for functions and aliases in /etc/bashrc) | |
## | |
## ferreira.mv@gmail.com: | |
## | |
## /etc/profile does only the following: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use CDROM installation media | |
cdrom | |
# Network information | |
network --bootproto=dhcp --device=p2p1 --ipv6=auto --activate | |
network --hostname=fedora20.local | |
# Run the Setup Agent on first boot | |
firstboot --enable | |
ignoredisk --only-use=sda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
# | |
# A very simple CGI script to receive a Github webhook and | |
# send to a 'ThoughtWorks Go Server' | |
# | |
# Usage: | |
# Github Webhooks / Manage webhook | |
# Payload URL: | |
# http://your-url.example.com/go/pipeline-schedure.rb | |
# |
NewerOlder