Skip to content

Instantly share code, notes, and snippets.

View fabiosoft's full-sized avatar

Fabio Nisci fabiosoft

View GitHub Profile
@fabiosoft
fabiosoft / changeHostname.sh
Created February 10, 2014 20:37
Change Hostname for Raspberry Pi Raspbian Wheezy OS. Fabio Nisci
#!/bin/bash
echo "Change Hostname Permanently"
echo "Script by Fabio Nisci 2014"
echo "Enjoy."
# Only root can!
if [[ $EUID -ne 0 ]]; then
echo "Run this script as ROOT o SUDO" 1>&2
exit 1
#!/bin/bash
# Installazione "Wicd" Network Manager per WiFi e Eth
# Start as Root or sudo.
# Solo root può eseguire lo script
if [[ $EUID -ne 0 ]]; then
echo "Avvia lo script come ROOT o SUDO" 1>&2
exit 1
fi
#!/bin/bash
# Descriprion:
# This simple script creates a local sd image backup of a remote raspberry pi in a local folder
# using ssh, dd, and the unix pipe
# Author: Fabio Nisci
# Date: 23/Apr/2014
# Requirements:
# - ssh
# - sshpass (auto installation)
@fabiosoft
fabiosoft / rails
Created March 17, 2015 22:36
Rails' built-in server binding default on 0.0.0.0 or different port
#!/usr/bin/env ruby2.2
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
# START NEW CODE
require "rails/commands/server"
@fabiosoft
fabiosoft / Podfile
Created December 6, 2016 11:03
Generic podfile form common app
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'yourapp' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
# Pods for your app
## utils
@fabiosoft
fabiosoft / cleaner.sh
Last active December 12, 2016 21:52 — forked from wilson428/dropbox.sh
Fix Dropbox conflicts automatically.
#!/bin/bash
#Thx, http://stackoverflow.com/questions/20723868/batch-rename-dropbox-conflict-files
#Point to where you want the script to look and where it should backup files it replaces
folder="$(pwd)"
backup=~/Desktop/Dropbox.backup
#colors
red='\033[0;31m'
@fabiosoft
fabiosoft / rc.local
Created December 20, 2016 15:28
Raspberry pi original rc.local boot file
#!/bin/sh -e
#/etc/rc.local
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
@fabiosoft
fabiosoft / Program.cs
Created February 2, 2017 10:10
C# Sudoku Generator
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static int[,] grid = new int[9, 9];
@fabiosoft
fabiosoft / backup.sh
Created February 27, 2018 18:03 — forked from fragolinux/backup.sh
simple but effective node-red setup backup script
#!/bin/bash
DATE=$(date +"%Y-%m-%dT%H-%M-%SZ")
HOME=/home/pi
BACKUP=$HOME/backup
WHERE=$BACKUP/$DATE
# create dated backup folders
mkdir -p $WHERE/{sqlite,nodered,etc,homebridge}
@fabiosoft
fabiosoft / ZoomCardFlowLayout.swift
Created May 2, 2018 19:49 — forked from Oni-zerone/ZoomCardFlowLayout.swift
A card zooming custom flow layout
//
// ZoomCardFlowLayout.swift
//
//
// Created by Oni_01 on 12/05/15.
// Copyright (c) 2015 Andrea Altea. All rights reserved.
//
import UIKit