Skip to content

Instantly share code, notes, and snippets.

View jtcressy's full-sized avatar

Joel Cressy jtcressy

View GitHub Profile
@jtcressy
jtcressy / dashboard_sonos_soundboard.yaml
Created December 16, 2023 20:39
home assistant package - sonos soundboard
## Sonos Soundboard Machine - Use this file as a yaml dashboard, placed at <config-dir>/dashboards/sonos_soundboard.yaml
## NOTE: Requires mushroom cards and card-mod from HACS:
# https://github.com/piitaya/lovelace-mushroom
# https://github.com/thomasloven/lovelace-card-mod
title: Soundboard
views:
- icon: mdi:bullhorn
title: Soundboard
path: soundboard
type: panel
@jtcressy
jtcressy / README.md
Last active November 26, 2022 03:45
Automatic Imgur HypeVote Machine

AUTO HYPE VOTE

Steps to activate:

  1. Copy the entire contents of autohypevote.js below into your browser's JS console (hit F12 then go to Console)
  2. In the same console, type autohypevote(10) to give 50 hype votes to the next 10 posts automatically (adjust numbers as needed)
  3. If you need to get off this hype train, type stopthehype() at any time to regain control of your browser

Usage:

Keybase proof

I hereby claim:

  • I am jtcressy on github.
  • I am jtcressy (https://keybase.io/jtcressy) on keybase.
  • I have a public key ASDH4GGAnyRdM2qhqb4A_fhyQU5AhiXnQIUNO2rzVdHkQgo

To claim this, I am signing this object:

@jtcressy
jtcressy / draclcdupdater.py
Created May 19, 2018 12:26
Dell PowerEdge LCD Updater (via ipmitool)
"""
Dell LCD Updater v0.1
Required Packages: python-ipmi
Also requires that ipmitool be installed on your system
Set the user-defined LCD text of most Dell PowerEdge servers generation 9 and above
Maximum string length is 14 characters
Requires that ipmi over lan be enabled in the DRAC of your server
@jtcressy
jtcressy / snake.py
Last active November 26, 2022 03:45
Raspberry Pi SenseHat/Sense Emulator Snake Game
#!/usr/env/python3
"""
Snake.py by Joel Cressy
Run on a raspberry pi with attached senseHAT or python environment setup with a senseHAT emulator
"""
import asyncio
import time
from sense_hat import SenseHat
from sense_emu import SenseHat as SenseEmu
from signal import pause
@jtcressy
jtcressy / README.md
Last active February 21, 2017 06:51
Create new Git Repo using api key through bash scripting

Create a Remote Repository on GitHub using the GitHub API

Usage: $ ./create-github-repo.sh <REPO NAME> [private]

Required: Create this file: ~/.ssh/github_token and insert an API token from your github account into it.

You can go to https://github.com/settings/tokens to generate a new token

@jtcressy
jtcressy / codenvy_admin_hack.sql
Last active February 7, 2017 06:10
Very hacky workaround to make more admin users in codenvy onprem
INSERT INTO systempermissions(userid,id) VALUES((SELECT id FROM account WHERE name = 'user'),'id');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageSystem');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','setPermissions');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageUsers');
INSERT INTO systempermissions_actions(systempermissions_id,actions) VALUES('id','manageOrganizations');
@jtcressy
jtcressy / codenvy_logs
Created January 31, 2017 15:10
Logs from codenvy/codenvy container
Waiting for Postgres to boot...
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+------------+------------+-----------------------
dbcodenvy | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
public class Child {
public String name;
public boolean isSleeping;
public boolean isNice;
public Child() {
name = "None";
isSleeping = false;
isNice = true;
}
import java.util.*;
public class Santa {
private static int childCount = 100;
public static void main(String[] args) {
Child[] children = new Child[childCount];
for (int i = 0; i < childCount;i++){
children[i] = new Child();
}