Skip to content

Instantly share code, notes, and snippets.

Avatar
👽

Lara laraconda

👽
View GitHub Profile
View .vimrc
set encoding=utf-8
filetype on
syntax on
colorscheme default
set backspace=indent,eol,start
set tabstop=4
set shiftwidth=4
View setup_config
#!/bin/sh
# setup_config - Create necessary files so you can use the config
# command to explain and describe the configuration of your computer
path_config_file=/home/config
if [ ! -f $path_config_file ]; then
sudo touch $path_config_file
fi
sudo chmod 664 $path_config_file
text="Describe the config of your computer in $path_config_file"
@laraconda
laraconda / setup_motd
Last active Jan 14, 2017
Installs necessary software and creates files in order to be able to use a dynamic MOTD.
View setup_motd
#!/bin/sh
#
# setup_motd - Create necesary files to display a dynamic MOTD
sudo apt-get install figlet
motdd_location=/etc/update-motd.d
sudo mkdir -p $motdd_location
default_motd_location=/etc/motd
@laraconda
laraconda / 00-head
Last active Jan 13, 2017
Compose the MOTD.
View 00-head
#!/bin/sh
#
# 00-header - create the header of the MOTD
# Copyright (c) 2013 Nick Charlton
# Copyright (c) 2009-2010 Canonical Ltd.
#
# Authors: Nick Charlton <hello@nickcharlton.net>
# Dustin Kirkland <kirkland@canonical.com>
#
# This program is free software; you can redistribute it and/or modify
View env_vars.sh
#!/bin/sh
# Set env vars from a file in the same dir as this script.
for ENVV in `cat $( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/[env_vars_raw]`
do
export $ENVV
done
@laraconda
laraconda / post-merge
Last active Dec 29, 2016
Change the ownership of files in a project after a git [merge]. This file must be placed in .git/hooks/.
View post-merge
#!/bin/sh
echo "Your message"
sudo chgrp -R [grp] [a/dir]
# Changing ownership of sockets
sudo chgrp www-data [a/dir]/*.sock
# Permissions must be 755
# To use this file after a git checkout name it: post-checkout