Skip to content

Instantly share code, notes, and snippets.

@ciotlosm
ciotlosm / Readme.md
Last active February 5, 2024 15:04
Kiosk mode for lovelace

Kiosk mode

Installation

Add kiosk.js file with the content below to your www folder in config.

Like any other custom script, use ui-lovelace.yaml resources section to reference the kiosk.js file.

Make sure you add kiosk somewhere in your URL. You can use it in the id of your view or in the query string.

@hnakamur
hnakamur / vagrant-1.8.1-xenial.patch
Last active June 8, 2016 15:52
A patch to support predictable network interface names like enp0s25 on Ubuntu 16.04 with Vagrant 1.8.1
diff -ruN vagrant-1.8.1.orig/plugins/guests/debian/cap/configure_networks.rb vagrant-1.8.1/plugins/guests/debian/cap/configure_networks.rb
--- vagrant-1.8.1.orig/plugins/guests/debian/cap/configure_networks.rb 2015-12-25 06:30:19.000000000 +0900
+++ vagrant-1.8.1/plugins/guests/debian/cap/configure_networks.rb 2016-04-24 03:22:08.000000000 +0900
@@ -1,3 +1,4 @@
+require 'log4r'
require 'set'
require 'tempfile'
@@ -9,8 +10,22 @@
class ConfigureNetworks
@viranch
viranch / build-docker.sh
Last active February 4, 2016 18:34
Build dynamic docker 1.7.0
# stop
docker stop `docker ps -q`
sudo service docker stop
# dependencies
sudo apt-get remove -qy lxc-docker && sudo apt-get autoremove -qy
sudo apt-get install -qy libdevmapper-dev golang-gosqlite-dev uuid-dev btrfs-tools git gcc --no-install-recommends
# golang
curl -sSL https://golang.org/dl/go1.4.2.linux-amd64.tar.gz | sudo tar -C /usr/local -xz
@mzedeler
mzedeler / .bashrc_ssh
Last active March 11, 2020 19:02 — forked from bluegraybox/.bashrc_ssh
bashrc snippet for initializing ssh agent and adding ssh key
#!/bin/bash
# Set up ssh-agent
SSH_ENV="$HOME/.ssh/environment"
function start_agent {
echo "Initializing new SSH agent..."
touch $SSH_ENV
chmod 600 "${SSH_ENV}"
/usr/bin/ssh-agent | sed 's/^echo/#echo/' >> "${SSH_ENV}"
@markjaquith
markjaquith / nginx.conf
Last active December 25, 2022 15:55
My WordPress Nginx setup
upstream phpfpm {
server unix:/var/run/php5-fpm.sock;
}
upstream hhvm {
server unix:/var/run/hhvm/hhvm.sock;
}
# SSL
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
@keo
keo / bootstrap.sh
Last active January 25, 2024 15:49
Setup encrypted partition for Docker containers
#!/bin/sh
# Setup encrypted disk image
# For Ubuntu 14.04 LTS
CRYPTFS_ROOT=/cryptfs
apt-get update
apt-get -y upgrade
apt-get -y install cryptsetup
@jclement
jclement / tarsnap_with_pushover.py
Last active August 6, 2021 03:37
Quick and lazy script to backup data via Tarsnap, automatically prune old backups, and push errors / success to devices via Pushover.
#!/usr/bin/env python
import httplib, urllib
import subprocess
import time
import socket
# Configuration #########################################################
BACKUP_PREFIX=socket.gethostname() + "_"
MAX_BACKUPS=30
@corsonr
corsonr / gist:9152652
Last active January 19, 2023 22:41
WooCommerce : add custom fields to product variations
<?php
//Display Fields
add_action( 'woocommerce_product_after_variable_attributes', 'variable_fields', 10, 3 );
//JS to add fields for new variations
add_action( 'woocommerce_product_after_variable_attributes_js', 'variable_fields_js' );
//Save variation fields
add_action( 'woocommerce_process_product_meta_variable', 'save_variable_fields', 10, 1 );
/**
@swarminglogic
swarminglogic / watchfile.sh
Last active March 4, 2024 14:44
watchfile - monitor file(s) and execute a command when files are changed
#!/bin/bash
version=1.0.1
versionDate="2014-02-14"
function showHelp() {
echo "watchfile - monitor file(s)/command and perform action when changed
Possible ways of usage
----------------------------------------
@ehuynh
ehuynh / .gitignore
Last active October 1, 2015 18:08
gitignore for xcode project
# Exclude the build directory
build/*
# Exclude temp nibs and swap files
*~.nib
*.swp
# Exclude OS X folder attributes
.DS_Store