Skip to content

Instantly share code, notes, and snippets.

View paulchubatyy's full-sized avatar
🤍
Evaporating

Paul (xobb) Chubatyy paulchubatyy

🤍
Evaporating
View GitHub Profile
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active June 17, 2024 15:05
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@nl5887
nl5887 / gpg-agent.conf
Last active November 14, 2022 09:37
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@bjallen
bjallen / main.yml
Created September 10, 2014 21:13
ansible mysql percona task
---
- name: Add Percona apt signing key
sudo: yes
apt_key: keyserver=keys.gnupg.net id=1C4CBDCDCD2EFD2A state=present
- name: Add Percona repository
sudo: yes
apt_repository: repo='deb http://repo.percona.com/apt trusty main' state=present
- name: Add Percona source repository
@bbengfort
bbengfort / venv_cheat_sheet.md
Created August 20, 2014 14:16
My virtualenv and virtualenv wrapper cheat sheet. I alias the commands of virtualenv and virtualenv wrapper for my own development environment.

Ben's VirtualEnv Cheatsheet

This cheat sheet describes my usage/implementation of virtualenv with virtualenv wrapper and the bash foo that I added with the help of many blogs to make it all tick together in fun land.

Quick Reference

$ echo $WORKON_HOME
/Users/benjamin/.virtualenvs

$ echo $PROJECT_HOME
@zebba
zebba / Entity\Foo.php
Last active August 29, 2015 14:04
Flexible and secure fromArray implementation
<?php
// ...
class Foo
{
// ...
static public function fromArray(array $data)
{
@phillipuniverse
phillipuniverse / ntp.conf
Last active November 8, 2022 14:40
Set up NTP with Ansible, dedicating one as a timelord
# /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help
driftfile /var/lib/ntp/ntp.drift
# Enable this if you want statistics to be logged.
#statsdir /var/log/ntpstats/
statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
@owainlewis
owainlewis / java7.yml
Created July 24, 2013 10:45
Install Java 7 with Ansible on Ubuntu Linux
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
@havvg
havvg / StreetAddressType.php
Created December 17, 2012 13:58
Symfony2 Forms: dynamic "NotBlank"-constraints
<?php
namespace Ormigo\Bundle\OrmigoBundle\Form\Type;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Ormigo\Bundle\OrmigoBundle\Form\DataTransformer\StreetAddressModelTransformer;
use Ormigo\Bundle\OrmigoBundle\Form\Validator\StreetAddressValidator;
@jtratner
jtratner / dynamic_blueprints.py
Last active November 26, 2019 14:24
Dynamic blueprints flask pseudocode
import os
PATH = path/to/my/blueprints/directory
BLUEPRINT = 'the_blueprint'
def import_file(path, name=None):
""" imports a file with given name and path """
# use the imp module to do actual imports
import imp
name = name or os.path.split(path)[-1].replace(".", "_")
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active June 5, 2024 22:16 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.