Skip to content

Instantly share code, notes, and snippets.

#cloud-config
# https://cloudinit.readthedocs.io/en/latest/topics/modules.html#users-and-groups
users:
- name: ansible
uid: 999
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh_authorized_keys:
- '[REDACTED]'
@adduc
adduc / .hgrc
Created March 31, 2020 06:14
hgrc for hg-git
[extensions]
git =
[alias]
npull = !$HG git; $HG nukebookmarks; $HG pull
nukebookmarks = !$HG bookmarks -q | xargs -r $HG bookmark -d
locals {
ami_ubuntu_1804 = "ami-06397100adf427136"
ssh_public_key = "ssh-rsa ABCD...asdfasdf"
}
provider "aws" {
profile = "default"
region = "us-west-1"
}
#!/bin/bash
SOURCED=0
CD=0
if [[ "${BASH_SOURCE[0]}" != "${0}" ]]; then
SOURCED=1
fi
if [[ $1 =~ ^(cd|apps|notes|trunk|repos|docker)?$ ]]; then
#!/bin/sh
if test $# -lt 1 ; then
echo "Usage: download_apk.sh <target-dir>"
exit 1
fi
for LINE in $(adb shell pm list packages -f -3|sed 's/package://g'); do
APK_PATH=$(echo "$LINE" | cut -d'=' -f1)
FILE=$1/$(echo "${LINE}" | cut -d'=' -f2 | sed 's/\r$//').apk
<!-- /etc/firewalld/zones/docker.xml -->
<zone>
<short>Docker</short>
<description>Permits docker containers to access eachother.</description>
<interface name="docker0" />
<rule family="ipv4">
<source address="172.17.0.0/16" />
<accept/>
</rule>
</zone>
{
"minimum-stability": "stable",
"require": {
"cakephp/cakephp": "2.6.8"
},
"config": {
"vendor-dir": "Vendor"
},
"require-dev": {
"cakephp/debug_kit": "2.2.x-dev"
#!/usr/bin/env php
<?php
class Person
{
public $first_name;
public $last_name;
public function getFullName()
{
@adduc
adduc / gist:5fbd7185441c8b9543f6
Created December 11, 2014 20:41
PHP Opcache Not Refreshing
The opcache for PHP (previously Zend Optimizer+) depends on the filemtime to identify when to reinterpret the opcode for a file. If a file is changed, the system's clock is changed back (through NTP or other means), any changes to the file up until the previously set date/time will not be caught by the opcache.
@adduc
adduc / replace-short-tags.php
Created September 29, 2014 07:38
Short open tag
<?php
/**
* find -name "*.php" -exec php -d short_open_tag=On replace-short-tags.php {} \
*/
if(!isset($argv[1])) {
fwrite(STDERR, 'ch');
exit(1);
}