Skip to content

Instantly share code, notes, and snippets.

@lospejos
lospejos / access_postgresql_with_docker.md
Created December 19, 2020 11:33 — forked from MauricioMoraes/access_postgresql_with_docker.md
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@lospejos
lospejos / client.groovy
Created July 20, 2020 21:06 — forked from renatoathaydes/client.groovy
HTTP Server / Client in Groovy
/*
* This is a runnable groovy script.
* Run with "groovy client.groovy".
*
* Don't forget to start the server.groovy script first (shown in this gist).
*/
import groovy.transform.CompileStatic
import groovy.transform.Immutable
import groovy.transform.ToString
@lospejos
lospejos / FF57+RoomyBookmarksToolbar.md
Created March 22, 2018 21:20 — forked from sboettcher/FF57+RoomyBookmarksToolbar.md
Firefox Quantum Roomy Bookmarks Toolbar

In your Profile folder, add/edit the file chrome/userChrome.css with the following contents:

/* Recreates the basic functionality of the popular Roomy Bookmarks Toolbar add-on:
Hide bookmarks bar items label text, show on hover. */

.bookmark-item > .toolbarbutton-text {
  margin-top: -1px !important;
}
.bookmark-item {
@lospejos
lospejos / retainAllExample.groovy
Created December 4, 2017 11:33 — forked from danieldbower/retainAllExample.groovy
Groovy retainAll example with Closure
def a = [[id:"a"], [id:"b"], [id:"c"]]
def b = ["a", "b"]
a.retainAll(){
println it
b.contains(it.id)
}
println a
@lospejos
lospejos / AccountControllerTest.groovy
Created December 1, 2017 20:32 — forked from jeffsheets/AccountControllerTest.groovy
Spock test with Mocks of Spring MVC Rest Controller using standaloneSetup and mockMvc
import groovy.json.JsonSlurper
import org.springframework.test.web.servlet.MockMvc
import static org.springframework.test.web.servlet.setup.MockMvcBuilders.*
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.http.HttpStatus.*
import spock.lang.Specification
/**
* A Spock Spring MVC Rest unit test that doesn't require a full spring context
*/
@lospejos
lospejos / 1с_очистка_кеша.cmd
Created November 30, 2017 13:48 — forked from b4tman/1с_очистка_кеша.cmd
батник для очистки кеша 1с (на Windows XP и более новых)
@echo off
setlocal EnableExtensions
IF NOT DEFINED LOCALAPPDATA set LOCALAPPDATA=%HOMEDRIVE%%HOMEPATH%\Local Settings\Application Data
for /D %%i in ("%LOCALAPPDATA%\1C\1Cv8\*-*-*-*-*") do (rmdir /q /s "%%i")
for /D %%i in ("%LOCALAPPDATA%\1C\1Cv82\*-*-*-*-*") do (rmdir /q /s "%%i")
@lospejos
lospejos / srv1c-x32.Dockerfile
Created June 1, 2017 15:39 — forked from b4tman/srv1c-x32.Dockerfile
запуск сервера 1С x32 в докере
FROM ubuntu:xenial
ENV DEBIAN_FRONTEND noninteractive
RUN set -ex \
&& echo "deb http://archive.ubuntu.com/ubuntu/ xenial multiverse" > /etc/apt/sources.list.d/multiverse.list \
&& dpkg --add-architecture i386 \
&& apt-get update \
&& apt-get -y dist-upgrade \
&& apt-get install --no-install-recommends --no-install-suggests -y \