| Assignment | |
|---|---|
Assign value to variable if variable is not already set, value is returned.Combine with a : no-op to discard/ignore return value. |
${variable="value"}: ${variable="value"} |
| # Thanks to http://ubuntuforums.org/showthread.php?t=1411273 for inspiration.. | |
| # But what a disgusting nasty hack! This prevents partman from running (and | |
| # mounts /target, creates /target/etc/fstab). d-i just can't cope with | |
| # installation to partitionless block device... which is disappointing, | |
| # because partitions are pointless for pvlinux guests. | |
| # | |
| # The hack works by ... wait for it... spawning a little while/sleep 1 script, | |
| # waits for the partman-base.postinst file to appear (the preseed/earl_command | |
| # hook is too early, and the partman/early_command is too late). Once it | |
| # appears we replace this with a bit more script which does what we wanted |
| Locality-based Least connection scheduling module for nginx. | |
| Based on logic[1] from IPVS lblc module. | |
| [1] http://kb.linuxvirtualserver.org/wiki/Locality-Based_Least-Connection_Scheduling | |
| Configuration directives: | |
| lblc |
| #!/bin/bash | |
| set -o nounset | |
| set -o errexit | |
| set -o pipefail | |
| EXTRA_TAGS=${1} | |
| TSDB_CMD=$( /usr/bin/which tsdb ) | |
| START_TIME="1y-ago" | |
| END_TIME="45d-ago" |
| #!/bin/bash | |
| ### | |
| # chkconfig: 345 20 80 | |
| # description: Vert.x application service script | |
| # processname: java | |
| # | |
| # Installation (CentOS): | |
| # copy file to /etc/init.d | |
| # chmod +x /etc/init.d/my-vertx-application |
| #!/usr/bin/python | |
| import sys, datetime, time | |
| def apple_year_offset(dateobj, years=0): | |
| # Convert to a maleable format | |
| mod_time = dateobj.timetuple() | |
| # Offset year by number of years | |
| mod_time = time.struct_time(tuple([mod_time[0]+years]) + mod_time[1:]) | |
| # Convert back to a datetime obj | |
| return datetime.datetime.fromtimestamp(int(time.mktime(mod_time))) |
| #!/usr/bin/python | |
| import os.path, subprocess, datetime, dateutil.parser, time, sys | |
| def apple_year_offset(dateobj, years=0): | |
| # Convert to a maleable format | |
| mod_time = dateobj.timetuple() | |
| # Offset year by number of years | |
| mod_time = time.struct_time(tuple([mod_time[0]+years]) + mod_time[1:]) | |
| # Convert back to a datetime obj | |
| return datetime.datetime.fromtimestamp(int(time.mktime(mod_time))) |
Automatically deletes old emails that match the specified label.
- Create a new Google Apps Script at https://script.google.com
- Overwrite the placeholder with the javascript below
- Update the following constants:
LABEL_TO_DELETE: the label that should be have old messages deleted
Release in Chef 12.9.41 via PR #4741 core chef now has a feature which has been available in Poise for awhile, which is that notifications from within resources will now notify resources in outer run contexts. This means you can write a recipe with a service resource and send a notification to it from a resource that you write.
Notifications will bubble up from arbitrarily nested resources, so users that write resources that wrap resources which wrap your resource will still find the service resource in your default recipe.
At the same time the resources collection #find() and #lookup methods and the more commonly-used DSL method resources("service[ntpd]") has been changed to also match
| #!/bin/bash | |
| # Give the usual warning. | |
| clear; | |
| echo "[INFO] Automated Android root script started.\n\n[WARN] Exploit requires sdk module \"NDK\".\nFor more information, visit the installation guide @ https://goo.gl/E2nmLF\n[INFO] Press Ctrl+C to stop the script if you need to install the NDK module. Waiting 10 seconds..."; | |
| sleep 10; | |
| clear; | |
| # Download and extract exploit files. | |
| echo "[INFO] Downloading exploit files from GitHub..."; |