Skip to content

Instantly share code, notes, and snippets.

View ncolomer's full-sized avatar

Nicolas Colomer ncolomer

View GitHub Profile
@flox1an
flox1an / default.conf
Last active September 1, 2023 07:26
nginx config that uses the oauth2-proxy (via auth_request) to authenticate against gitlab and then proxies all requests to a backend service while setting the auth headers X-User and X-Email
server {
listen 80;
server_name localhost;
location /oauth2/ {
proxy_pass http://oauth-proxy:4180;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Auth-Request-Redirect $request_uri;
@mosquito
mosquito / README.md
Last active May 4, 2024 12:42
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@carlossless
carlossless / Info.plist
Last active February 22, 2023 12:01
ATMEL ICE on OS X
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.atmel.driver.dummy</string>
@jimschubert
jimschubert / Markdown-JavaScript.markdown.js
Last active September 24, 2023 13:31
DataGrip (IntelliJ) output SQL results to Markdown
if (!String.prototype.repeat) {
// polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat
String.prototype.repeat = function(count) {
'use strict';
if (this == null) {
throw new TypeError('can\'t convert ' + this + ' to object');
}
var str = '' + this;
count = +count;
if (count != count) {
@karussell
karussell / 1-simple-facet.sh
Created July 28, 2012 22:59
ElasticSearch - multiple geo_points
HOST="http://localhost:9200"
# rebuild index
curl -XDELETE "$HOST/osm"
curl -XPUT "$HOST/osm"
curl -XPUT "$HOST/osm/way/_mapping" -d '
{
"way" : {
"properties" : {
@blaix
blaix / mock-with-arg-verification.py
Created March 30, 2012 23:25
Mocking new instance of class and verifying the arguments in python with flexmock
# Mock new instances of a class (verify that it's initialized with specific arguments)
# First argument to __new__ is the class, so pass `object` because we don't care about that part
flexmock(MyClass).should_receive('__new__').once.with_args(object, 'arg1', 'arg2').and_return(fake_object)
MyClass('wrong', 'arguments') # => MethodSignatureError
MyClass('arg1', 'arg2') # => <fake_object>