Skip to content

Instantly share code, notes, and snippets.

View pleasemarkdarkly's full-sized avatar
🎯
Pushing buttons.

pleasemarkdarkly

🎯
Pushing buttons.
  • Earth
View GitHub Profile
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
@pleasemarkdarkly
pleasemarkdarkly / simplified_create_headless_ssh_rpi.sh
Last active January 1, 2020 13:32
Script to setup users and SSH on a Ubuntu Server 19.04 Raspberry Pi 4 SD card image. By default Ubuntu Server does not enable SSH. So to enable this and create a few users, this script was created and adapted from instructions from the referenced website. This script should be used on a host Linux machine, Ubuntu to see the writeable directory o…
#!/bin/sh
# based on instructions from
# https://www.berthon.eu/2017/installing-ubuntu-server-on-raspberry-pi-headless/
session=$(date +"%Y%m%d%H%M%S")
array_users=(
rooot
)
@pleasemarkdarkly
pleasemarkdarkly / chucknorris_joke.sh
Last active January 1, 2020 14:24
Bash script to parse Chuck Norris jokes for presentation in terminal. I use it for shoving into cowsay.
#!/bin/bash
curl -s http://api.icndb.com/jokes/random/ | python -c 'import sys, json; print "\n"+json.load(sys.stdin)["value"]["joke"]+"\n\n"'
@pleasemarkdarkly
pleasemarkdarkly / macos_settings_init.conf
Created January 1, 2020 14:31
default macOS settings
#!/usr/bin/env bash
# Modified from the Legendary https://github.com/mathiasbynens/dotfiles
# Mathias Bynens, mathiasbynens
# Close any open System Preferences panes, to prevent them from overriding
# what removed all the apps from dock?
# settings we're about to change
@pleasemarkdarkly
pleasemarkdarkly / gist_wrapper.sh
Created January 1, 2020 15:06
My gist poster didnt want to add a description, boo hoo. The script posting robot has added this message. For your pleasure.
#!/bin/bash
desc='My gist poster didnt want to add a description, boo hoo. The script posting robot has added this message. For your pleasure.'
function post_private_gist () {
[[ -z "$1" ]] && {echo "Usage: post_private_gist [filename] [description]" }
[[ -z "$2" ]] && {echo "No description, must be really awesome code."} | echo "Missing filename and description"
desc=$2
@pleasemarkdarkly
pleasemarkdarkly / docker-functions.sh
Created January 1, 2020 15:08
My gist poster didnt want to add a description, boo hoo. The script posting robot has added this message. For your pleasure.
#####################################
# curl -Lo /tmp/docker-functions http://j.mp/docker-functions && source /tmp/docker-functions
#####################################
DOCKER_FUNCTION_VERSION=0.9
alias dps='docker ps'
alias dpsa='docker ps -a'
alias drun='docker run -it --rm'
@pleasemarkdarkly
pleasemarkdarkly / transfer.sh
Last active January 4, 2020 05:39
Command line moving around of files
# https://transfersh.pleasemarkdarkly.com/XSkei/transfer.sh
# http://bit.ly/2QJUGkL
# This gist
# http://bit.ly/2FpgtZz
transfer(){ if [ $# -eq 0 ];then echo "No arguments specified.\nUsage:\n transfer <file|directory>\n ... | transfer <file_name>">&2;return 1;fi;if tty -s;then file="$1";file_name=$(basename "$file");if [ ! -e "$file" ];then echo "$file: No such file or directory">&2;return 1;fi;if [ -d "$file" ];then file_name="$file_name.zip" ,;(cd "$file"&&zip -r -q - .)|curl --progress-bar --upload-file "-" "https://transfersh.pleasemarkdarkly.com/$file_name"|tee /dev/null,;else cat "$file"|curl --progress-bar --upload-file "-" "https://transfersh.pleasemarkdarkly.com/$file_name"|tee /dev/null;fi;else file_name=$1;curl --progress-bar --upload-file "-" "https://transfersh.pleasemarkdarkly.com/$file_name"|tee /dev/null;fi;}
@pleasemarkdarkly
pleasemarkdarkly / gist_create_videos.sh
Created January 7, 2020 08:34
Create variable length random or sequential video frames with specific or randomly selected royality free music. Created for an illustrator friend who needed automatic generation of advertisements amd social media.
#!/usr/bin/env bash
#--------------------------------------------------------------------------------------------------
# Script to create videos from PNGs with watermark and music, royality free except the marketing
# images, predominately for www.natasha-pannkina.com's illustrations.
#
# 2020 license is simply to reference www.natasha-pankina.com's illustrations on your blog AND
# with any file you create with this tool, notify her and she'll reference you too
#
# logging support: http://pretty.pleasemarkdarkly.com:8080/bsR9l/log4bash.sh
@pleasemarkdarkly
pleasemarkdarkly / netatalk_install.sh
Last active January 7, 2020 09:52
Single install script for netatalk, avahi, backing up configs, menu driven. Ubuntu 19.04, Raspberry Pi 4.
#!/bin/bash
# http://netatalk.sourceforge.net/wiki/index.php/Install_Netatalk_3.1.12_on_Ubuntu_18.10_Cosmic
# gist: https://gist.github.com/21d090cba63cff6a8377f5831d71e54d
# wget http://bit.ly/2T6lSNc -O netatalk_install.sh; chmod +x netatalk_install.sh;
trap "exit 1" HUP INT PIPE QUIT TERM
trap cleanup EXIT
session="$(date '+%F-%H%M-%S')"
#!/usr/bin/env bash
#--------------------------------------------------------------------------------------------------
#
# set -e
version="0.0.1"
this_script="${0%.sh}"
project="bash template"
#
#--------------------------------------------------------------------------------------------------