Skip to content

Instantly share code, notes, and snippets.

@strarsis
strarsis / .bashrc
Created Mar 16, 2018
Vagrant on WSL (Bash on Windows)
View .bashrc
# Vagrant
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
export PATH=$PATH:/mnt/c/Program\ Files/Oracle/VirtualBox
export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/Users/<Windows Username>"
@giovtorres
giovtorres / slurm_sched_stats.py
Last active Apr 3, 2020
Graph Slurm's sdiag with PySlurm and Graphite
View slurm_sched_stats.py
#!/usr/bin/python
# vim: set ts=4 sw=4 et
"""
slurm_sched_stats.py
A script that uses PySlurm to get the slurm scheduler statistics.
"""
import pickle
import socket
View human_log.py
# This gist is compatible with Ansible 1.x .
# For Ansible 2.x , please check out:
# - https://gist.github.com/dmsimard/cd706de198c85a8255f6
# - https://github.com/n0ts/ansible-human_log
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
@elmarcoh
elmarcoh / table_init.js
Created Oct 26, 2012
Using Tastypie as an Ajax Source for DataTables
View table_init.js
$('#participantes-table').dataTable({
bProcessing: true,
bServerSIde: true,
sAjaxSource: "/path/to/your/tastypie/api/list/objects/?format=json",
sAjaxDataProp: "objects",
aoColumns: [
// Put the resource name that corresponds to each table column
{'mData': "your"},
{'mData': "columns"},
],
@superdaigo
superdaigo / zabbix-alert-smtp.sh
Created Sep 20, 2012
Zabbix SMTP Alert script for gmail
View zabbix-alert-smtp.sh
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Zabbix SMTP Alert script for gmail.
"""
import sys
import smtplib
from email.MIMEText import MIMEText
from email.Header import Header