Skip to content

Instantly share code, notes, and snippets.

View repodevs's full-sized avatar

Edi Santoso repodevs

View GitHub Profile
@JanKoppe
JanKoppe / README.md
Last active December 4, 2020 03:58
nginx basic auth with different users for read/write

This nginx configuration allows to restrict access via different methods to separate users.

This is very useful for private docker registries, where you want every member of your team to be able to fetch Docker images, but only some users (admins and CI users) to push new images to the registry.

Example:

  • User write can use GET, POST, PUT, DELETE and everything else.
  • User read can only use GET and HEAD.
  • Anonymous users are denied access entirely.
@aaronsaderholm
aaronsaderholm / i3-gaps-install.sh
Last active January 1, 2021 18:52 — forked from doubtingben/gist:60a228c06a48a5b8601ea5e94e4ab22c
Install i3-gaps on Ubuntu 16.04
#!/usr/bin/env bash
# Install i3-gaps on Ubuntu 16
set -e
set -x
sudo apt-get update && sudo apt-get -y upgrade
sudo apt-get install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-shape0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev dh-autoreconf
mkdir -p $HOME/repos
cd $HOME/repos
@wshayes
wshayes / Dockerfile-es
Last active April 21, 2022 02:59
Elasticsearch and Kibana using docker-compose (v3)
FROM docker.elastic.co/elasticsearch/elasticsearch:5.5.1
RUN \
mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \
mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \
/usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack
-- Создаем базы данных
CREATE DATABASE "sahrding-main" OWNER = dev; -- Основная
CREATE DATABASE "sahrding-part-2016" OWNER = dev; -- Шард 1
CREATE DATABASE "sahrding-part-2017" OWNER = dev; -- Шард 2
-- Следующие запросы выполняем для каждой базы данных sahrding-part-*
-- Создаем таблицы где будут храниться реальные данные.
-- Со всеми необходимыми индексами и ограничениями.
CREATE TABLE content (
id int not null,
@aparrish
aparrish / spacy_intro.ipynb
Last active August 9, 2023 01:41
NLP Concepts with spaCy. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@robinsk
robinsk / BrowserPrint-1.0.4.js
Last active August 27, 2023 00:45
Zebra Browser Print SDK
var BrowserPrint = function() {
function e(e) {
return s + e
}
function n(e, n) {
var i = new XMLHttpRequest;
return "withCredentials" in i ? i.open(e, n, !0) : "undefined" != typeof XDomainRequest ? (i = new XDomainRequest, i.open(e, n)) : i = null, i
}
@roylee0704
roylee0704 / dockergrep.sh
Created December 9, 2016 08:24
how to grep docker log
docker logs nginx 2>&1 | grep "127."
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container
@danidee10
danidee10 / odoo-wsgi.py
Created November 16, 2016 10:20
Odoo wsgi file for running odoo10 as a wsgi application
# WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --http :9090 --pythonpath . --wsgi-file openerp-wsgi.py
#
@dixudx
dixudx / StreamToString.go
Created November 16, 2016 09:34 — forked from tejainece/StreamToString.go
Golang: io.Reader stream to string or byte slice
import "bytes"
func StreamToByte(stream io.Reader) []byte {
buf := new(bytes.Buffer)
buf.ReadFrom(stream)
return buf.Bytes()
}
func StreamToString(stream io.Reader) string {
buf := new(bytes.Buffer)
@jkluch
jkluch / CF_DNS_Updater.py
Last active January 13, 2020 05:18
Cloudflare auto-update any type A records found within the account to your current IP
#!/usr/bin/env python3
import sys
import json
import requests
import subprocess
from os.path import expanduser
HOME = expanduser("~")
AUTH_EMAIL = "MODIFY THIS"
AUTH_KEY = "MODIFY THIS"