Skip to content

Instantly share code, notes, and snippets.

🌵
Hello

Tyler Menezes tylermenezes

🌵
Hello
Block or report user

Report or block tylermenezes

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View az-nomad-get-token
#!/usr/bin/env bash
JWT=$(curl -s 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=http%3A%2F%2Fvault.srnd.cloud' -H Metadata:true | jq -r '.access_token')
META=$(curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2019-04-30")
SUBSCRIPTION_ID=$(echo $META | jq -r .compute.subscriptionId)
VM_NAME=$(echo $META | jq -r .compute.name)
RESOURCE_GROUP_NAME=$(echo $META | jq -r .compute.resourceGroupName)
JSON="{\"role\": \"nomad-server\", \"jwt\": \"$JWT\", \"subscription_id\": \"$SUBSCRIPTION_ID\", \"resource_group_name\": \"$RESOURCE_GROUP_NAME\", \"vm_name\": \"$VM_NAME\"}"
echo $JSON
@tylermenezes
tylermenezes / Sample.java
Created Jan 16, 2018
Java Callback Primer
View Sample.java
import java.util.*;
public class ExampleApp
{
public void Start()
{
ListenForUserJoin("tylermenezes");
}
public void ListenForUserJoin(String userToMonitor)
@tylermenezes
tylermenezes / videoserverd.config
Last active Jun 13, 2019
ivideon config format
View videoserverd.config
{
"account" : { // Optional
"email" : "...",
"password" : "...", // Need to use config client
"serverName" : "...", // e.g. Home, work, etc.
"uid" : "...", // Need to use config client
"uin" : 0 // Need to use config client
},
"archive" : {
"maxEventLogSize" : 10, // Max size of motion detection log, in MB
@tylermenezes
tylermenezes / esp8266_curtains.py
Created Sep 25, 2017
ESP8266 Curtain Controller for Home Assistant
View esp8266_curtains.py
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_UNKNOWN, CONF_NAME, CONF_FILENAME)
import homeassistant.helpers.config_validation as cv
import struct
import socket
DOMAIN = 'esp8266_curtains'
DEFAULT_NAME = 'Curtains'
@tylermenezes
tylermenezes / esp8266_blaster.py
Created Sep 25, 2017
ESP8266 IR Blaster Controller for Home Assistant
View esp8266_blaster.py
import voluptuous as vol
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_UNKNOWN, CONF_NAME, CONF_FILENAME)
import homeassistant.helpers.config_validation as cv
import struct
import socket
DOMAIN = 'esp8266_blaster'
DEFAULT_NAME = 'ESP8266'
@tylermenezes
tylermenezes / viewsonic.py
Created Sep 25, 2017
Viewsonic Projector Controller for Home Assistant
View viewsonic.py
import voluptuous as vol
import logging
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_UNKNOWN, CONF_NAME, CONF_FILENAME)
import homeassistant.helpers.config_validation as cv
import http.client
from base64 import b64encode
from time import time
@tylermenezes
tylermenezes / proxmox_vm.py
Last active Sep 25, 2017
Proxmox VM State Controller for Home Assistant
View proxmox_vm.py
import voluptuous as vol
import logging
from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (
STATE_ON, STATE_OFF, STATE_UNKNOWN, CONF_NAME, CONF_FILENAME)
import homeassistant.helpers.config_validation as cv
from base64 import b64encode
from time import time
import urllib.request
import urllib.parse
@tylermenezes
tylermenezes / powerline.css
Last active Feb 2, 2017
Modified version of Twily's Powerline for Firefox + Vimperator + Gruvbox
View powerline.css
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/*
Author: Twily/Tyler Menezes
Description: Minimal flat styled tabs, with modifications for Vimperator and Gruvbox
Compatibility: -- Firefox 43.0.4 --
Website: http://tyler.vc/
Useful search tags within this css:
@tylermenezes
tylermenezes / twig-ext.pp
Created Jan 22, 2016
Twig extension puppet rule
View twig-ext.pp
package { "php5-dev":
ensure => latest
}
exec { "create twig c extension":
command => "git clone git://github.com/twigphp/Twig.git;cd Twig/ext/twig;phpize;./configure;make;make install;cd ../../..;rm -rf Twig",
creates => "/usr/lib/php5/20121212/twig.so",
cwd => "/tmp",
path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ],
require => Package["php5-dev"],
notify => Service["php5-fpm"]
@tylermenezes
tylermenezes / censor.js
Last active Nov 19, 2015
Censor Web Text
View censor.js
$('td.name').each(function(){
var nameParts = $(this).text().split(' ');
var blockParts = $.map(nameParts, function(x){ return "".repeat(x.length); });
var newName = blockParts.join('    ');
$(this).html(newName);
}).css('letter-spacing', '-0.2em');
You can’t perform that action at this time.