Skip to content

Instantly share code, notes, and snippets.

@amagura
amagura / ticket.assign.js
Created January 4, 2017 20:26
self service script for Service Now
function self_service() {
document.getElementById('sys_display.change_task.assignment_group').value = 'BCS App Dev - Logan Jarrett';
document.getElementById('sys_display.change_task.assigned_to').value = 'Alexej Magura';
}
self_service();
@amagura
amagura / CHANGES syntax suggestion
Created November 9, 2016 22:07
Syntax I occasionally use in CHANGES and commits for describing what's different.
* Filename:
(A +): Added A.
(- A): Removed A.
(B +): Added B.
(B += foo): Added foo to B.
(B -= foo): Removed foo from B.
(foobar +- B): Replaced B with foobar.
(foobar): Modified foobar.
(C +): Added C.
@amagura
amagura / pkgbuild.sh
Created October 1, 2016 02:26
Installing Zsh on a server without root access
_prefix="$HOME/pre"
prepare() {
# set correct keymap path
# FIXME this may not work at RRD since their Linux servers aren't Arch Linux based
sed -i 's#/usr/share/keymaps#/usr/share/kbd/keymaps#g' Completion/Unix/Command/_loadkeys
# Fix usb.ids path
# FIXME I don't know if this is necessary/will even work at RRD
sed -i 's#/usr/share/misc/usb.ids#/usr/share/hwdata/usb.ids#g' Completion/Linux/Command/_lsusb
@amagura
amagura / screen.rb
Created January 20, 2015 04:56
Screen (latest version) - Homebrew
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# /usr/local/Library/Contributions/example-formula.rb
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class ScreenLatest < Formula
homepage 'http://www.gnu.org/software/screen'
url 'http://ftp.de.debian.org/debian/pool/main/s/screen/screen_4.1.0~20120320gitdb59704.orig.tar.gz'
sha1 '88e2f81c08326d4c435c59e7261739abca755c87'
@amagura
amagura / 99.h
Last active August 29, 2015 14:13
C Preprocessor - 99 bottles of beer song
#if 0
Recursive C Preprocessor 99 Bottles
by Alexej Magura
NOTE
run like so:
`cpp -Wp,-nostdinc,-w,-P 99.h'
or
`gcc -E -Wp,-nostdinc,-w,-P 99.h'
@amagura
amagura / 99.m4
Created January 10, 2015 13:58
M4 - 99 bottles of beer song
dnl GNU M4 - A macro language
dnl by Alexej Magura
divert(-1)
dnl Removes all the trailing newlines and
dnl prevents unnecessary usage of `dnl'
dnl (i.e. using `dnl' to remove trailing newlines)
dnl The `expand` macros are from Autoconf.
dnl Everything else is me.
@amagura
amagura / custom
Created May 7, 2014 22:50
Working FreeBSD Grub2 menuentry
menuentry "FreeBSD 10" {
insmod ufs2
insmod part_gpt
set root='(hd0,9)'
search --no-floppy --fs-uuid --set 5365af5267e6de53
kfreebsd /boot/kernel/kernel
kfreebsd_loadenv /boot/device.hints
set kFreeBSD.vfs.root.mountfrom=ufs:gpt/fbsd-rootfs
set kFreeBSD.vfs.root.mountfrom.options=rw
set kFreeBSD.hw.psm.synaptics_support='1'
@amagura
amagura / mongos.conf
Created March 26, 2014 16:32
mongos.conf - upstart job for Mongos Server
# /etc/init/mongos.conf
description "service file for mongos server"
author "Alexej Magura"
limit nofile 20000 20000
kill timeout 300 # wait 300s between SIGTERM and SIGKILL
expect daemon