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
# Source | |
# Mastering Object-Oriented Python - Second Edition by Steven F. Lott Published by Packt Publishing, 2019 | |
# https://learning.oreilly.com/library/view/mastering-object-oriented-python/9781789531367/c34be237-5ccd-4775-a0b0-ec1f7652f7bc.xhtml | |
# | |
from pathlib import Path | |
# write JSON files: | |
with Path("temp.json").open("w", encoding="UTF-8") as target: | |
json.dump(travel3, target, default=blog_j2_encode) |
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
# Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
set -g prefix C-space | |
unbind-key C-b | |
bind-key C-space send-prefix | |
# Set new panes to open in current directory | |
bind c new-window -c "#{pane_current_path}" | |
bind '"' split-window -c "#{pane_current_path}" | |
bind % split-window -h -c "#{pane_current_path}" |
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
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does | |
import hudson.model.*; | |
import hudson.util.*; | |
import jenkins.model.*; | |
import hudson.FilePath.FileCallable; | |
import hudson.slaves.OfflineCause; | |
import hudson.node_monitors.*; | |
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 | |
# Based on the directions here: https://wiki.archlinux.org/index.php/DeveloperWiki:Building_in_a_Clean_Chroot | |
# This will take a while to build, with most of the time spent on QT4. There is some redundancy with creating | |
# multiple clean chroots, but I think this approach is easier and more reliable for most systems. | |
# Specify a build directory. Defaults to /tmp: | |
BUILDDIR="/tmp" | |
# Install devtools if it's not already installed: |
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 tomcat:8.5-jre8 | |
# $CATALINA_HOME is defined in tomcat image | |
ADD target/my-webapp*.war $CATALINA_HOME/webapps/my-webapp.war | |
# Application config | |
RUN mkdir $CATALINA_HOME/app_conf/ | |
ADD src/main/config/test.properties $CATALINA_HOME/app_conf/ | |
# Create "$CATALINA_HOME/bin/setenv.sh" |
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/env ruby | |
# | |
# CFengine command-line test utility. | |
# | |
# Diego Zamboni, December 27th, 2011 | |
# | |
# Run as "cf-cmd help" to see usage information. | |
require 'readline' | |
require 'tmpdir' |
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
!------------------------------------------------------------------------------- | |
! Xft settings | |
!------------------------------------------------------------------------------- | |
Xft.dpi: 96 | |
Xft.antialias: false | |
Xft.rgba: rgb | |
Xft.hinting: true | |
Xft.hintstyle: hintslight |
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
# Parameters are: | |
# file: file to edit | |
# params: an array indexed by parameter name, containing the corresponding values. For example: | |
# "sshd[Protocol]" string => "2"; | |
# "sshd[X11Forwarding]" string => "yes"; | |
# "sshd[UseDNS]" string => "no"; | |
# Diego Zamboni, November 2010 | |
bundle agent edit_sshd(file,params) | |
{ | |
files: |