Skip to content

Instantly share code, notes, and snippets.

View duritong's full-sized avatar

duritong duritong

View GitHub Profile
@duritong
duritong / config.log
Created September 14, 2015 19:11
google-authenticator-config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by google-authenticator configure 1.01, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64 --libexecdir=/usr/libexec --localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man --infodir=/usr/share/info
## --------- ##
## Platform. ##
@duritong
duritong / file_concat
Last active August 29, 2015 14:22
oh concat why oh concat where is your refresh
$ git clone https://github.com/electrical/puppet-lib-file_concat modules/file_concat
Cloning into 'modules/file_concat'...
remote: Counting objects: 276, done.
remote: Total 276 (delta 0), reused 0 (delta 0), pack-reused 276
Receiving objects: 100% (276/276), 42.34 KiB | 0 bytes/s, done.
Resolving deltas: 100% (99/99), done.
Checking connectivity... done.
$ cd modules/file_concat
$ git checkout -b v0.3.0 0.3.0
Switched to a new branch 'v0.3.0'
@duritong
duritong / use_fingerprints
Created September 3, 2014 16:41
why short ids are bad
$ gpg --keyserver keys.mayfirst.org --homedir /tmp/te --recv-key 4BD6EC30
gpg: requesting key 4BD6EC30 from hkp server keys.mayfirst.org
gpg: /tmp/te/trustdb.gpg: trustdb created
gpg: key 4BD6EC30: public key "Puppet Labs Release Key (Puppet Labs Release Key) <info@puppetlabs.com>" imported
gpg: key 4BD6EC30: public key "Puppet Labs Release Key (Puppet Labs Release Key) <info@puppetlabs.com>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 2
gpg: imported: 2 (RSA: 2)
@duritong
duritong / 1-server.sh
Last active June 4, 2018 15:10
Creating a pulp upload user
$ pulp-admin auth user create --login jenkins --password xxx
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/content/uploads/" -o read -o update -o create -o delete
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/tasks/" -o read
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/repositories/my-repo/actions/import_upload/" -o create -o execute -o read -o update
$ pulp-admin auth permission grant --login=jenkins --resource="/v2/repositories/my-repo/actions/publish/" -o execute
@duritong
duritong / hooks.php
Last active December 14, 2015 13:08
fetch pgp keys from horde_prefs
public function pgp_key($address, $keyid)
{
$db = $GLOBALS['injector']->getInstance('Horde_Db_Adapter');
$query = "SELECT pref_value FROM horde_prefs WHERE pref_name = 'pgp_public_key' AND pref_value <> '' AND pref_uid = ?";
try {
$result = $db->selectOne($query,array($address));
$columns = $db->columns('horde_prefs');
if (!empty($result)) {
$key = $columns['pref_value']->binaryToString($result['pref_value']);
return $key;
@duritong
duritong / redhat-lsb-core-cleanup.sh
Last active December 14, 2015 09:28
My CentOS 6.4 experience
$ yum remove /usr/bin/foomatic-rip /usr/bin/gs /usr/bin/lp /usr/bin/lpr \
libcups.so.2 libcupsimage.so.2 /usr/bin/fc-cache /usr/bin/fc-list \
/usr/bin/fc-match libGL.so.1 libGLU.so.1 libICE.so.6 libQtCore.so.4 \
libQtGui.so.4 libQtNetwork.so.4 libQtOpenGL.so.4 libQtSql.so.4 libQtSvg.so.4 \
libQtXml.so.4 libSM.so.6 libX11.so.6 libXext.so.6 libXft.so.2 libXi.so.6 \
libXrender.so.1 libXt.so.6 libXtst.so.6 libasound.so.2 libatk-1.0.so.0 \
libcairo.so.2 libcups.so.2 libcupsimage.so.2 libfontconfig.so.1 \
libfreetype.so.6 libgdk-x11-2.0.so.0 libgdk_pixbuf-2.0.so.0 \
libgdk_pixbuf_xlib-2.0.so.0 libgtk-x11-2.0.so.0 \
libjpeg.so.62 libpango-1.0.so.0 libpangocairo-1.0.so.0 libpangoft2-1.0.so.0 \
@duritong
duritong / fix.patch
Created December 15, 2011 13:56
fix wordpress feeds https detection
diff --git a/wp-includes/feed.php b/wp-includes/feed.php
index 34d8652..ad78b56 100644
--- a/wp-includes/feed.php
+++ b/wp-includes/feed.php
@@ -490,7 +490,7 @@ function self_link() {
$host = $host['host'];
echo esc_url(
'http'
- . ( (isset($_SERVER['https']) && $_SERVER['https'] == 'on') ? 's' : '' ) . '://'
+ . ( (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '' ) . '://'
@duritong
duritong / output.txt
Created December 7, 2011 17:43
sneak preview of ruby wrapperfor pulp api
$ ruby -rrubygems repositories.rb
Pulp examples: Repositories
---------------------------
This will do a simple workflow through the management of repositories via the PULP Api using our ruby wrapper.
It will either use the test_pulp.yml file in this directory or use the PULP_YML environment variable, so you can set it to your own.
The test_pulp.yml file assumes that you have a pulp server running on localhost with username and password set to admin.
@duritong
duritong / test.rb
Created November 29, 2011 16:49
ruby class var foo
require 'active_support'
module ModuleA
def self.included(c)
c.class_attribute :foo
c.extend ClassMethods
end
module ClassMethods
def set_foo(value)
@duritong
duritong / commands.rb
Created November 3, 2011 09:01 — forked from masterzen/commands.rb
Puppet Extension Point - part 2
commands ping => "/usr/bin/ping"
...
# we can use it later with:
# ping "www.puppetlabs.com"