Skip to content

Instantly share code, notes, and snippets.

View MaxMansfield's full-sized avatar

Max Mansfield MaxMansfield

  • Developer Advocate @zoom
  • Colorado
View GitHub Profile
@MaxMansfield
MaxMansfield / dailyword.sh
Created September 24, 2018 22:00
Word Of the Day Oneliner
curl -s https://raw.githubusercontent.com/adambom/dictionary/master/dictionary.json | jq '' | shuf -n1 | awk -F":" '{gsub(/"/, "", $0);gsub(/,$/, "", $0); print $1, $2}' | read word definition; notify-send -i "notification-message-email" "$word" "$definition"
@MaxMansfield
MaxMansfield / update.sh
Last active September 5, 2018 00:31
Whilte it's not recommended to automatically update pacman via a cron job....here's a script to do just that
#!/bin/bash
trap killed HUP INT QUIT PIPE TERM
LOGFILE=/var/log/cron/update.log
log()
{
echo "[$(date '+%D %T')] $1"
}
@MaxMansfield
MaxMansfield / scan.sh
Created February 5, 2018 09:38
Scan - meant for /etc/cron.daily and uses maldet and rkhunter to look for malware
#!/bin/bash
name=$(basename "$0")
path="$( cd "$(dirname "$0")" ; pwd -P )"
scandir=/
log=/var/log/cron/$name.log
{
echo "[$(date '+%D %T')] $name Running from $path"
maldet -u
@MaxMansfield
MaxMansfield / freshlist.sh
Last active February 4, 2018 08:41
A script meant for /etc/cron.daily that will refresh your pacman mirrorlist and revert if errors are detected and then update
#!/bin/bash
#### freshlist
## This script refreshes the pacman mirrorlist with testing and reversion
## Contributors: Max Mansfield <max@bytewise.co>
####
# the name and path of the current script
name=$(basename "$0")
@MaxMansfield
MaxMansfield / Dockerfile
Created February 21, 2017 21:17
A simple Dockerfile to setup an archlinux/golang development environment
FROM finalduty/archlinux
MAINTAINER Max Mansfield <max.m.mansfield@gmail.com>
# root password
RUN echo "root:toor" | chpasswd
# Setup pacman with fastest US mirrors
RUN curl 'https://www.archlinux.org/mirrorlist/?country=US&protocol=http&protocol=https&ip_version=4' > /etc/pacman.d/mirrorlist.new
RUN sed -i 's/^#Server/Server/' /etc/pacman.d/mirrorlist.new
RUN rankmirrors -n 6 /etc/pacman.d/mirrorlist.new > /etc/pacman.d/mirrorlist
@MaxMansfield
MaxMansfield / main.c
Last active September 29, 2016 21:23
Reverse stdin
/**
* A program that reverses what it is found in STDIN by line with -l (default) or by word with -w given
* as a command line argument
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
@MaxMansfield
MaxMansfield / Makefile
Last active February 20, 2017 09:05
A simple makefile template for go projects
# A simple makefile template for use with Webstorm Templates on golang projects
NAME=$(notdir $(shell pwd))
VERSION=0.1.0
BUILD_TIME=$(shell date +%FT%T%z)
GITHUB_NAME=$(shell git config --list|grep -e "user.name="|cut -c 11-|tr -d ' ')
BUILD_DEBUG=debug
@MaxMansfield
MaxMansfield / KSP64.log
Last active May 2, 2016 02:48
Kerbal Space Program x86_64 log output
Kerbal Space Program - 1.1.2.1260 (LinuxPlayer)
OS: Linux 4.5 Arch rolling 64bit
CPU: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz (8)
RAM: 7863
GPU: Mesa DRI Intel(R) Ivybridge Mobile (1536MB)
SM: 30 (OpenGL 3.0 [3.0 Mesa 11.2.1])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8
@MaxMansfield
MaxMansfield / KSP64_direct.log
Created May 2, 2016 02:43
Kerbal Space Program x86_64 -force-glx-direct log output
Kerbal Space Program - 1.1.2.1260 (LinuxPlayer)
OS: Linux 4.5 Arch rolling 64bit
CPU: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz (8)
RAM: 7863
GPU: Mesa DRI Intel(R) Ivybridge Mobile (1536MB)
SM: 30 (OpenGL 3.0 [3.0 Mesa 11.2.1])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Default, ARGB2101010, DefaultHDR, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8
@MaxMansfield
MaxMansfield / PKGBUILD - Upwork 4.0.103.0
Created August 11, 2015 09:24
This is the updated PKGBUILD for upwork version 4.0.103.0 since the maintainer hasn't updated it yet.
# Maintainer: Lev Lybin <lev.lybin@gmail.com>
pkgname=upwork
pkgver=4.0.103.0
pkgrel=3
pkgdesc="Team App (ex. oDesk)"
arch=('i686' 'x86_64')
url="https://www.upwork.com/downloads/new-team-application"
license=('unknown')
depends=('gtk2' 'nss' 'gconf' 'alsa-lib' 'glu' 'libxtst' 'gtkglext' 'libgcrypt15' 'libudev0')