This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Languafy.Web.Context do | |
@behaviour Plug | |
import Plug.Conn | |
alias Languafy.User | |
def init(opts), do: opts | |
def call(conn, _) do | |
case build_context(conn) do | |
{:ok, context} -> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
RESTART="/etc/init.d/networking restart" | |
FILEPATH="/etc/network/interfaces" | |
BACKUPPATH="$FILEPATH.BAK" | |
RESET_TIME="now + ${1:-5min}" | |
sudo cp -fp $FILEPATH $BACKUPPATH && \ | |
sudoedit $FILEPATH && \ | |
sudo bash -c "echo 'cp -fp $BACKUPPATH $FILEPATH && $RESTART' | at $RESET_TIME" && \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Heith Seewald 2012 | |
#Feel free to extend/modify to meet your needs. | |
#Maya on Ubuntu v.1 | |
#This is the base installer... I’ll add more features in later versions. | |
#if you have any issues, feel free email me at heiths@gmail.com | |
#### Lets run a few checks to make sure things work as expected. | |
#Make sure we’re running with root permissions. | |
if [ `whoami` != root ]; then |