Skip to content

Instantly share code, notes, and snippets.

View sebnyberg's full-sized avatar
🇸🇪

Sebastian Nyberg sebnyberg

🇸🇪
View GitHub Profile
@sebnyberg
sebnyberg / install_sharenix.sh
Created October 17, 2017 17:10
Install Sharenix on Ubuntu
# Bash script for installing Sharenix
rm -rf sharenix*
sudo rm /bin/sharenix*
rm ~/.sharenix.json
echo Downloading Sharenix...
wget https://github.com/Francesco149/sharenix/releases/download/0.6.5a/sharenix-x86_64.tar.xz >/dev/null 2>&1
wget https://raw.githubusercontent.com/Francesco149/sharenix/master/sharenix-section >/dev/null 2>&1
{
"query": "",
"sort": [
{
"field": "_relevance",
"order": "Descending"
}
],
"fields": [
"variants.subVariant.nutriqty",
@sebnyberg
sebnyberg / introrx.md
Created October 24, 2017 11:47 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@sebnyberg
sebnyberg / _vsvimrc
Created November 27, 2017 12:48
VSVIMRC
let mapleader = "\<Space>"
set timeoutlen=250
nnoremap <leader>w :w<cr>
inoremap jk <esc>
vnoremap jkl <esc>
nnoremap jk <esc>
nnoremap <leader>r :vsc Resharper.Resharper_Rename <cr>
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
export EDITOR="vim"
if [ -t 1 ]; then
exec zsh
fi
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:$HOME/.local/bin:/opt/anaconda2/bin:/opt/cuda/bin:$PATH
# Set npm config prefix (user-specific installations)
export npm_config_prefix=$HOME/.node_modules
# Add npm to path
export PATH=$PATH:$HOME/.node_modules/bin
export PATH=$PATH:$HOME/.yarn/bin
@sebnyberg
sebnyberg / RDS-Aurora-CloudFormation-Example.yaml
Created February 6, 2018 15:40 — forked from sjparkinson/RDS-Aurora-CloudFormation-Example.yaml
A basic CloudFormation template for an RDS Aurora cluster.
---
AWSTemplateFormatVersion: 2010-09-09
Description: >
A basic CloudFormation template for an RDS Aurora cluster.
Parameters:
DatabaseUsername:
AllowedPattern: "[a-zA-Z0-9]+"
ConstraintDescription: must be between 1 to 16 alphanumeric characters.
@sebnyberg
sebnyberg / serverless.yml
Last active February 11, 2018 16:56
CloudFormation environment variables
# serverless.yml
# ...
provider:
name: aws
environment:
MY_GREETING: "Hello!"
UserData:
Fn::Base64:
Fn::Sub: |
#!/bin/bash
# install pip
OS=`cat /etc/os-release | grep '^NAME=' | tr -d \" | sed 's/\n//g' | sed 's/NAME=//g'`
if [ "$OS" == "Ubuntu" ]; then
apt-get -y update
Resources:
Type: AWS::EC2::Instance
Properties:
# ...
UserData:
Fn::Base64: |
#!/bin/bash
echo 'hello, world' > /var/log/user-data-log.txt