Skip to content

Instantly share code, notes, and snippets.

View stockmind's full-sized avatar

Simone Roberto Nunzi stockmind

View GitHub Profile
# sxhkd config for Linux: Command+Arrow keys macOS style shortcut
super + @{Left,Right}
xte 'keyup Super_L' 'key {Home,End}'
super + shift + @{Left,Right}
xte 'keyup Super_L' 'key {Home,End}'
@stockmind
stockmind / git-sync-all-branches.sh
Created October 15, 2019 14:02 — forked from piaoger/git-sync-all-branches.sh
git-sync-all-branches
# fetch all branches
# From: http://stackoverflow.com/questions/10312521/how-to-fetch-all-git-branches
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master`; do
git branch --track ${branch##*/} $branch
done
git fetch --all
in cli for local db
-Install postgres (one time only for the psql cli tools)
-Install pg in the working folder of code(postgres for node) npm install pg
-createdb nameofdb
-Install knex in the working folder of code npm install knex (-g first time)
-knex init (gives you the knexfile -see below)
-knex migrate:make 'nameofmigrationsfile' <-- then edit
-knex migrate:latest
-optional for seeding- knex seed:make 'nameofseedfile' <--then edit
[
{
"nome": "Agrigento",
"sigla": "AG",
"regione": "Sicilia"
},
{
"nome": "Alessandria",
"sigla": "AL",
"regione": "Piemonte"
#!/usr/bin/env bash
# This script require root privileges
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
# Parse ARGS
POSITIONAL=()
#!/usr/bin/env bash
# This script require root privileges
if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi
# Parse ARGS
POSITIONAL=()
@stockmind
stockmind / xrandr-scale.sh
Created March 29, 2018 16:50 — forked from 3v1n0/xrandr-scale.sh
Xrandr Scaling script, with auto panning when scaling down
#!/bin/bash
export LANG=C
output=$1;
scale=$2;
if [ -n "$output" ] && ! (xrandr --listmonitors | grep -qw "$output"); then
echo "Invalid output: '$output'";
exit 1;
@stockmind
stockmind / windows-10-hyper-v-enable-and-no-hyper-v-menu-entry.ps1
Last active November 11, 2022 04:02
Enable Hyper-V in Windows 10 and add a No Hyper-V boot entry to Windows boot loader
# Author: Simone Roberto Nunzi aka (Stockmind)
# Date: 2018/01/03
# Purpouse: Enable Hyper-V in Windows 10 and add a No Hyper-V boot entry to Windows boot loader
# References:
# https://blogs.msdn.microsoft.com/virtual_pc_guy/2008/04/14/creating-a-no-hypervisor-boot-entry/
# https://stackoverflow.com/questions/35479080/how-to-turn-windows-feature-on-off-from-command-line-in-windows-10
# https://stackoverflow.com/questions/16903460/bcdedit-bcdstore-and-powershell
#
# Launch PowerShell with administrative rights issuing Windows X + A
@stockmind
stockmind / myappindicator_v4.py
Created September 5, 2017 17:05 — forked from candidtim/myappindicator_v4.py
Minimal Ubuntu AppIndicator in Python, with custom icon and a "Quit" menu item
import os
import signal
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, os.path.abspath('sample_icon.svg'), appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
#!/bin/bash
# https://natelandau.com/bash-scripting-utilities/
#
# Set Colors
#
bold=$(tput bold)
underline=$(tput sgr 0 1)
reset=$(tput sgr0)