This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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=$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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=$$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"github.com/gadelkareem/go-helpers" | |
"io" | |
"net" | |
"net/http" | |
"sync" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function solution(int $n) { | |
$final = []; | |
$nArr = str_split($n); | |
$i = 0; | |
while (true) { | |
$el = pickGreatest($nArr); | |
$final[$i] = $nArr[$el]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Version": "2012-10-17", | |
"Id": "S3PolicyId1", | |
"Statement": [ | |
{ | |
"Sid": "IPAllow", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::example.bucket/*", |