Skip to content

Instantly share code, notes, and snippets.

View demonbane's full-sized avatar

Alex Malinovich demonbane

View GitHub Profile
alexmalinovich@Shrike:~$ echo role[webserver]
role[webserver]
alexmalinovich@Shrike:~$ touch rolev
alexmalinovich@Shrike:~$ echo role[webserver]
rolev
alexmalinovich@Shrike:~$ echo 'role[webserver]'
role[webserver]
alexmalinovich@Shrike:~$ touch roler
alexmalinovich@Shrike:~$ echo role[webserver]
roler rolev
@demonbane
demonbane / gist:942965
Created April 26, 2011 19:44 — forked from schacon/gist:942899
delete all remote branches that have already been merged into master
$ git branch -r --merged |
awk -F"/" '!/(>|master)/ {print $2}' |
xargs -L1 git push origin --delete
@demonbane
demonbane / makeapp.sh
Created July 5, 2011 20:05
Create a Fluid-style app launcher for single-window Chrome instances on OSX
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"
UTQHPRlnHHOi+dTtbMSkQWaprnPKUKfizoPJnvBGg9Omeqkppp5Ydg==

Keybase proof

I hereby claim:

  • I am demonbane on github.
  • I am demonbane (https://keybase.io/demonbane) on keybase.
  • I have a public key whose fingerprint is 9584 D5C6 0538 9579 552A 2368 9EA1 AAC6 985B 9388

To claim this, I am signing this object:

~# foo='one
> two
> three'
~# hd <<< $foo
00000000 6f 6e 65 20 74 77 6f 20 74 68 72 65 65 0a |one two three.|
0000000e
~# hd <<< "$foo"
00000000 6f 6e 65 0a 74 77 6f 0a 74 68 72 65 65 0a |one.two.three.|
0000000e
~# bash --version
@demonbane
demonbane / CentOS 7
Last active April 20, 2018 02:12
/etc/os-release for CentOS/Debian/Fedora/OpenSUSE/RHEL/SLES/Ubuntu
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

This is a simple proof of concept for doing Ombi updates live. The requirements to use this are:

  • You must have Ombi already installed and it must be running (obviously, since Ombi kicks off the update)
  • You must be using systemd to manage Ombi
  • The user that Ombi runs as must have permissions to run systemctl restart
    • Use visudo to edit your sudoers and add a line like:
      ombiuser ALL=NOPASSWD: /bin/systemctl restart ombi.service
      

Where ombiuser is the user Ombi runs as. You should also sanity check your system to make sure that systemctl is at /bin/systemctl and that your Ombi unti file is called ombi.service.

@demonbane
demonbane / workflow-build.py
Created August 26, 2018 01:49 — forked from deanishe/workflow-build.py
Build Alfred Workflows into .alfredworkflow (zip) files
#!/usr/bin/python
# encoding: utf-8
#
# Copyright (c) 2013 deanishe@deanishe.net.
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2013-11-01
#
~\Downloads> gpg --keyserver pgp.mit.edu --keyserver-options auto-key-retrieve --verify gpg4win-3.1.3.exe.sig
gpg: assuming signed data in 'gpg4win-3.1.3.exe'
gpg: Signature made 08/31/18 05:18:49 Pacific Daylight Time
gpg: using RSA key 42D876082688DA1A
gpg: requesting key 42D876082688DA1A from hkp server pgp.mit.edu
gpg: key 42D876082688DA1A: 80 signatures not checked due to missing keys
gpg: key 42D876082688DA1A: public key "Intevation File Distribution Key <distribution-key@intevation.de>" imported
gpg: marginals needed: 3 completes needed: 1 trust model: pgp
gpg: depth: 0 valid: 1 signed: 2 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 2 signed: 0 trust: 0-, 0q, 0n, 0m, 2f, 0u