This file contains 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
# main config | |
libdir = /usr/share/mcollective/plugins | |
logfile = /var/log/mcollective.log | |
daemonize = 1 | |
keeplogs = 1 | |
max_log_size = 10240 | |
loglevel = debug | |
identity = my_laptop | |
registerinterval = 300 |
This file contains 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
## Configure eth0 | |
# | |
# vi /etc/sysconfig/network-scripts/ifcfg-eth0 | |
DEVICE="eth0" | |
NM_CONTROLLED="yes" | |
ONBOOT=yes | |
HWADDR=A4:BA:DB:37:F1:04 | |
TYPE=Ethernet | |
BOOTPROTO=static |
This file contains 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/python | |
# https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html#//apple_ref/doc/uid/20000391-BCIEBDGB | |
# https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html | |
# https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSScreen_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSScreen | |
from AppKit import NSWorkspace, NSScreen | |
from AppKit import NSWorkspaceDesktopImageScalingKey | |
from AppKit import NSImageScaleProportionallyUpOrDown | |
from AppKit import NSWorkspaceDesktopImageAllowClippingKey |
This file contains 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
from time import strftime,gmtime,time | |
import urllib2 | |
import hmac | |
import hashlib | |
import base64 | |
import string | |
def publishAmazonSnsMsg(Subject,TopicArn,Message,AWSAccessKeyId,privatekey): | |
#http://docs.amazonwebservices.com/AWSSimpleQueueService/2008-01-01/SQSDeveloperGuide/ | |
amzsnshost = 'sns.us-east-1.amazonaws.com' |
This file contains 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/python | |
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens. | |
Tested on Mountain Lion and Mavericks. | |
See: | |
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html | |
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html |
This file contains 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
from ctypes import CDLL, sizeof, memset, c_uint32, create_string_buffer | |
MAXPATHLEN = 1024 | |
PROC_PIDPATHINFO_MAXSIZE = MAXPATHLEN*4 | |
PROC_ALL_PIDS = 1 | |
libc = CDLL('libc.dylib') | |
def get_pids(): | |
number_of_pids = libc.proc_listpids(PROC_ALL_PIDS, 0, None, 0) | |
pid_list = (c_uint32 * (number_of_pids * 2))() |
This file contains 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
#!/bin/bash | |
# Dashing service | |
# Add this file to /etc/init.d/ | |
# $ sudo cp dashboard /etc/init.d/ | |
# Update variables DASHING_DIR, GEM_HOME, & PATH to suit your installation | |
# $ sudo nano /etc/init.d/dashboard | |
# Make executable | |
# $ sudo chmod 755 /etc/init.d/dashboard | |
# Update rc.d | |
# $ sudo update-rc.d dashboard defaults |
This file contains 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
host = Host.new(:name => "whatever", :environment => Environment.first) | |
host.save | |
osfamily_fact = FactValue.new(:value => "windows", :fact_name => FactName.find_by_name('osfamily'), :host => host) | |
osfamily_fact.save |
This file contains 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
# cocoa_keypress_monitor.py by Bjarte Johansen is licensed under a | |
# License: http://ljos.mit-license.org/ | |
from AppKit import NSApplication, NSApp | |
from Foundation import NSObject, NSLog | |
from Cocoa import NSEvent, NSKeyDownMask | |
from PyObjCTools import AppHelper | |
class AppDelegate(NSObject): | |
def applicationDidFinishLaunching_(self, notification): |
This file contains 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
H | |
g/-Wl,-search_paths_first/d | |
g/ -lSystemStubs -arch_only [^"]*/s/// | |
g/-current_version $(VERSION)/s//-current_version $(PYTHON_CURRENT_VERSION)/ | |
g/-O3/s//-Os/g | |
/^OTHER_LIBTOOL_OPT$/i | |
EXTRA_CFLAGS | |
LIBTOOL | |
. | |
/# Calculate the right deployment target for this build\./i |
OlderNewer