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
@gadelkareem
gadelkareem / cloneorpull.sh
Last active Nov 28, 2019 — forked from potter0815/cloneall.sh
Clone all private repos of an organization
View cloneorpull.sh
#!/bin/bash
set -e
#optional change working directory
DIR=${1-$(pwd)}
cd $DIR
USER="Github username"
TOKEN=$GITHUB_TOKEN
@gadelkareem
gadelkareem / auto_reconnect_vpn.scpt
Last active Nov 20, 2019
Auto Reconnect a VPN for k8s on OSX
View auto_reconnect_vpn.scpt
on idle
set vpnServiceName to "VPN NAME"
set connected to ""
delay 10
try
set connected to do shell script "/usr/local/bin/kubectl get namespace --request-timeout 5s &> /dev/null && echo 1"
on error errorMessage number errorNumber
end try
log connected
View k8s_dashboard_token.sh
#!/usr/bin/env bash
kubectl -n kube-system describe secret $(
kubectl -n kube-system get secret | \
awk '/^cluster-admin-dashboard-sa-token-/{print $1}'
) | \
awk '$1=="token:"{print $2}'
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
You can’t perform that action at this time.