Skip to content

Instantly share code, notes, and snippets.

View gfranchini's full-sized avatar
🎯

Giancarlo Franchini gfranchini

🎯
View GitHub Profile
@gfranchini
gfranchini / .bash_profile
Last active May 31, 2017 19:25
Bash Profile
# ~/.bash_profile
[[ -s ~/.bashrc ]] && source ~/.bashrc
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
alias ls='ls -GFh'
alias ll='ls -l'
@gfranchini
gfranchini / install_ruby_rpi.sh
Created August 30, 2016 15:36 — forked from blacktm/install_ruby_rpi.sh
A Bash script to install Ruby 2.3 on the Raspberry Pi (Raspbian)
#!/bin/bash
# -----------------------------------------------------------------------
# Installs Ruby 2.3 using rbenv/ruby-build on the Raspberry Pi (Raspbian)
#
# Run from the web:
# bash <(curl -s raw_script_url_here)
# -----------------------------------------------------------------------
# Set up variables
@gfranchini
gfranchini / .gitignore
Created February 1, 2017 21:41 — forked from salcode/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore
@gfranchini
gfranchini / redis.expect
Created May 24, 2017 09:57 — forked from gregorymostizky/redis.expect
Check if redis is up using telnet and expect
set timeout 5
spawn telnet [lindex $argv 0] [lindex $argv 1]
expect "Connected"
send "PING\n"
expect "+PONG"
send "QUIT"
#usage: expect redis.expect <host> <port>
@gfranchini
gfranchini / gist:9ffa02d1a52a3d6f4ec0632cb235c3e7
Created May 31, 2017 19:14 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@gfranchini
gfranchini / ltc-mining.sh
Created July 11, 2017 21:19 — forked from mediaupstream/ltc-mining.sh
Litecoin CPU Mining setup on Ubuntu Server
#!/bin/bash
#
# Litecoin CPU Mining setup on Ubuntu Server
#
sudo apt-get update;
# install prerequisit software/libs
sudo apt-get -y install make automake build-essential libcurl4-openssl-dev htop
@gfranchini
gfranchini / docker-compose-template.yml
Created January 9, 2018 19:40
Template for creating docker compose files.
version: '3.1' # if no version is specificed then v1 is assumed. Recommend v2 minimum
services: # containers. same as docker run
servicename: # a friendly name. this is also DNS name inside network
image: # Optional if you use build:
command: # Optional, replace the default CMD specified by the image
environment: # Optional, same as -e in docker run
volumes: # Optional, same as -v in docker run
servicename2:
@gfranchini
gfranchini / web.yml
Created February 12, 2019 18:09
Example Ansible Playbook
--- # Bootstrap Webservers
- hosts: webservers
become: yes
tasks:
- name: install httpd
yum:
name: httpd
state: latest
- name: create index.html
file:
@gfranchini
gfranchini / inventory.ini
Last active February 17, 2019 21:11
Sample Ansible inventory file
[webservers]
foo.example.com
bar.example.com
[dbservers]
one.example.com
two.example.com
three.example.com
[control]
@gfranchini
gfranchini / httpd.yml
Last active February 18, 2019 01:09
Install multiple packages w ansible
--- │Kernel has been successfully updated to kernel-3.10.0-957.5.1.el7.x86_64!
- hosts: webservers │[ansible@digistro3c ~]$ cd
become: true │[ansible@digistro3c ~]$ ls
tasks: │inventory.ini playbooks
- name: Install packages │[ansible@digistro3c ~]$ cd playbooks/
yum: