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
| Damians-Mac:~ damian$ hdid xcode46cltools_10_86938131a.dmg | |
| /dev/disk2 Apple_partition_scheme | |
| /dev/disk2s1 Apple_partition_map | |
| /dev/disk2s2 Apple_HFS /Volumes/Command Line Tools (Lion) | |
| Damians-Mac:~ damian$ sudo installer -pkg /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)/Command\ Line\ Tools\ \(Mountain\ Lion\).mpkg -target / | |
| Damians-Mac:~ damian$ umount /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\) |
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
| # Assumes the following: | |
| # Hostname: TEST1 | |
| # Domain: EXAMPLE.COM (you probably don't want to use your public domain for your AD domain... but that's out of scope for this example) | |
| # Admin user: setupuser | |
| # Admin pass: He11oW0rld! | |
| # Machine will go into the default computers ou (root) | |
| # Domain admins will get local admin rights on login | |
| # All users will get mobile accounts (offline login) | |
| # All data will be stored locally (no UNC home dir) | |
| # Default shell will be bash |
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
| {'cpu': [{'manufacturer': 'GenuineIntel', | |
| 'model': 'Intel(R) Core(TM) i7-3610QM CPU @ 2.30GHz'}], | |
| 'drives': [{'identifer': 'disk0', | |
| 'model': 'VMware Virtual S', | |
| 'size': 681574400, | |
| 'vendor': 'VMware,'}], | |
| 'interfaces': {'identifer': 'en0', 'mac-address': 'xx:xx:xx:xx:xx:x'}, | |
| 'manufacturer': 'Mac', | |
| 'memory': [{'manufacturer': 'VMware Virtual RAM', | |
| 'serial': '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
| import urllib | |
| import urllib2 | |
| from BeautifulSoup import BeautifulSoup | |
| url = 'http://support.lenovo.com/templatedata/Web%20Content/JSP/' \ | |
| 'warrantyLookup.jsp' | |
| data = urllib.urlencode({'sysSerial' : 'xxxxxx'}) | |
| req = urllib2.Request(url, data) | |
| response = urllib2.urlopen(req) |
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
| # Drop into content/_plugins/pagination.rb | |
| # Outputs pages into /1/ /2/ /3/ /4/ etc | |
| module Jekyll | |
| module Generators | |
| class Pager < Pager | |
| def self.paginate_path(site_config, num_page) | |
| return nil if num_page.nil? || num_page <= 1 | |
| "/%d" % num_page | |
| end | |
| end |
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
| <?php | |
| // Cloudflare settings | |
| $CF_API_TOKEN = ""; | |
| $CF_ZONE = ""; | |
| $CF_EMAIL = ""; | |
| // API key | |
| $AUTHORIZATION_KEY = ""; |
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
| You can switch multiple relays on the same was as single relays – it’s just a different value passed. | |
| If you think of the relays as 1, 2, 4, 8 then it makes sense. Passing these values directly will turn on the relays singularly, something like | |
| for relay in [1, 2, 4, 8]: | |
| bus.write_byte_data(0×20,0×09,relay) | |
| time.sleep(1) | |
| will step though all the relays (this is what the test_relays script does). | |
| If you want to switch multiple relays on, add the numbers together and use that. For example: |
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
| ''' | |
| Very simple OpenStack Nova notifier to create/delete PowerDNS records for instances on creation/deletion. | |
| Format of records is %(instance)s.%(project_name).example.com. | |
| To use: | |
| * Install this in a python path (site-packages is easiest) | |
| * Configure nova using notification_driver=examplenotifier | |
| ''' | |
| import MySQLdb |
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
| Set check_external_commands=1 in /etc/icinga/icinga.cfg | |
| apt-get install snmpd snmptt | |
| cat > /etc/init.d/snmptrapd <<'EOF' | |
| #! /bin/sh -e | |
| ### BEGIN INIT INFO | |
| # Provides: snmptrapd | |
| # Required-Start: $network $remote_fs $syslog | |
| # Required-Stop: $network $remote_fs $syslog |
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
| /* This file lives @ ~/.js/youtube.com.js | |
| * Requires: https://github.com/defunkt/dotjs | |
| */ | |
| /* Make it not stick the header to the top of the window */ | |
| $('#masthead-positioner').css('position', 'static'); |