Skip to content

Instantly share code, notes, and snippets.

@skrobul
skrobul / gist:c8cdcf02ec605a910943
Created July 14, 2014 11:22
file rewind check
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <signal.h>
#include <linux/inotify.h>
#define EVENT_SIZE ( sizeof (struct inotify_event) )

Keybase proof

I hereby claim:

  • I am skrobul on github.
  • I am skrobul (https://keybase.io/skrobul) on keybase.
  • I have a public key whose fingerprint is FB53 541D E519 8620 9807 D91C 5D96 65C7 E748 CCD7

To claim this, I am signing this object:

Timing application.allwindows
application.allwindows time for loginwindow: 0.000263
application.allwindows time for Dock: 0.000052
application.allwindows time for SystemUIServer: 0.000289
application.allwindows time for Spotlight: 0.000252
application.allwindows time for com.apple.dock.extra: 0.000199
application.allwindows time for sharingd: 0.000120
application.allwindows time for Seil: 0.000228
application.allwindows time for Karabiner: 0.000231
@skrobul
skrobul / gist:c1bb54d0475ccf8ebdc1
Created May 22, 2015 11:04
zenoss_client ruby 1.9.x test issues
~/devel/zenoss_client(vcr-cassette-name-ruby19 ✔) bundle --version
Bundler version 1.7.6
~/devel/zenoss_client(vcr-cassette-name-ruby19 ✔) rvm use 1.9.3
Using /Users/skrobul/.rvm/gems/ruby-1.9.3-p551
~/devel/zenoss_client(vcr-cassette-name-ruby19 ✔) export BUNDLE_GEMFILE=$PWD/Gemfile
~/devel/zenoss_client(vcr-cassette-name-ruby19 ✔) ruby --version
ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin14.0.0]
~/devel/zenoss_client(vcr-cassette-name-ruby19 ✔) rvm --version
rvm 1.26.11 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
~/devel/zenoss_client(vcr-cassette-name-ruby19 ✔) bundle --version
@skrobul
skrobul / gist:40d77668df1d8f7ff878
Created January 22, 2015 22:19
example openssl.cnf for generating TLS certificates to use with etcd
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
tsa_policy1 = 1.2.3.4.1
tsa_policy2 = 1.2.3.4.5.6
@skrobul
skrobul / gist:97a992491a3efca6f09d
Created November 9, 2015 11:00
salt uncomment
$ cat /tmp/myfile
# blah
#acl_smtp_predata = daily_limit_acl
#acl_not_smtp = daily_limit_acl
more blah
$ salt-call --local file.uncomment /tmp/myfile 'acl_(smtp_predata|not_smtp) = daily_limit_acl'
local:
---
+++
root@c208540c41e2:/var/lib/nagios3# ls -ld /var /var/lib /var/lib/nagios3 /var/lib/nagios3/rw
drwxr-xr-x 64 root root 4096 Sep 19 15:48 /var
drwxr-xr-x 45 root root 4096 Sep 19 15:48 /var/lib
drwxrwxr-x 21 nagios nagios 4096 Sep 30 15:24 /var/lib/nagios3
drwxrwx--- 2 nagios nagios 4096 Sep 30 16:24 /var/lib/nagios3/rw
root@c208540c41e2:/var/lib/nagios3# su - www-data -c "/bin/bash"
bash: no job control in this shell
www-data@c208540c41e2:~$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data),104(nagios),1000(nagcmd)
@skrobul
skrobul / gist:6887355
Created October 8, 2013 16:25
vpnc-script that makes OpenConnect on MACOSX possible
#!/bin/sh
#
# Originally part of vpnc source code:
# © 2005-2012 Maurice Massar, Jörg Mayer, Antonio Borneo et al.
# © 2009-2012 David Woodhouse <dwmw2@infradead.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
$ ruby ./getmac.rb 10.9.30.138
Scanning VLAN: 1
[T] Start: 2013-10-28 17:49:29 +0000
[T] Got bportids_to_mac_table in 0.039541 seconds
[T] Got macidx_to_brport 0.045924 seconds
[T] Got bridgeport to ifindex mapping 0.048247 seconds
[T] Got ifIndex to ifName mapping 0.270035 seconds
Total time spent on this vlan: 0.403856 seconds
Scanning VLAN: 2
[T] Start: 2013-10-28 17:49:29 +0000
@skrobul
skrobul / # weechat - 2016-04-25_13-51-39.txt
Created April 25, 2016 12:54
weechat on Mac OS X 10.10.5 - Homebrew build logs
Homebrew build logs for weechat on Mac OS X 10.10.5
Build date: 2016-04-25 13:51:39