Skip to content

Instantly share code, notes, and snippets.

View khalilgharbaoui's full-sized avatar

Khalil Gharbaoui khalilgharbaoui

View GitHub Profile
if [ "$1" = "-h" ] || [ -z "$1" ]; then
echo "Usage: pass miner's IP address to this script"
echo "or pass -h for this message :)"
exit 0
if [ -z ${1+x} ]; then
loftwah / docker-compose.yml
Created February 9, 2020 13:53 — forked from mTrax-/docker-compose.yml
Traefik v2 with ssl
version: "3.3"
image: traefik:latest
restart: unless-stopped
- --api
- --providers.docker=true
- --entrypoints.web.address=:80
undernewmanagement / docker-compose.yml
Created January 29, 2020 01:07
Pristine config for Traefik 2.0, Docker, and LetsEncrypt with sample container. Includes a HTTP to HTTPS redirect
version: '3'
container_name: traefik
image: traefik:v2.0
- "--api.insecure=true"
- "--providers.docker=true"
amkisko / .github__gitlab__rails_postgresql_redis_rspec_codecov
Last active September 12, 2023 07:31
Rails, GitHub Actions, GitLab CI, PostgreSQL, Redis, rspec, codecov, Apollo GraphQL
Configuration files for Rails-driven project basic continuous integration using GitHub Actions and GitLab CI.
2020, amkisko (Andrei Makarov).
mTrax- / docker-compose.yml
Created October 13, 2019 19:50
Traefik v2 with ssl
version: "3.3"
image: traefik:latest
restart: unless-stopped
- --api
- --providers.docker=true
- --entrypoints.web.address=:80
khalilgharbaoui / rails-jsonb-queries
Created October 7, 2019 00:30 — forked from mankind/rails-jsonb-queries
Rails-5 postgresql-9.6 jsonb queries
#payload: [{"kind"=>"person"}]
Segment.where("payload @> ?", [{kind: "person"}].to_json)
#data: {"interest"=>["music", "movies", "programming"]}
Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json)
Segment.where("data #>> '{interest, 1}' = 'movies' ")
Segment.where("jsonb_array_length(data->'interest') > 1")
julik / kelder.rb
Last active October 22, 2019 22:33
A very very very rough version. There probably will be a gem of this
module Kelder
module PrefixKeyWithToken
# Prefix all generated blob keys with the tenant. Do not
# use slash as a delimiter because it needs different escaping
# depending on the storage service adapter - in some cases it
# might be significant, in other cases it might get escaped as a path
# component etc.
def generate_unique_secure_token
tenant_slug = Apartment::Tenant.current.split('_').last
khalilgharbaoui / register_chrome_with_window_size.rb
Last active September 8, 2019 05:14 — forked from mars/register_chrome_with_window_size.rb
Set window size for Capybara/Selenium/chromedriver
# This works best in 2019 forward because its basically the code from the gem itself with some tweaks added:
# The additional option/flags work for me but you probebly want to checkout what you would need here first:
Capybara.register_driver :selenium_chrome_headless do |app|
# Capybara::Selenium::Driver.load_selenium
browser_options = do |opts|
opts.args << '--window-size=1920,1080'
behroozam / Dockerfile
Last active March 4, 2024 12:15
send nginx custom log to elasticsearch with fluentd syslog input
FROM fluent/fluentd:v1.3-1
# Use root account to use apk
USER root
# below RUN includes plugin as examples elasticsearch is not required
# you may customize including plugins as you wish
RUN apk add --no-cache --update --virtual .build-deps \
build-base ruby-dev \
&& gem install \
bradtraversy /
Last active June 19, 2024 17:24
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes