Skip to content

Instantly share code, notes, and snippets.

View gfiorav's full-sized avatar

Guido Fioravantti gfiorav

View GitHub Profile
@westdavidr
westdavidr / go-install-wsl.sh
Created February 27, 2018 16:01
Script to install Go 1.10 on WSL
#!/bin/bash
set -e
GVERSION="1.10"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/projects/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"
@sgtoj
sgtoj / persistent_c_mount_wsl.sh
Last active June 24, 2024 21:32
Ubuntu for Windows: Mounting C: Drive to WSL's Root
# allow `mount` cmd without password
echo "$USER ALL=NOPASSWD: /bin/mount" | (sudo su -c 'EDITOR="tee -a" visudo')
# add the mount directive to `fstab`
sudo mkdir -p /c
sudo sh -c "echo '/mnt/c /c none bind' >> /etc/fstab"
# update to `.bashrc` to auto mount at login
echo "sudo mount -a" >> ~/.bashrc
# now reload it
source ~/.bashrc
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@ejdyksen
ejdyksen / patch-edid.md
Last active July 18, 2024 14:37
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@damphat
damphat / apt-rdepends-tree
Last active July 6, 2024 07:46
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@stevendanna
stevendanna / gist:5552324
Last active November 30, 2022 07:02
A small chef-solo example

An example cookbook directory

sdanna@gaius ~/tmp/example > tree
.
├── cookbooks
│   └── foobar
│       ├── CHANGELOG.md
│       ├── README.md
│       ├── attributes
│       ├── definitions
@brenes
brenes / README.md
Last active July 10, 2024 13:50
CSV de paises, con nombre en castellano, ingles, codigo ISO y prefijo telefónico del país