Skip to content

Instantly share code, notes, and snippets.

View gamerboy's full-sized avatar

Andrea Fianco gamerboy

  • Alkemy
  • Manziana, Rome, Italy
  • 00:18 (UTC +01:00)
  • X @quandomai
View GitHub Profile
@gamerboy
gamerboy / laravel-homestead-daily-usage.md
Last active September 3, 2021 10:21
Homestead daily usage

Laravel Homestead daily usage

Homestead.yaml configuration

ssl: true
backup: true # backup all databases automatically on machine destroy
@gamerboy
gamerboy / vagrant_up.txt
Last active September 2, 2021 15:16
Vagrant up
λ vagrant up
Bringing machine 'homestead' up with 'virtualbox' provider...
==> homestead: Importing base box 'laravel/homestead'...
==> homestead: Matching MAC address for NAT networking...
==> homestead: Checking if box 'laravel/homestead' version '11.4.0' is up to date...
==> homestead: Setting the name of the VM: homestead
==> homestead: Clearing any previously set network interfaces...
==> homestead: Preparing network interfaces based on configuration...
homestead: Adapter 1: nat
homestead: Adapter 2: hostonly

Laravel 8 setup

Installare il pacchetto laravel/installer via composer.

composer global require laravel/installer

Rimuovere laravel/installer se si riscontrano problemi con la creazione di un nuovo progetto.

@gamerboy
gamerboy / linux_web_server_setup.md
Last active February 22, 2018 13:27
Web Server Setup

Linux webserver setup

Apache 2

apt-get install apache2
systemctl enable apache2
systemctl start apache2
apache2ctl configtest
@gamerboy
gamerboy / MainActivity.java
Last active February 6, 2018 15:18
Android for beginners
package com.example.android.htmlquiz;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;

Android

ImageView

Scaling an image to max available width, keeping aspect ratio and avoiding ImageView extra space

<ImageView
        android:id="@+id/game"
 android:layout_width="fill_parent"

Virtual hosts with Apache 2.4

project_name

<VirtualHost *:80>
    ServerName project_name
    ServerAdmin andrea@fianco.it
    DocumentRoot "/Users/andrea/Dropbox/Sites/project_name/html"
    CustomLog    "/Users/andrea/Dropbox/Sites/project_name/access.log" common
 ErrorLog "/Users/andrea/Dropbox/Sites/project_name/error.log"
@gamerboy
gamerboy / lets_encrypt.md
Last active November 13, 2017 09:15
Let's Encrypt setup on Ubuntu

Let's Encrypt setup

Resources

Step 1 — Install the Let's Encrypt Client

Let's Encrypt certificates are fetched via client software running on your server. The official client is called Certbot, and its developers maintain their own Ubuntu software repository with up-to-date versions. Because Certbot is in such active development it's worth using this repository to install a newer version than Ubuntu provides by default.

@gamerboy
gamerboy / mysql_remove_setup_macos.md
Last active March 5, 2018 16:09
Eliminare e reinstallare MySQL da macOS

OSX Sierra e MySQL 5.7.x

Se, come nel mio caso, il vosto computer ha subito rallentamenti allo shutdown (parliamo anche di 10 minuti per spengere il computer) potreste risolvere reinstallando MySQL, con la procedura riportata sotto (fonti vari, Google). Il tutto va eseguito da shell.

Altamente consigliato installare MySQL attraverso brew, 'the missing package manager for macOS'.

Backup dei database

Attenzione! Prima di procedere alla rimozione delle cartelle è necessario eseguire un backup (dump) dei database presenti:

mysqldump -u root -p --all-databases > alldb.sql
@gamerboy
gamerboy / python_resources.md
Last active August 29, 2015 14:17 — forked from jookyboi/python_resources.md
Python-related modules and guides.

Packages

  • lxml - Pythonic binding for the C libraries libxml2 and libxslt.
  • boto - Python interface to Amazon Web Services
  • Django - Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
  • Fabric - Library and command-line tool for streamlining the use of SSH for application deployment or systems administration task.
  • PyMongo - Tools for working with MongoDB, and is the recommended way to work with MongoDB from Python.
  • Celery - Task queue to distribute work across threads or machines.
  • pytz - pytz brings the Olson tz database into Python. This library allows accurate and cross platform timezone calculations using Python 2.4 or higher.

Guides