Skip to content

Instantly share code, notes, and snippets.

View Pelirrojo's full-sized avatar
🤷‍♂️
Somewhere I have to keep my test code

Manuel Eusebio de Paz Carmona Pelirrojo

🤷‍♂️
Somewhere I have to keep my test code
View GitHub Profile
@Pelirrojo
Pelirrojo / README.md
Last active December 19, 2021 21:44
# install-wifi - 13/01/2021 - by MrEngman (a humble backup)

How to install USB Wifi Dongle on a Raspberry PI

source: https://forums.raspberrypi.com/viewtopic.php?t=178405


# Download the script as executable 
$> sudo wget http://www.fars-robotics.net/install-wifi -O /usr/bin/install-wifi
$> sudo chmod +x /usr/bin/install-wifi
@Pelirrojo
Pelirrojo / miniconda_install.sh
Created December 25, 2020 22:40
Ubuntu MiniConda Installation
#!/usr/bin/env bash
clear
wget --version >/dev/null 2>&1 || { echo >&2 "I require Bash Shell but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }
cd
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
chmod +x Miniconda3-latest-Linux-x86_64.sh
@Pelirrojo
Pelirrojo / fix_files_code_permissions.sh
Created September 21, 2020 16:52
Fix file permissions on git repo after losing (moving onto an usb or similar)
#!/bin/bash
# Put 644 to files & 755 for directories
find ./project \( -type f -execdir chmod 644 {} \; \) -o \( -type d -execdir chmod 755 {} \; \)
# Make bash scripts executable
chmod +x ./**/*.sh
@Pelirrojo
Pelirrojo / .zshrc
Last active September 20, 2020 15:36 — forked from gfguthrie/.zshrc
Lazy Load Homebrew NVM but still have default aliased Node in PATH
# Based on https://gist.github.com/gfguthrie/9f9e3908745694c81330c01111a9d642#gistcomment-3143229
(...)
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
DEFAULT_NODE_VER='default';
while [ -s "$NVM_DIR/alias/$DEFAULT_NODE_VER" ]; do
@Pelirrojo
Pelirrojo / progressbar-example.sh
Created June 24, 2020 14:28
shell-progressbar
#!/usr/bin/env bash
# Obtained from: https://github.com/haikieu/shell-progressbar
#################################### DEMO ######################################
# This is a simple demostration
# Important notice: below code is not necessary in your code, remember to remove before using
################################################################################
@Pelirrojo
Pelirrojo / cfn_init.sh
Last active June 24, 2020 23:34
Install Boinc & Join Rosetta@Home with custom token with CENTOS flavour (alike AWS EC2)
# https://tech.cccp.io/post/8_linux_boinc_install/
# ------------------------------------------------
# Update SSOO
yum update -y
# Update Engine
yum install -y \
epel-release \
boinc-client \
@Pelirrojo
Pelirrojo / bootstrap_install.sh
Created June 12, 2020 01:26
Raspberry PI Installation with LCD, Wifi & Bluetoth
ssh pi@<ip>
# Change default user password
passwd
# Install DevOps
sudo su -
apt-get update && apt-get -y dist-upgrade && apt-get install raspberrypi-ui-mods
apt-get install --no-install-recommends xinit
apt-get install --no-install-recommends xserver-xorg
@Pelirrojo
Pelirrojo / Mother-of-all-bash-scripts.sh
Last active June 23, 2020 15:30
Base Template in Shell script for any typical automated instruction on Linux/MacOs
#!/usr/bin/env bash
# A base script to copy & paste typical bash script actions
# You can also use some better like: https://devhints.io/bash
# DO WHAT THE F*CK YOU WANT TO PUBLIC LICENSE #
# Version 2, December 2004 #
# #
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> #
# #
#!/bin/bash
if [[ $(id -u) -ne 0 ]]; then
echo "Must run as root!"
exit 1
fi
AGENT_UNINSTALL_SCRIPT="/opt/jc/bin/removeAgent"
if [[ -f $AGENT_UNINSTALL_SCRIPT ]]; then
chmod 0700 $AGENT_UNINSTALL_SCRIPT
@Pelirrojo
Pelirrojo / install_opencv_from_source.sh
Last active April 12, 2020 14:36
Install OpenCV on Ubuntu 19.10 with MiniConda
#!/usr/bin/env bash
# Thanks to:
# https://linuxize.com/post/how-to-install-opencv-on-ubuntu-18-04/
# https://pydeeplearning.com/opencv/install-opencv3-with-anaconda-python3-6-on-ubuntu-18-04/`
python --version >/dev/null 2>&1 || { echo >&2 "I require python@3 environment but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }
conda --version >/dev/null 2>&1 || { echo >&2 "I require conda utility but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }
pip --version >/dev/null 2>&1 || { echo >&2 "I require pip packagem amaner but it's not installed. ¯\_(ツ)_/¯ Aborting."; exit 1; }