Skip to content

Instantly share code, notes, and snippets.

View unicolet's full-sized avatar

Umberto Nicoletti unicolet

View GitHub Profile
@unicolet
unicolet / desktoplinksmanager.vbs
Last active December 10, 2015 00:38
Have you ever wanted to be able to manage desktop links by simply setting group membership in Active Directory? With this login script now you can. My second Christmas gift for all sysadmins out there!
Set FSO = CreateObject("scripting.filesystemobject")
Set objShell = WScript.CreateObject("WScript.Shell")
strDesktop = objShell.SpecialFolders("Desktop")
' Could you believe this is a comment? I know, vbs sucks
'
' The following is a dictionary of dictionaries.
' The first dictionary is keyed by group name (case sensitive!)
' while the second holds the attributes for the link to be created.
' With the example cfg below the script will create a link on the desktop
@unicolet
unicolet / collectd.conf
Last active December 11, 2015 05:59
Configuration for collectd to tail a log file and trigger an OpenNMS UEI whenever a certain pattern occurs. http://unicolet.blogspot.it/2013/01/triggering-opennms-notifications-when.html
Interval 10
LoadPlugin logfile
#LoadPlugin write_graphite
LoadPlugin csv
LoadPlugin threshold
LoadPlugin exec
LoadPlugin tail
<Plugin "logfile">
/********************
Core.js
********************/
MyApp = SC.Application.create(
/** @scope MyApp.prototype */ {
NAMESPACE: 'MyApp',
VERSION: '0.1.0',
store: SC.Store.create().from(SC.Record.fixtures)
@unicolet
unicolet / CheckableListItemView.js
Created February 10, 2013 09:27
Add action support on checkbox click
MyApp.CheckableListItemView = SC.ListItemView.extend({
/** @private in SC.ListItemView
*
* Overridden here to handle events on checkbox
*/
mouseUp: function(evt) {
var ret = sc_super();
// check event was on checkbox
if(this._isInsideCheckbox(evt)) {
var pane = this.get('pane'),
{
"name": "Mappu Backend",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node app"
},
"dependencies": {
"express": "3.1.0",
"jade": "*",
@unicolet
unicolet / auth.js
Last active December 14, 2015 02:39
An authorization module for Express.
var minimatch = require("minimatch");
var url=require('url');
/*
Example usage:
app.use(auth(
true, // disable access by default
[
{path:"/j_security_check", roles:["EVERYONE"]},
<!doctype html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="robots" content="index,follow" />
<meta name="language" content="it" />
<meta http-equiv='pragma' content='no-cache' />
<meta http-equiv='expires' content='0' />
<meta http-equiv='cache-control' content='no-cache' />
<meta http-equiv="cache-control" content="must-revalidate" />
@unicolet
unicolet / zfs_report.sh
Last active July 26, 2018 17:08 — forked from cypres/zfs_report.sh
ZFS On Linux Version. Note that drive health is not reported since I am running ZFS on a VM
#!/bin/sh
echo "ZFS listing:"
/sbin/zfs list
echo
echo "ZFS compression ratio:"
/sbin/zfs get compressratio | /bin/grep -v @
echo
----------
State: - pkgrepo
Name: pgdg-92-centos
Function: managed
Result: False
Comment: Failed to confirm config of repo pgdg-92-centos: coercing to Unicode: need string or buffer, NoneType found
Changes:
@unicolet
unicolet / capsd-configuration.xml
Last active December 17, 2015 11:18
OpenNMS configuration to monitor user tablespace quota usage in an Oracle database
<protocol-plugin protocol="OracleMonitoring" class-name="org.opennms.netmgt.capsd.plugins.JDBCPlugin" scan="on">
<property key="driver" value="oracle.jdbc.driver.OracleDriver"/>
<property key="user" value="opennms"/>
<property key="password" value="opennms"/>
<property key="url" value="jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=OPENNMS_JDBC_HOSTNAME)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=orcl)))"/>
<property key="retry" value="1"/>
</protocol-plugin>