Skip to content

Instantly share code, notes, and snippets.

View maxpatternman's full-sized avatar

Max Patternman maxpatternman

View GitHub Profile
@maxpatternman
maxpatternman / wttr
Last active November 10, 2021 12:19
Weather information with curl and wttr.io
#!/usr/bin/env bash
# usage: wttr [location], e.g. wttr Berlin, wttr New\ York
# Standard location if no parameters were passed
location=''
language=''
# Expand terminal display
printf "\e[8;41;125t"

Keybase proof

I hereby claim:

  • I am maxpatternman on github.
  • I am maxpatternman (https://keybase.io/maxpatternman) on keybase.
  • I have a public key ASDTS7W3vKOVNUKrr-IehNNC783srtzBGGhrJwu8Eif2Bgo

To claim this, I am signing this object:

adgeek
afrogeek
ageeksdiary
alejogeekr
alphageek
americangeek
anarchistgeeks
androgeek974
androidgeek
animegeek32
@maxpatternman
maxpatternman / discord-bot-post-message.sh
Last active March 1, 2018 14:36 — forked from ianklatzco/discord-bot-post-message.sh
sends a message to a discord channel via a bot using command line HTTP POST- curl
#!/usr/bin/env bash
# update the TOKEN and the CHANNELID, rest is optional
# you may need to connect with a websocket the first time you run the bot
# use a library like discord.py to do so
BOT_TOKEN=''
CHANNELID=''
curl -v \
@maxpatternman
maxpatternman / send_to_telegram
Created January 9, 2018 20:57
Send messages with your TelegramBot
#!/bin/sh
API_TOKEN=''
CHAT_ID=''
PARSE_MODE='Markdown'
curl -s \
--retry 20 \
-X POST "https://api.telegram.org/bot${API_TOKEN}/sendMessage" \
-d chat_id=${CHAT_ID} \
@maxpatternman
maxpatternman / grub_timeout_1s.sh
Last active October 16, 2017 20:05
Changes Grub Timeout to 1 Second
#!/usr/bin/env bash
# One-Liner command with sudo
#sudo sed -i 's/^GRUB_TIMEOUT=.*/GRUB_TIMEOUT=1/g' /etc/default/grub && sudo update-grub
path_to_grub=/etc/default/grub
if test ! -w ${path_to_grub}; then
echo "no permission, run as root"
exit 1