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
'''Ansible filters: useful to edit xml configs | |
''' | |
import xml.etree.ElementTree as ET | |
def xml_edit(xml, xpath, attrs={}, txt=None): | |
'''changes is a list of xpath, attributes and text''' | |
root = ET.fromstring(xml) | |
elm = root.find(xpath) |
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
lesterc@n54l /e/s/ws ❯❯❯ p4 sync -f //depot/path | |
//depot/path#1 - added as /client/path | |
[1] 25173 illegal hardware instruction (core dumped) p4 sync -f /client/path | |
lesterc@n54l /e/s/ws ❯❯❯ p4 -V ✘ 132 | |
Perforce - The Fast Software Configuration Management System. | |
Copyright 1995-2020 Perforce Software. All rights reserved. | |
This product includes software developed by the OpenSSL Project | |
for use in the OpenSSL Toolkit (http://www.openssl.org/) | |
Version of OpenSSL Libraries: OpenSSL 1.1.1a 20 Nov 2018 | |
See 'p4 help [ -l ] legal' for additional license information on |
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/zsh | |
# This can be used as a folder action on the macOS's desktop to reduce the size of | |
# most PNG files automatically. | |
# | |
# http://about.me/lestercheung | |
POSTERIZE=0 | |
PNGQUANT=0 | |
[[ -x /usr/local/bin/posterize ]] && POSTERIZE=1 | |
[[ -x /usr/local/bin/pngquant ]] && PNGQUANT=1 |
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
# -*- coding: utf-8 -*- | |
from parsley import makeGrammar | |
from pprint import pprint | |
import datetime | |
cmdstart = """Perforce server info: | |
2014/01/02 02:32:33 pid 19834 p4user@p4client 10.20.0.238 [p4/2013.3/DARWIN90X86_64/740675] 'user-submit -d Lr5 catalog dump 2014/01/02 lr5.lrcat.sql.xz'""" | |
cmdcomplete = """Perforce server info: | |
2014/01/02 02:32:33 pid 19834 completed .216s 4+8us 1251+0io 0+0net 2472k 0pf """ |