Skip to content

Instantly share code, notes, and snippets.

View carlwgeorge's full-sized avatar

Carl George carlwgeorge

View GitHub Profile
@carlwgeorge
carlwgeorge / github-pr.py
Created August 23, 2017 19:17
Convert GitHub issue into a pull request.
#!/usr/bin/env python3
import re
import subprocess
import appdirs
import click
import requests
import yaml
import rpm
# optionally set an alternate gpg path
#rpm.addMacro('_gpg_path', '/other/gpg/path')
# set this macro to the key name or fingerprint
rpm.addMacro('_gpg_name', 'my key')
# sign it
rpm.addSign('foo.rpm', 'super secret gpg passphrase')
  • setup.py
'Just increment the number and create a new lib. Never fix the original one.'
from distutils.core import setup
setup(name='urllib5', version='5.0.0', author='Thomas Perl <[email protected]>',
        description=__doc__, py_modules=['urllib5'])
  • urllib5.py
from urllib import *

current setup:

/var/log/php-fpm/       <-- php-fpm:php-fpm 770
├── error.log           <-- root:root 600
└── www-error.log       <-- php-fpm:php-fpm 644
/var/log/php-fpm/*log {
    missingok
    notifempty
$ rhelish mod_security
+---------+----------------+
| BRANCH | VERSION |
+---------+----------------+
| el5 | None |
| el6 | None |
| el7 | 0:2.7.3-5.el7 |
| epel5 | 0:2.6.8-6.el5 |
| epel6 | 0:2.7.3-3.el6 |
| epel7 | None |
import re
import requests
from packaging.version import LegacyVersion
_default_pattern = '(?i){}[-_]([^-/_\s]+?)\.(?:t(?:ar\.)?(?:[bglx]z|bz2?)|zip)'
def get_all(url=None, name=None, pattern=None):
"""Return all upstream versions."""
#!/bin/sh
#
# mysqld This shell script takes care of starting and stopping
# the MySQL subsystem (mysqld).
#
# chkconfig: - 64 36
# description: MySQL database server.
# processname: mysqld
# config: /etc/my.cnf
# pidfile: /var/run/mysqld/mysqld.pid
@carlwgeorge
carlwgeorge / php7-module-tracker.md
Last active November 23, 2016 20:52
upstream status of PHP7 module compatibility
@carlwgeorge
carlwgeorge / ius-mysql-upgrade.md
Created April 7, 2016 18:12
breakdown of scriptlet ordering when upgrading from mysql56u-server to mysql57u-server
  1. %pre of mysql57u-server
    • groupadd mysql
    • useradd mysql
  2. installation of mysql57u-server
  3. %post of mysql57u-server
    • chkconfig --add mysqld
  4. %preun of mysql56u-server
    • service mysqld stop
    • chkconfig --del mysqld
  5. removal of mysql56u-server