Skip to content

Instantly share code, notes, and snippets.

View CajuCLC's full-sized avatar
🌎
Anacardium occidentale

Eric Cavalcanti CajuCLC

🌎
Anacardium occidentale
View GitHub Profile
login to cps energy then go to this next url ---> https://secure.cpsenergy.com/mma/widgetDashBoard.jsp ---> ENERGY USE ( click it) ---> open developer tools, click the network section then click the circle with the slash thru it. its next to the red circle on the top left side
then change the year view to day view. look for a request with 'reads?' ignore 'hourly?'
right click it and copy it as a curl request.
within the url is the start date and end date, change them to whatever the billing period is on your cps bill
@sstratoti
sstratoti / baby_buddy.yaml
Created February 7, 2021 17:59
BabyBuddy Package
sensor:
- platform: rest
scan_interval: 15
name: BabyBuddy Feedings
resource: https://babybuddy.YOURDOMAIN.com/api/feedings/?limit=20
value_template: N/A
json_attributes:
- results
headers:
Authorization: !secret baby_buddy_token
import os
import json
import uuid
import boto3
from boto3.s3.transfer import TransferConfig
s3 = boto3.resource('s3')
# use a desktop user-agent string
#user-agent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/14.0.835.186 Safari/535.1"
# use a mobile user-agent string
#user-agent = "Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3"
# When following a redirect, automatically set the previous URL as referer.
#referer = ";auto"
referer = "http://domain.com"
@tamas-molnar
tamas-molnar / kubectl-shortcuts.sh
Last active June 19, 2024 14:10
aliases and shortcuts for kubectl
alias kc='kubectl'
alias kclf='kubectl logs --tail=200 -f'
alias kcgs='kubectl get service -o wide'
alias kcgd='kubectl get deployment -o wide'
alias kcgp='kubectl get pod -o wide'
alias kcgn='kubectl get node -o wide'
alias kcdp='kubectl describe pod'
alias kcds='kubectl describe service'
alias kcdd='kubectl describe deployment'
alias kcdf='kubectl delete -f'
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@AgentRev
AgentRev / fuck_win10_reboot.bat
Last active March 17, 2020 04:47
Shut the fuck up you stupid fucking Windows Update reboot shitfuck - run as admin
rem KILL WINDOWS UPDATE REBOOT WITH FIRE!!!
SET mwuo=Microsoft\Windows\UpdateOrchestrator
schtasks /End /TN "\%mwuo%\Reboot"
schtasks /End /TN "\%mwuo%\USO_UxBroker_Display"
schtasks /End /TN "\%mwuo%\USO_UxBroker_ReadyToReboot"
schtasks /Change /TN "\%mwuo%\Reboot" /DISABLE
schtasks /Change /TN "\%mwuo%\USO_UxBroker_Display" /DISABLE
schtasks /Change /TN "\%mwuo%\USO_UxBroker_ReadyToReboot" /DISABLE
icacls "%WINDIR%\System32\Tasks\%mwuo%\Reboot" /deny "*S-1-1-0:F"
icacls "%WINDIR%\System32\Tasks\%mwuo%\USO_UxBroker_Display" /deny "*S-1-1-0:F"
@TimoDJatomika
TimoDJatomika / unifiLedControllScript.sh
Last active December 17, 2021 08:44
Just a simple script to controll the led color of your ubiquiti unifi AP (PRO)
#!/bin/sh
# author: Timo Stankowitz <timo.stankowitz@gmail.com>
# create date: 2016-07-10
# last change: 2016-07-10
# with this script you can change the led color of your ubiquiti unifi AP
# usage: ./script.sh colorValue
# e.g.: ./script.sh 2
@tegansnyder
tegansnyder / debugging reindex locks mysql commands.md
Created December 2, 2014 23:57
Useful Mysql Commands for Debugging Magento Reindex Locks

Sometimes you may have a run away reindex process that aborted due to a MySQL connection error of some sorts. It may be useful to use the following MySQL commands to aid in debugging.

Determining if a lock exists

Magento Enterprise labels the reindex lock via the constant REINDEX_FULL_LOCK in app/code/core/Enterprise/Index/Model/Observer.php

SELECT IS_FREE_LOCK('mydatabase_name.reindex_full')

Returns 1 is specified lock is free and can be acquired, 0 if it’s in use, NULL if an error occurs.

Determing the thread that is holding the lock

@tegansnyder
tegansnyder / Magento-Indexing-Locks.md
Last active October 18, 2017 15:02
Magento EE Indexer Locks

Here is how we can see if we have MySQL locks due to indexing:

Display locks:
SELECT IS_USED_LOCK('db_name_here.reindex_full');
Releasing locks:
SELECT RELEASE_LOCK('db_name_here.reindex_full');