Skip to content

Instantly share code, notes, and snippets.

@Ketrel
Ketrel / .customize_prompt
Last active Feb 12, 2018
Bash Prompt File
View .customize_prompt
#!/bin/bash
p_checkRoot(){
if [ $(id -u) -eq 0 ]; then
return 0
fi
return 1
}
p_colorSetup(){
case "$TERM" in
*color*)
@Ketrel
Ketrel / sshcon.sh
Created Jan 28, 2018
SSH Connect Shortcut
View sshcon.sh
#!/bin/sh
e="\033"
clu(){
if [ ! -z ${1} ] && [ $(tput colors) -ge 8 ]; then
printf "${e}[${1}m"
fi
}
prog=""
default="server"
pathmod="/local"
@Ketrel
Ketrel / checkSubStr.sh
Created Jan 23, 2018
posix substring check
View checkSubStr.sh
checkSubStr(){
if [ ! -z "${1}" ] && [ -z "${1%%*${2}*}" ]; then
return 0
else
return 1
fi
}
@Ketrel
Ketrel / .tmux.conf
Last active Jan 19, 2018
Default tmux config
View .tmux.conf
# Setup Window Titles
set set-titles on
set set-titles-string '#W (#h)'
# Setup Status
set status-bg colour31
set status-fg colour16
#set status-position top
# Change Window Split Keys
@Ketrel
Ketrel / relBase.html
Last active May 18, 2020
Relative url base for jekyll
View relBase.html
{% assign relBase = '' %}
{% assign tempDepth = page.url | append: 'hackish-solution' | split: '/' | size | minus: 2 %}
{% for i in (1..tempDepth) %}
{% assign relBase = relBase | append: "../" %}
{% endfor %}
{% if relBase == '' %}
{% assign relBase = './' %}
{% endif %}
@Ketrel
Ketrel / installDocker.sh
Last active Jan 8, 2018
Debian Docker install with compose
View installDocker.sh
#!/bin/sh
sudo apt-get remove docker docker-engine docker.io
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
@Ketrel
Ketrel / .nanorc
Created Aug 30, 2017
Default .nanorc file I use
View .nanorc
set tabstospaces
set tabsize 4
set const
You can’t perform that action at this time.