This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import json | |
import os | |
import os.path | |
from glob import glob | |
basedir = "~/probds/lsh/logs/" | |
if len(sys.argv) > 1: | |
basedir = sys.argv[1] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update && sudo apt-get upgrade | |
sudo apt install git | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh | |
sudo usermod -aG docker [user_name] | |
sudo usermod -aG docker pi | |
docker version | |
docker info | |
docker run hello-world |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
mqtt: | |
image: eclipse-mosquitto:1.6 | |
ports: | |
- "1883" | |
volumes: | |
- "./mosquitto.conf:/mosquitto/config/mosquitto.conf" | |
- "./mosquitto_data:/mosquitto/data" | |
- "./mosquitto_logs:/mosquitto/log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import string | |
import os | |
import os.path | |
import subprocess | |
import sys | |
import json | |
import getpass | |
p = subprocess.Popen(['squeue', '-o', '%all'], stdout = subprocess.PIPE, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# sudo /usr/bin/python3 -m pip install termcolor | |
from termcolor import colored | |
import shutil | |
import sys | |
import logging | |
from canto_next.client import CantoClient | |
from canto_next.plugins import PluginHandler, Plugin, try_plugins, set_program # TODO cleanup | |
import json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var nodemailer = require('./src/nodemailer'); // note that i changed the path to fit my setup | |
var router = express.Router(); | |
router.get('/', renderJobsPage); | |
router.post('/', sendResume); | |
function renderJobsPage (req, res, next) { | |
res.send('<html><head></head><body><form action="/" method="post"><input type="email" name="email" id="email" /></form></body></html>'); | |
next(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var i18n = require('i18n-2'); | |
var app = express(); | |
var localeSetup = { | |
locales: ['en', 'es'], | |
defaultLocale: 'en' | |
} | |
var setNewLocaleFromQuery = function(req, res, next) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http_on_error = function http_on_error(context) { | |
return function(e) { | |
console.log("Got error: " + e.message); | |
context.done(e.message); // I need to pass-in the context variable | |
}; | |
}; | |
var http_on_success = function http_on_error(context) { | |
return function(e) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'), | |
util = require('util'), | |
EventEmitter = require('events').EventEmitter; | |
var ServerConnection = function() { | |
var socket, | |
receivedData = ''; | |
var connect = function connect(hostAddress, port) { | |
socket = net.connect({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fail2Ban configuration file | |
# Author: Frank Grimm | |
# see also: http://blog.thelifeofkenneth.com/2012/03/prowl-push-notifications-from-bash.html | |
[Definition] | |
# Option: actionstart | |
# Notes.: command executed once at the start of Fail2Ban. | |
# Values: CMD | |
# |