Skip to content

Instantly share code, notes, and snippets.

View daveyc's full-sized avatar

David Crayford daveyc

  • Rocket Software
View GitHub Profile
@matthiassb
matthiassb / dns-sync.sh
Last active August 24, 2024 09:43
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@weldpua2008
weldpua2008 / Recursively deploys folder content to artifactory.sh
Created January 15, 2017 08:40
How to recursively upload files to Artifactory
#!/bin/bash
# Recursively deploys folder content. Attempt checksum deploy first to optimize upload time.
repo_url="http://artifactory:8081/artifactory"
tgt_repo="some_repository"
user=user
pass=password
dir="$2"
if [ -z "$dir" ]; then echo "Please specify a directory to recursively upload from!"; exit 1; fi
if [ ! -x "`which sha1sum`" ]; then echo "You need to have the 'sha1sum' command in your path."; exit 1; fi
# Upload by checksum all jars and pom from the source dir to the target repo
@mkottman
mkottman / twoline_prompt.sh
Last active July 19, 2023 06:53
A two-line colored Bash prompt (PS1) with Git branch and a line decoration which adjusts automatically to the width of the terminal. Recognizes SVN, Git and Fossil version control systems and shows the current branch/revision.
# A two-line colored Bash prompt (PS1) with Git branch and a line decoration
# which adjusts automatically to the width of the terminal.
# Recognizes and shows Git, SVN and Fossil branch/revision.
# Screenshot: http://img194.imageshack.us/img194/2154/twolineprompt.png
# Michal Kottman, 2012
RESET="\[\033[0m\]"
RED="\[\033[0;31m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"