Skip to content

Instantly share code, notes, and snippets.

@eklex
eklex / 80-mount-usb-to-media-by-label.rules
Last active May 17, 2022
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
View 80-mount-usb-to-media-by-label.rules
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@fffonion
fffonion / setup-dashbutton.py
Created Sep 28, 2019
Setting up dash button without Amazon App
View setup-dashbutton.py
import requests
import re
import sys
# Initial work from: https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/
h = requests.Session()
BASE_URL = "http://192.168.0.1"
@zregvart
zregvart / README.md
Last active Jan 8, 2018
How I work on UI locally
View README.md

Steps:

  1. Start PostgreSQL from docker

    $ docker run -d --rm -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password -e POSTGRES_DB=syndesis postgres
    
  2. Start Syndesis backend (I run io.syndesis.runtime.Application from IDE), with JVM options:

     -Dendpoints.test_support.enabled=true -Ddeployment.load-demo-data=false -Dencrypt.key=hello
    
  3. Start tinyproxy from a directory that has tinyproxy.conf (below)

@ldez
ldez / gmail-github-filters.md
Last active Jun 27, 2022
Gmail and GitHub - Filters
View gmail-github-filters.md

Gmail and GitHub

Create new filters and create new labels.

Pull Request

label: gh-pull-request

since 2021-10-11

@vbatts
vbatts / README.md
Last active Jan 27, 2018
🙏 📎 Emoji that checksum! 🎉 💩
View README.md

emojisum

🙏 📎 Emoji that checksum! 🎉 💩

I attempted a curated list of 256 emojis that are not entirely similar. Using http://www.webpagefx.com/tools/emoji-cheat-sheet/ to compare them. I went with 256 as that is 8bit/1byte, and the hexadecimal output that is 2 hex characters.

So 1 emoji is 2 hex positions.

new home

@ruario
ruario / intro-latest-widevine.md
Last active Jul 2, 2022
Fetches the latest Linux Widevine binary so that it can be used by Vivaldi.
View intro-latest-widevine.md

With the release of Vivaldi 2.2, this page is now obsolete and unmaintained. Widevine is fetched automatically on post install of our official packages. The information below and the script are left for historical reasons but will not be updated.

If you are using something newer than Vivaldi 2.2, you should not be using this script as there is simply no need. Any need you think you have for it would be a bug IMHO and thus should be logged in a bug report. Before you do so however, you should also checkout the Vivaldi help page on Widevine, on Linux


Summary

A bunch of people asked how they could use this script with pure Chromium on Ubuntu. The following is a quick guide. Though I still suggest you at least try Vivaldi. Who knows, you might like it. Worried about proprietary componants? Remember that libwidevinecdm.so is a b

@astanush
astanush / gmail-filter-google-cal.md
Last active Oct 12, 2018
Gmail filter - Google Calendar notifications
View gmail-filter-google-cal.md

Google Calendar notifications

Create a Gmail filter that will find all Google Calendar-related emails. I use it to apply a label to the emails so I can go and bulk delete them later.

(("invitation" OR "updated invitation" OR "declined" OR "canceled event") AND (-collaborate OR -"invitation to edit")) AND (has:attachment)

Notes

View add-user-from-github.sh
#!/bin/bash
for user in "$@"
do
echo "Adding ${user}"
useradd -m ${user}
mkdir /home/${user}/.ssh
curl https://github.com/${user}.keys >> /home/${user}/.ssh/authorized_keys
chmod 700 /home/${user}/.ssh
chmod 600 /home/${user}/.ssh/authorized_keys
@awood
awood / hush.py
Last active Aug 29, 2015
An XChat plugin to mimic WeeChat's "smart filter" by hiding join, part, and quit messages from inactive users.
View hush.py
#! /usr/bin/env python
# Copyright 2014 Alex Wood
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@Integralist
Integralist / GitHub curl.sh
Last active Jun 26, 2022 — forked from madrobby/gist:9476733
Download a single file from a private GitHub repo. You'll need an access token as described in this GitHub Help article: https://help.github.com/articles/creating-an-access-token-for-command-line-use
View GitHub curl.sh
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \
--header 'Accept: application/vnd.github.v3.raw' \
--remote-name \
--location https://api.github.com/repos/owner/repo/contents/path
# Example...
TOKEN="INSERTACCESSTOKENHERE"
OWNER="BBC-News"
REPO="responsive-news"