Skip to content

Instantly share code, notes, and snippets.

View rGalrito's full-sized avatar

Rafael Galrito rGalrito

  • Porto, Portugal
View GitHub Profile
@rGalrito
rGalrito / resolvconf.yml
Last active October 19, 2021 14:06
ansible-playbook to run as a script. Goal: restart network device, connect to VPN and set domain to rafaelgalrito.be
#!/usr/bin/ansible-playbook
- name: resolvconf
hosts: localhost
any_errors_fatal: false
#become: true
gather_facts: false
vars:
dns_domain: False
dns_rpi_server: False
restart_wifi: False
#!/bin/sh
# What is this
# - script to easily set up wifi connection on terminal, using wpa_cli
#
# Installation
#
# - chmod +x wifi
# - sudo mv wifi /usr/local/bin/
#
#
@rGalrito
rGalrito / ipdetailslist
Created May 16, 2016 17:53
Get detailed information about ip
#!/bin/sh
# Should be added to local commands with: sudo mv `pwd`/ipdetailslist /usr/local/bin
# sh ipdetailslist *ip list*
# First argument is a file in the same path that has ips line by line
#
# Example:
# rafael@computer: ~/path-to-ip-file/: ipdetailslist list_of_ips.txt
@rGalrito
rGalrito / zsh_installer.sh
Last active January 15, 2016 23:59
Z Shell (zsh) installer, and some more useful tools
#!/bin/sh
# 10 Jan 2016
# Rafael Galrito
#
# This is my (way more than) zsh and config installation file
# requires sudo permissions
# run with sh zsh_installer.sh
#
# @version 0.3
# ---
@rGalrito
rGalrito / zshfunctions.sh
Created January 6, 2016 19:43
My bash functions. It should be added to .bashrc or .zshrc to load them on start
makezip()
{
zip -r "${1%%/}.zip" "$1";
}
maketar()
{
tar cvzf "${1%%/}.tar.gz" "${1%%/}/";
}
extract()
{
@rGalrito
rGalrito / .zshrc
Last active January 6, 2016 19:47
My oh-my-zsh aliases
# Path to your oh-my-zsh installation.
# export TERM="xterm-256color"
export ZSH=/home/rafael/.oh-my-zsh
# Theme choosen from ~/.oh-my-zsh/themes/
ZSH_THEME="blinks"
setopt menu_complete
# Uncomment the following line to disable auto-setting terminal title.
@rGalrito
rGalrito / template
Last active August 29, 2015 14:09
LINUX: Startup scripts - All scripts need LSB tags to run. Command: update-rc.d *template* defaults
### BEGIN INIT INFO
# Provides: automount
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start daemon at boot time
# Description: Enable service provided by daemon.
### END INIT INFO
@rGalrito
rGalrito / rpicnt.sh
Last active August 29, 2015 14:05
Connect to raspberry pi
# shell script to connect to rasberrypi
# client requires xtightvncviewer for GUI
# One argument: ssh, gui or stop
# ssh starts a command line on rpi
# gui starts a vnc server and connects to it
# stop stops vnc server
# raspberry pi requires tightvncserver