Skip to content

Instantly share code, notes, and snippets.

View fbenavides69's full-sized avatar

Francisco Benavides fbenavides69

View GitHub Profile
@fbenavides69
fbenavides69 / README
Last active May 10, 2021 13:21
WSL DNS fix
1. Create a file: /etc/wsl.conf and and put the following lines in the file in order to ensure the your DNS changes do not get blown away
[network]
generateResolvConf = false
2. Shutdown WSL then restart it
wsl --terminate or wsl --shutdown
3. Delete resolv.conf file and put the following lines (commands to get the company DNS IPs: "Get-NetIPInterface" and/or "ipconfig /all"):
search company.com
nameserver xxx.xxx.xxx.xxx # Company DNS 1
@fbenavides69
fbenavides69 / README
Created May 7, 2021 06:50
WSL Ubuntu Python Development Environment
# Linux Ubuntu 20.4 LTS
# Python Development Environment
# Install Python Baseline
sudo apt-get install build-essential libssl-dev libffi-dev python-dev python3-dev git tmux jupyter openssh-server
net-tools htop apt-utils zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev python3-pip
libxml2-dev libxslt-dev unixodbc-dev liblzma-dev libxml2-dev libxmlsec1-dev libxmlsec1-openssl
pkg-config
python3 -m pip install --upgrade pip
@fbenavides69
fbenavides69 / README
Last active May 7, 2021 06:33
Development Environment MacOS Installation
# Install Terminal Fonts
curl -O https://raw.githubusercontent.com/MartinSeeler/iterm2-material-design/master/material-design-colors.itermcolors
# Install Homebrew Terminal App Installer
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
# install MacOS Development dependencies
xcode-select --install
# Install Homebrew GUI App Installer
brew install cask
@fbenavides69
fbenavides69 / pyproject.toml
Created May 28, 2020 15:02
Poetry project toml file
[tool.poetry]
name = "iso-lib"
version = "0.1.0"
description = ""
authors = ["Francisco Benavides <francisco.benavides@betm.com>"]
readme = "README.md"
license = "LICENSE.md"
keywords = ["python", "sanic", "queues", "asyncio", "multiprocessing"]
homepage = "https://github.com/"
repository = "https://github.com/"
@fbenavides69
fbenavides69 / read_rds.py
Created May 18, 2019 21:10
Read RDS file (R) and save to Excel
import pyreadr
# conda install -c conda-forge pyreadr
# https://stackoverflow.com/questions/40996175/loading-a-rds-file-in-pandas
result = pyreadr.read_r('/path/to/file.rds') # also works for RData
# done!
# result is a dictionary where keys are the name of objects and the values python
# objects. In the case of Rds there is only one object with None as key
@fbenavides69
fbenavides69 / progress.py
Created March 20, 2018 15:29
Console display multiple progress lines
""" Display multiple progress lines.
Executes in both Python 2 and Python 3.
Display dynamic progress bars which will grow gradually upon the increment
and display the growth percentage at the end (e.g.):
[====] 4%
[+++++] 5%
[■■■] 3%
@fbenavides69
fbenavides69 / test_splinter.py
Created March 20, 2018 14:46
Splinter web application test suite demo
''' Splinter Demo
Open source tool for testing web applications using Python. It allows
automating browser actions, such as visiting URLs and interacting with
their elements, through a headless browser (a web browser without a
graphical user interface).
Based upon:
https://splinter.readthedocs.io/en/latest/index.html