Skip to content

Instantly share code, notes, and snippets.

View tchollingsworth's full-sized avatar

T.C. Hollingsworth tchollingsworth

View GitHub Profile
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
@tchollingsworth
tchollingsworth / patchcheck.py
Created December 14, 2013 01:14
git pre-commit hook for checking for problems with patches in RPM spec files
#!/usr/bin/python2
"""
git pre-commit hook for checking for problems with patches in RPM spec files
It verifies that:
- all patches are committed to git
- all patches are applied in %prep
- no unexpanded %patch macros exist in %prep
[Unit]
Description=Really wait for the damn network
Requisite=NetworkManager.service
After=NetworkManager.service
Wants=network.target
Before=network.target network-online.targe
[Service]
Type=oneshot
ExecStart=/bin/bash -c 'until ifconfig p5p1 | grep '192.\168'; do continue; done'
%_assetdir %{_datadir}/assets
%_jsdir %{_datadir}/javascript
%js_includes() %{expand: \
%(
ver=$(rpm -q --qf='%%{version}' -- %1)
if [[ $? -eq 0 ]]; then
echo "Provides: js-includes(%1) = $ver"
else
echo "Provides: js-includes(%1)"
@tchollingsworth
tchollingsworth / nodejs-fix-arch.sh
Created June 24, 2013 23:40
add nodejs' ExclusiveArch to a directory full of fedpkg clones
for dir in *; do
cd $dir
spec=$(fedpkg gimmespec)
git checkout master
sed -ri 's/BuildArch:(\s*)noarch/BuildArch:\1noarch\nExclusiveArch: %{nodejs_arches} noarch/' $spec
rpmdev-bumpspec -c'restrict to compatible arches' $spec
fedpkg ci -c
git checkout f19
@tchollingsworth
tchollingsworth / rsyncd.socket
Created November 28, 2011 18:08
rsyncd systemd units
[Unit]
Description=rsyncd Service Sockets
[Socket]
ListenStream=873
Accept=yes
[Install]
WantedBy=sockets.target
@tchollingsworth
tchollingsworth / readvcf.py
Created November 27, 2011 02:28
read a bunch of vcard files
#!/usr/bin/python
import sys, vobject
for filename in sys.argv[1:]:
with open(filename) as fh:
print filename, ":"
vobject.readOne(fh).prettyPrint()
print
#!/usr/bin/python2
import dbus, os, subprocess
bus = dbus.SystemBus()
manager_proxy = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1')
manager = dbus.Interface(manager_proxy, 'org.freedesktop.systemd1.Manager')
restart = []
#!/usr/bin/python2
import dbus, os, subprocess
bus = dbus.SystemBus()
manager_proxy = bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1')
manager = dbus.Interface(manager_proxy, 'org.freedesktop.systemd1.Manager')
restart = []