Skip to content

Instantly share code, notes, and snippets.

View oc's full-sized avatar

Ole Christian Rynning oc

  • UPPERCASE
  • Oslo, Norway
View GitHub Profile
@oc
oc / simple-dd.sh
Last active February 3, 2020 13:49
##
#
# in one window track vmstat wait time
#
# iostat -o JSON -x $(df /home/oracle | tail -n 1 | awk '{print $1}') 1 > /tmp/bench-iostat.json
#
# Or:
# vmstat 1 > /tmp/bench-vmstat.log
#
# in another run the benchmark:
@oc
oc / actual instance of init script
Last active October 2, 2019 14:35
/etc/init.d/enonic-xp-{{site}}
#!/bin/bash
### BEGIN INIT INFO
# Provides: kmd - enonic xp instance
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start enonic xp daemon at boot time
@oc
oc / brews
Created September 13, 2019 07:08
iterm2 jetbrains-toolbox spectacle transmission visual-studio-code vlc
aom ffmpeg gettext harfbuzz libbluray libsndfile little-cms2 node pixman speex x265
cabal-install flac ghc haskell-stack libevent libsoxr lzo opencore-amr python sqlite xvid
cairo fontconfig giflib icu4c libffi libtasn1 make openjpeg readline tesseract xz
cmake freetype glib jpeg libidn2 libtiff mysql openssl rtmpdump theora yarn
composer frei0r gmp lame libogg libunistring n opus rubberband unbound youtube-dl
dnsmasq fribidi gnutls leptonica libpng libvorbis ncurses p11-kit sdl2 webp zsh
enonic gdbm graphite2 libass libsamplerate libvpx nettle pcre snappy x264
@font-face {
font-family: 'Glyphicons Halflings';
src: asset-url('glyphicons-halflings-regular.eot');
src: asset-url('glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
asset-url('glyphicons-halflings-regular.woff') format('woff'),
asset-url('glyphicons-halflings-regular.ttf') format('truetype'),
asset-url('glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
}
@oc
oc / ADUtils.java
Last active April 25, 2016 12:27
AD til UNIX timestamps
package fafafafafafa.useradmin.utils;
public class ADUtils {
private static final long AD_TO_UNIX_DIFF = 11644473600L;
private static final long DESI_NS_TO_SEC = 10000000L;
public static final long AD_MIN_TS = 126865728000000000L;
public static final long AD_MAX_TS = 9223372036854775807L;
@oc
oc / Crashlog
Created October 21, 2015 09:11
Thread 0SIGABRTCrash in print_exception
0 libsystem_kernel.dylib __pthread_kill (in libsystem_kernel.dylib) + 8
1 libsystem_c.dylib abort (in libsystem_c.dylib) + 112
AppName.iOS(MonoObject*, bool, NSMutableString*)
AppName.iOS(in b813275457dc3de8aa59ebeebeb9a211)
AppName.iOS(in b813275457dc3de8aa59ebeebeb9a211)
AppName.iOS(in b813275457dc3de8aa59ebeebeb9a211)
AppName.iOS(in b813275457dc3de8aa59ebeebeb9a211)
AppName.iOS(in b813275457dc3de8aa59ebeebeb9a211)
AppName.iOS(in b813275457dc3de8aa59ebeebeb9a211)
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Backend API Routes" stopProcessing="true">
<match url="^api.*" />
<action type="Rewrite" url="http://127.0.0.1:12500/{R:0}" />
</rule>
<rule name="AngularJS WEB Routes" stopProcessing="true">
@oc
oc / 00
Last active August 29, 2015 14:05
Server
Public IP: 1.2.3.150 (eth0)
LAN: 10.0.0.150 (eth1)
MGMT: 10.2.2.150 (eth1:1)
tun0: 10.9.8.1
Problem: doesn't route traffic (iptables foo)
@oc
oc / 0-versions-report
Last active August 29, 2015 14:01
Salt 2014.1.4 useradd.py bug
root@mgmt:/srv/salt# salt-minion --versions-report
Salt: 2014.1.4
Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
Jinja2: 2.6
M2Crypto: 0.21.1
msgpack-python: 0.1.10
msgpack-pure: Not Installed
pycrypto: 2.6
PyYAML: 3.10
PyZMQ: 13.1.0
@oc
oc / gist:9093393
Last active August 29, 2015 13:56
upstream ze-backend {
server backend.server.local:7500 fail_timeout=0;
}
location /stuff-proxied-to-backend {
# Tried this
max_ranges 0;
try_files $uri @ze-backend;