Skip to content

Instantly share code, notes, and snippets.

@vena
vena / chroot_local-hooks..setup.chroot
Created February 10, 2012 06:12
media server live-build
#!/bin/sh
# Install into config/chroot_local-hooks
# chmod +x
export bold=`tput bold`
export normal=`tput sgr0`
echo "----------------------------------------------------------"
echo "----------------------------------------------------------"
echo "\n"
@vena
vena / auto_smb
Created February 21, 2012 06:16
[OS X 10.7] autofs executable map to mount all SMB shared from a given server
#!/bin/bash
#####################################
# Save this to /etc/auto_smb
# Set execution bit with chmod +x /etc/auto_smb
# Add this in /etc/auto_master as:
# /mountpoint auto_smb
#
# Create .smb_credentials file in user home dir
# format:
# username=[username]
@vena
vena / mount-greyhole
Created June 2, 2012 01:29
[Greyhole] Upstart tools for mounting shares locally at startup
#!/bin/sh
# Mounts available greyhole shares locally
# - Depends on "greyhole" in comment property for SMB share definition
# - Depends on .smb_credentials file in defined MGS_USER's home dir
# Default environment
[ -z "$MGS_USER" ] && MGS_USER=`id -u`
[ -z "$MGS_GROUP" ] && MGS_GROUP=`id -g`
[ -z "$MGS_ROOT" ] && MGS_ROOT=`pwd`
[ -z "$MGS_FILE_MODE" ] && MGS_FILE_MODE="0744"
@vena
vena / gist:2856490
Created June 2, 2012 03:57
Netatalk 3.0 beta installation procedure (Ubuntu 12.04)

Install prerequisites:

$ sudo apt-get install build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev

Download src:

$ cd /usr/local/src
$ git clone git://netatalk.git.sourceforge.net/gitroot/netatalk/netatalk
$ cd netatalk

$ ./bootstrap

@vena
vena / gatekeeper
Last active January 14, 2017 18:07
easy dis/enabling gatekeeper in macOS 10.12. a tiny script i put in /usr/local/bin, filename "gatekeeper" so i don't have to remember spctl, just "gatekeeper on" and "gatekeeper off"
#!/bin/bash
# Allows easily dis/enabling gatekeeper
# Place in /usr/local/bin/ for easy-access,
# don't forget to chmod +x
case "$1" in
on)
sudo spctl --master-enable
sleep 0.25
sudo spctl --status

Keybase proof

I hereby claim:

  • I am vena on github.
  • I am vena (https://keybase.io/vena) on keybase.
  • I have a public key ASBxpVI-kZ4cBsHdtft-bZNv-oX2rBi30mZ5QkJNHQMa1Qo

To claim this, I am signing this object:

@vena
vena / dhcp-client
Created July 8, 2019 21:28
Mikrotik scripts
{
# dhcp-client lease script
# Updates Namecheap DDNS
do {
:if ($bound=1) do={
:local ddnsURI "https://dynamicdns.park-your-domain.com/update"
:local ddnsHostname "myhostname"
:local ddnsDomain "mydomain.com"
:local ddnsPassword "REPLACE WITH NAMECHEAP DDNS PASSWORD"
# Delay to allow for new route to be established
media_player:
- platform: media_player_template
media_players:
living_room_tv:
friendly_name: Living Room TV!
device_class: tv
value_template: "{{ states('remote.living_room_tv') }}"
current_source_template: "{{ states('select.living_room_tv_activities') }}"
title_template: >
{% if is_state_attr('media_player.living_room_firetv', 'app_id', 'com.plexapp.android') %}
PLUGIN_NAME = "Remaster Variables"
PLUGIN_AUTHOR = "Daniel Vena"
PLUGIN_DESCRIPTION = "Sets _album_is_remaster and _album_remaster_info variables if an album has a remaster relationship"
PLUGIN_VERSION = "0.1"
PLUGIN_API_VERSIONS = ["2.2"]
from datetime import datetime
from picard import config, log
from picard.metadata import register_album_metadata_processor