Skip to content

Instantly share code, notes, and snippets.

@SamR1
SamR1 / README.md
Created April 18, 2022 08:20 — forked from mosquito/README.md
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
Requires=docker.service
After=docker.service
@SamR1
SamR1 / api_sev.py
Created April 11, 2018 12:50 — forked from notsobad/api_sev.py
Tornado basic auth example
# -*- coding= utf-8 -*-
import datetime
import os
import json
import tornado.ioloop
import tornado.web
import tornado
import tornado.httpclient
import traceback
import urllib2
@SamR1
SamR1 / tornado basic auth
Created April 11, 2018 11:42 — forked from fliphess/tornado basic auth
basic auth with "htpasswd" file - auth example for tornado webserver
#!/usr/bin/env python
# also check https://gist.github.com/fliphess/7836479
import tornado.ioloop
import tornado.web
import base64
import netaddr
import bcrypt
def require_basic_auth(handler_class):
@SamR1
SamR1 / SQLAlchemy_cast.py
Created March 25, 2018 11:57 — forked from danielthiel/SQLAlchemy_cast.py
SQLAlchemy: filter by date for an datetime field(does not work with SQLite, with PostgreSQL it works fine)
from datetime import date
from sqlalchemy import cast, DATE
Match.query.filter(cast(Match.date_time_field, DATE)==date.today()).all()
@SamR1
SamR1 / manjaro-avell-g1513.md
Created October 22, 2017 11:54 — forked from mauri870/manjaro-avell-g1513.md
Installation of Manjaro 17 and nvidia/bumblebee drivers on Avell G1513

After a weekend of research, stress and pain I finally figure out how to install manjaro 17 and configure the nvidia/bumblebee drivers on my avell laptop

Here's my notebook specs:

$ inxi -MGCNA

Machine:   Device: laptop System: Avell High Performance product: 1513
           Mobo: N/A model: N/A v: 0.1 UEFI: American Megatrends v: N.1.02 date: 09/28/2016
Battery    BAT0: charge: 44.0 Wh 100.0% condition: 44.0/44.0 Wh (100%)
@SamR1
SamR1 / install SonarQube on Raspberry Pi
Created July 30, 2017 15:37 — forked from synox/install SonarQube on Raspberry Pi
How to install SonarQube on Raspberry PI
SonarQube does currently not support Raspberry PI.
This is a workaround. It compiles a armv6 compatible version of the java-wrapper and configures sonarqube to use it.
(Testet with Raspbian, wheezy, 3.6)
Compile java-wrapper for ARMv6
============================
Download latest version of " wrapper_prerelease_XY.tar" from http://wrapper.tanukisoftware.com/downloads/ (for me 3.5.17 works)