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 | |
sudo apt-get update -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove -y |
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 | |
tmux \ | |
split-window -h ~/web/mcwflog \; \ | |
split-window -v mcflog \; \ | |
select-pane -t {left} \; \ | |
send-keys 'cd web && npm run lint' Enter \; \ | |
split-window -v \; \ | |
send-keys 'cd web && npm test' Enter \; \ | |
new-window -n viweb vi web -c ':cd web' \; \ | |
new-window -n vipublic vi web/public -c ':cd web/public' \; \ |
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
-- import Data.List | |
import Data.Char | |
data Color = Red | Green | Blue deriving (Show, Read) | |
instance Read Color where | |
-- readsPrec _ value = getColor $ lookup firstWord [("Red",Red),("Green",Green),("Blue",Blue)] | |
-- where | |
-- firstWord = takeWhile isAlpha value | |
-- getColor (Just a) = [(a, dropWhile isAlpha value)] |
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 | |
root=${1%/} | |
repositoryId=the-repository-id | |
url=https://the.repository.url/ | |
for pomRoot in `find $root -name '*.pom' -not -path "*-SNAPSHOT*"` | |
do | |
jarRoot=${pomRoot%.pom}.jar |
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
HttpClientBuilder builder = HttpClientBuilder.create(); | |
try (CloseableHttpClient httpClient = builder.build()) { | |
HttpGet httpGet = new HttpGet("http://quote.yahoo.com/d/quotes.csv?s=" + from + to + "=X&f=l1&e=.csv"); | |
ResponseHandler<String> responseHandler = new BasicResponseHandler(); | |
String responseBody = httpClient.execute(httpGet, responseHandler); | |
return parseDouble(responseBody); | |
} catch (IOException e) { | |
throw new RuntimeException(e); | |
} |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
# based on http://askubuntu.com/questions/589469/how-to-automatically-update-atom-editor | |
if [ -e /usr/share/atom ] | |
then | |
CURRENT=$(/usr/share/atom/atom --version) | |
echo "Atom $CURRENT is installed." | |
else | |
echo "Atom not installed." | |
fi | |
echo "Finding latest..." |
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 | |
echo "Finding latest kubectl..." | |
# curl -s https://github.com/kubernetes/kubernetes/releases/latest | awk -F '[<>]' '/.*/ { match($0, "tag/([^\"]+)",a); print a[1] }' | |
LATEST=$(wget -qO- https://github.com/kubernetes/kubernetes/releases/latest | awk -F '[<>]' '/href="\/kubernetes\/kubernetes\/tree\/.*"/ { match($0, "tree/([^\"]+)",a); print a[1] }' | head -1) | |
echo "Getting $LATEST..." | |
sudo wget -NP /usr/bin http://storage.googleapis.com/kubernetes-release/release/$LATEST/bin/linux/amd64/kubectl | |
sudo chmod 755 /usr/bin/kubectl |
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
docker inspect --format '{{ .NetworkSettings.IPAddress }}:$SERVICE_IP' consul-server \ | |
| xargs wget --retry-connrefused --tries=5 -q --wait=3 --spider |