Skip to content

Instantly share code, notes, and snippets.

Waleed Gadelkareem gadelkareem

Block or report user

Report or block gadelkareem

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cloudflare-dns.sh
#!/usr/bin/env bash
set -euo pipefail
DOMAIN=$1
SUB_DOMAIN="${2}.${DOMAIN}"
CF_ID=$3
CF_KEY=$4
IP=
View ufw-cloudflare.sh
#!/usr/bin/env bash
set -euo pipefail
# lock it
PIDFILE="/tmp/$(basename "${BASH_SOURCE[0]%.*}.pid")"
exec 200>${PIDFILE}
flock -n 200 || ( echo "${BASH_SOURCE[0]} script is already running. Aborting . ." && exit 1 )
PID=$$
echo ${PID} 1>&200
View mysql.sh
#!/usr/bin/env bash
set -euo pipefail
cd `dirname $0`
# lock it
PIDFILE="/tmp/$(basename "${BASH_SOURCE[0]%.*}.pid")"
exec 200>${PIDFILE}
flock -n 200 || ( echo "${BASH_SOURCE[0]} script is already running. Aborting . ." && exit 1 )
PID=$$
View postgres.sh
#!/usr/bin/env bash
set -euo pipefail
cd `dirname $0`
# lock it
PIDFILE="/tmp/$(basename "${BASH_SOURCE[0]%.*}.pid")"
exec 200>${PIDFILE}
flock -n 200 || ( echo "${BASH_SOURCE[0]} script is already running. Aborting . ." && exit 1 )
PID=$$
@gadelkareem
gadelkareem / gitlab.sh
Created Jun 11, 2019
Gitlab crontab deploy script
View gitlab.sh
#!/usr/bin/env bash
set -euo pipefail
cd `dirname $0`
#Project ID
PROJECT=827639846934
#https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
PRIVATE_TOKEN=-BDlsq86JKHsndiwhD24
View gist:eba6a4a002737ecb38b51dbaec51301b
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
View chrome.sh
#!/bin/bash
set -e
sudo apt-get install libnss3 libappindicator1 fonts-liberation -y
sudo apt --fix-broken install -y
cd /tmp/
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
@gadelkareem
gadelkareem / io.copy.go
Last active Mar 14, 2019
io.copy hangs on hijacked connection
View io.copy.go
package main
import (
"context"
"fmt"
"github.com/gadelkareem/go-helpers"
"io"
"net"
"net/http"
"sync"
View docker-compose.yml
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
View gist:d3b2282f363f4b9a2475b75e989a452a
<?php
function solution(int $n) {
$final = [];
$nArr = str_split($n);
$i = 0;
while (true) {
$el = pickGreatest($nArr);
$final[$i] = $nArr[$el];
You can’t perform that action at this time.