Skip to content

Instantly share code, notes, and snippets.

View p404's full-sized avatar
🏠
Working from home

Pablo Opazo p404

🏠
Working from home
View GitHub Profile
@p404
p404 / molecule.yml
Created April 26, 2019 01:34
Molecule configuration file example
---
driver:
name: docker
lint:
name: yamllint
platforms:
- name: instance
image: solita/ubuntu-systemd:18.04
privileged: True
command: /sbin/init
@p404
p404 / ubuntu-raid.sh
Created September 24, 2017 18:45 — forked from umpirsky/ubuntu-raid.sh
Install Ubuntu on RAID 0 and UEFI/GPT system
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D
sudo -s
apt-get -y install mdadm
apt-get -y install grub-efi-amd64
sgdisk -z /dev/sda
sgdisk -z /dev/sdb
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda
@p404
p404 / install_ffmpeg_ubuntu.sh
Created September 29, 2016 19:10 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
(New-Object System.Net.WebClient).DownloadString("https://gist.githubusercontent.com/absynce/c35b93e27ababbeb9063/raw/6a60aae7a2063cff88fd69feba3c471160defe85/DisableChromeUpdates.ps1") | powershell -command -
@p404
p404 / retext.sh
Created June 22, 2016 21:19
Installing ReText markdown editor on ubuntu 16.04
#! /bin/bash
# You need to execute this script as sudo
apt-get install python3-pip python3-pyqt5 python3-pyqt5.qtwebkit -y
pip3 install retext --user
ln -s $HOME/.local/bin/retext /usr/bin/retext
exit 0
@p404
p404 / git_ignore_backup.sh
Created April 30, 2016 14:46
Bash script that recollect all files ignored in a git project by the .gitignore file
#!/bin/bash
## Git ignore backup script
function compress() {
files=$(grep -v '^\s*#' < .gitignore)
env GZIP=-9 tar cvzf $1.tar.gz $files 2> ignore_backups_errors.txt
exit 0
}
if [[ -z "$1" ]]; then
@p404
p404 / gist:f0d37cb4b4912543f5a5
Last active August 27, 2017 17:13
Server configuration for a rails application (Ubuntu 14.04)
# User: ubuntu
sudo apt-get update
sudo apt-get upgrade
# Access keys
vim .ssh/authorized_keys
# Hostname
sudo vim /etc/hostname
sudo vim /etc/hosts
@p404
p404 / ferengi-plan.txt
Created December 26, 2015 00:12 — forked from kyledrake/ferengi-plan.txt
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@p404
p404 / hwinfo.sh
Last active April 11, 2017 14:13
Hardware Info Linux script
#/bin/bash
echo "Hardware Info"
# CPU
echo "CPU $(cat /proc/cpuinfo | grep 'model name' | uniq)"
echo "Cores : $(cat /proc/cpuinfo | grep processor | wc -l)"
echo "Physical cores: $(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)"
# RAM
echo "RAM : $(dmidecode -t 17 | grep "Size.*MB" | awk '{s+=$2} END {print s / 1024}')G"
@p404
p404 / gist:a1f02bc062391044e4c0
Created May 24, 2015 23:31
Jenkins Build Rails Proyect exec shell
#!/bin/bash -x
export RAILS_ENV=test
bundle install
read -d '' database_yml <<"EOF"
test:
adapter: postgresql
encoding: unicode
database: database_name