Skip to content

Instantly share code, notes, and snippets.

View ivangonzalezg's full-sized avatar
🎯
Focusing

Iván González ivangonzalezg

🎯
Focusing
View GitHub Profile

Telegraf Technicolor Input Plugin

Telegraf plugin to collect up/down/status from Technicolor Cable Modems.

  1. Make sure Python dependencies are installed; pip install -r reqirements.txt
  2. Move telegraf-technicolor.py in /usr/local/bin or a suitable location to be executed.
  3. Make sure telegraf-technicolor.py is executable; chmod +x telegraf-technicolor.py
  4. Move input.technicolor.conf to /etc/telegraf/telegraf.d or Telegraf configuration location on your system. Adjust any settings, locations, etc. therein as needed, perhaps your measurement names.
  5. Kick Telegraf to reload configuration files.
@sarjarapu
sarjarapu / userDefinedRole-createRole.sh
Created May 16, 2018 14:42
A bash script with MongoDB commands to create a user-defined role and a user.
mongo social --port 28000 -u user -p password --authenticationDatabase admin <<EOF
db.createRole({
role: "readWriteMinusDropRole",
privileges: [
{
resource: { db: "social", collection: ""},
actions: [ "collStats", "dbHash", "dbStats", "find", "killCursors", "listIndexes", "listCollections", "convertToCapped", "createCollection", "createIndex", "dropIndex", "insert", "remove", "renameCollectionSameDB", "update"]} ],
roles: []
}
);
@JofArnold
JofArnold / Login.m
Last active October 26, 2022 13:31
Using promises in React Native modules with Swift
// Created by react-native-create-bridge
// import RCTBridgeModule
#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#elif __has_include(“RCTBridgeModule.h”)
#import “RCTBridgeModule.h”
#else
#import “React/RCTBridgeModule.h” // Required when used as a Pod in a Swift project
#endif
@deanhume
deanhume / clear-cache.js
Created September 20, 2017 08:22
Clear Service Worker Cache
if ('serviceWorker' in navigator) {
caches.keys().then(function(cacheNames) {
cacheNames.forEach(function(cacheName) {
caches.delete(cacheName);
});
});
}
@anthonyray
anthonyray / gist:398fde676a7704c03d6624155ba0011e
Last active May 6, 2024 06:15
Set up OhMyZsh on Amazon EC2 instance running Ubuntu Server 14.04
  1. Connect to your EC2 instance
  2. Install zsh : sudo apt-get update && sudo apt-get install zsh
  3. Edit your passwd configuration file to tell which shell to use for user ubuntu : sudo vim /etc/passwd
  4. Look for ubuntu user, and replace bin/bash by bin/zsh
  5. Install OhMyZsh : sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
  6. Disconnect from your instance and reconnect it.