Skip to content

Instantly share code, notes, and snippets.

View iamtew's full-sized avatar
🤯
My status? I just found the User Status function!

Mikael 'tew' iamtew

🤯
My status? I just found the User Status function!
View GitHub Profile
#! /usr/bin/env bash
#
# willie_monit.sh
#
# Crontab script to ensure Willie bot is running :-)
#
# Willi configuration file and PID file
willie_cfg="$HOME/.willie/default.cfg"
willie_pid="$HOME/.willie/willie-default.pid"
@iamtew
iamtew / md2docx.sh
Created August 21, 2014 19:38
Markdown 2 DOCX using Pandoc
#! /usr/bin/env bash
# For some reason not everyone in the office enjoys markdown documents, so here's
# a quick Pandoc converter function to stick in your ~/.bashrc
md2docx ()
{
INPUT=$1
if [[ $INPUT ]]
then

Keybase proof

I hereby claim:

  • I am iamtew on github.
  • I am iamtew (https://keybase.io/iamtew) on keybase.
  • I have a public key whose fingerprint is 6F85 DF1A 6627 9604 EC6D 17E7 8993 5726 6741 0E7D

To claim this, I am signing this object:

@iamtew
iamtew / build-rpm
Created April 17, 2014 14:37
Simple script to build rpm package with FPM
#! /bin/bash
#
# Simple script to build rpm package with FPM
#
# How to use:
# 1. Create package directory to hold all files, like: ~/src/<package>
# 2. Copy this script, build-rpm, to package directory
# 3. Create subdirectory for the buildroot, like: ~/src/<package>/buildroot
# 4. The buildroot directory will act as a chroot, place files and
# and directories in their appropriate target locations
#! /bin/bash
# Simple function to keep in your bashrc to lookup dependencies of a package
# in RHEL/CentOS/Fedora or other similair distributions.
#
# Based on commands from this email thread:
# http://lists.centos.org/pipermail/centos/2006-May/022778.html
yum-pkg-depends ()
{
PACKAGE_NAME=$1
@iamtew
iamtew / dell-get-sysinfo
Created November 27, 2013 12:46
A lot of times I need to lookup info on a Dell service tag. This quick and dirty script works for me, might be useful for someone else as well.
#! /bin/bash
# We need one input at least
if [ $# -lt 1 ]
then
echo "Error: No input found, please provide a Dell service tag"
exit 1
fi
# Non-standard shell tools we need
#! /usr/bin/env bash
# Skip all of this if we don't have a TTY
tty -s || return 0
# Colors + \[...\] wrapping to ensure there's no odd wrapping on command line
C_OFF="\[$(tput sgr0)\]"
C_BOLD="\[$(tput bold)\]"
C_BLACK="\[$(tput setaf 0)\]"
C_RED="\[$(tput setaf 1)\]"