Skip to content

Instantly share code, notes, and snippets.

@marcbelmont
marcbelmont / spotify-ad-muter.user.js
Last active April 22, 2024 10:28
Spotify Ad Muter. Automatically mute (block) Spotify ads. Turn sound on again after the ad.
// ==UserScript==
// @name Spotify Ad Muter
// @version 1.2
// @namespace http://tampermonkey.net/
// @description Detects and blocks ads on Spotify. Automatically mute Spotify ads. Turn sound on again after the ad.
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.github.com/marcbelmont/1ea63270867a4e8786dd5f172d8d4489/raw
// @updateURL https://gist.github.com/marcbelmont/1ea63270867a4e8786dd5f172d8d4489/raw
@redmcg
redmcg / kubedf
Last active July 3, 2024 20:55
Bash script to show k8s PVC usage
#!/usr/bin/env bash
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
@rajeshsubhankar
rajeshsubhankar / sendRawTokenTransaction.js
Created March 28, 2019 17:03
Create and sends a raw ERC-20 token transaction with ether.js and Infura
const ethers = require('ethers');
const BigNumber = require('bignumber.js');
const provider = new ethers.providers.JsonRpcProvider('https://ropsten.infura.io/v2/INFURA_PROJECT_ID');
const addressFrom = 'SENDER_ADDRESS';
const privateKey = 'SENDER_PRIVATE_KEY';
const wallet = new ethers.Wallet(privateKey, provider);
const addressTo = 'RECEIVER_ADDRESS';
@florisvb
florisvb / install_ros_and_mac_cam.sh
Last active January 14, 2019 16:32
Install ROS and make mac camera available
#!/bin/sh
sudo apt-get update
sudo apt-get upgrade -y
# install ROS
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full -y
sudo rosdep init
rosdep update
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 22, 2024 13:05
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub