Skip to content

Instantly share code, notes, and snippets.

View gadelkareem's full-sized avatar
🎯
Focusing

Gadelkareem gadelkareem

🎯
Focusing
View GitHub Profile
@gadelkareem
gadelkareem / cache-warmer.py
Last active June 18, 2021 00:29 — forked from hn-support/cache-warmer.py
A threaded cache warmer in python
#!/usr/bin/env python3
"""
Warm the caches of your website by crawling each page or sitemap index defined in sitemap.xml.
To use, download this file and make it executable. Then run:
./cache-warmer.py --threads 4 --interval 10 --file https://example.com/sitemap.xml -v
./cache-warmer.py --threads 4 --interval 10 --file /data/web/public/sitemap.xml -v
"""
import argparse
from multiprocessing.pool import ThreadPool
import os.path
@gadelkareem
gadelkareem / lussh
Created October 20, 2020 19:46 — forked from enoch85/lussh
lussh - script to authorize your SSH key on a server
#!/bin/bash
# make sure to run this with /bin/bash, NOT /bin/sh
echo
echo This script will help you setup ssh public key authentication.
host=dummy
@gadelkareem
gadelkareem / varnishlog-examples.sh
Created January 19, 2020 11:25 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header
@gadelkareem
gadelkareem / cloneorpull.sh
Last active November 28, 2019 13:10 — forked from potter0815/cloneall.sh
Clone all private repos of an organization
#!/bin/bash
set -e
#optional change working directory
DIR=${1-$(pwd)}
cd $DIR
USER="Github username"
TOKEN=$GITHUB_TOKEN
Run this command to install MG-CLI:
sudo su
apt-get update && \
apt-get install ocl-icd-libopencl1 -y && \
wget https://minergate.com/download/xfast-ubuntu-cli-amd && \
dpkg -i xfast-ubuntu-cli-amd
to start miner (4 cores for BCN) use this command:
minergate-cli -user <YOUR@EMAIL.KAPPA> -bcn 4
registry:
restart: always
image: registry:latest
ports:
- 443:5000
environment:
REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
REGISTRY_HTTP_TLS_KEY: /certs/domain.key
REGISTRY_AUTH: htpasswd
REGISTRY_AUTH_HTPASSWD_PATH: /var/lib/registry/passfile
@gadelkareem
gadelkareem / solr.service
Last active February 5, 2020 16:33 — forked from hammady/solr.service
systemd service file for Apache SOLR
# put this file in /etc/systemd/system/ as root
# below paths assume solr installed in /opt/solr, SOLR_PID_DIR is /data
# and that all configuration exists in /etc/default/solr.in.sh which is the case if previously installed as an init.d service
# change port in pid file if differs
# note that it is configured to auto restart solr if it fails (Restart=on-faliure) and that's the motivation indeed :)
# to switch from systemv (init.d) to systemd, do the following after creating this file:
# sudo systemctl daemon-reload
# sudo service solr stop # if already running
# sudo systemctl enable solr
# systemctl start solr
---
- include_vars: secrets.yml
- apt: pkg={{ item }} state=present update_cache=yes
with_items:
- build-essential
- mime-support
- libfuse-dev
- libcurl4-openssl-dev