Skip to content

Instantly share code, notes, and snippets.

############ CRDROID ################
mkdir -p ~/build
export USER=$(whoami)
git config --global user.name "Daniel P"
git config --global user.email "dduuch@gmail.com"
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
yes | repo init -u https://github.com/dduuch/crdroid-d855.git -b 8.1-d855
cd .repo/manifests/
git remote add crdroid https://github.com/crdroidandroid/android.git
@danpawlik
danpawlik / Temporary fix for x509 cert error for non self ssl cert
Created May 30, 2019 08:42
Error response from daemon: Get https://docker.example.com/v2/: x509: certificate signed by unknown authority
temporary solution.
Execute that inside the container:
```
apk update \
&& apk upgrade
&& rm -rf /var/cache/apk/* \
&& cp /certs/your-cert.crt /usr/local/share/ca-certificates/ \
&& update-ca-certificates
```
@danpawlik
danpawlik / Install k8s cluster and helm
Last active July 18, 2019 15:44
Install k8s cluster and helm
#!/bin/bash
sudo apt update
sudo apt install -y curl git vim
if [ $(hostname --fqdn) != $(hostname) ]; then
echo "Hostname doesn't match to this one set in /etc/hosts."
echo "Fixing..."
HOSTNAME=$(hostname --fqdn)
sudo tee /etc/hostname <<EOF
@danpawlik
danpawlik / setup-prometheus.sh
Last active May 21, 2021 06:50
Setup Prometheus
#!/bin/bash
PROMETHEUS_VERSION=${PROMETHEUS_VERSION:-'2.27.1'}
ALERTMANAGER_VERSION=${ALERTMANAGER_VERSION:-'0.21.0'}
NODE_EXPORTER_VERSION=${NODE_EXPORTER_VERSION:-'1.1.2'}
if command -v yum ; then
sudo yum update -y
sudo yum install -y wget
fi
@danpawlik
danpawlik / script.sh
Last active March 3, 2020 09:26
Openshift quick setup
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
yum -y install centos-release-openshift-origin epel-release git pyOpenSSL
yum -y install openshift-ansible
@danpawlik
danpawlik / setup-exporters.sh
Last active May 21, 2021 06:57
Setup prometheus exporters
#!/bin/bash
BLACKBOX_EXPORTER_VERSION=${BLACKBOX_EXPORTER_VERSION:-'0.19.0'}
MYSQL_EXPORTER_VERSION=${MYSQL_EXPORTER_VERSION:-'0.12.1'}
APACHE_EXPORTER_VERSION=${APACHE_EXPORTER_VERSION:-'0.8.0'}
ZOOKEEPER_EXPORTER_VERSION=${ZOOKEEPER_EXPORTER_VERSION:-'v0.1.12'}
STATSD_EXPORTER_VERSION=${STATSD_EXPORTER_VERSION:-'0.15.0'}
if id -u 'centos'; then
USER='centos'
@danpawlik
danpawlik / setup-grafana.sh
Last active April 15, 2020 08:23
Script for deploying grafana on Centos
#!/bin/bash
cat << EOF | sudo tee /etc/yum.repos.d/grafana.repo
[grafana]
name=grafana
baseurl=https://packages.grafana.com/oss/rpm
repo_gpgcheck=1
enabled=1
gpgcheck=1
gpgkey=https://packages.grafana.com/gpg.key
@danpawlik
danpawlik / gapps-config.txt
Created May 29, 2020 07:40
Opengapps configuration file. Put that file in /sdcard/Open-GApps
# More info how to create such file:
# https://github.com/opengapps/opengapps/wiki/Advanced-Features-and-Options
Include
# Pico+
CalSync                 # Install Google Calendar Sync (if Google Calendar is being installed)
DialerFramework         # Install Dialer Framework (Android 6.0+)
GoogleTTS               # Install Google Text-to-Speech Engine (Micro+ on 5.0-, Pico+ on 6.0+)
PackageInstallerGoogle  # Install Package Installer (Android 6.0 only & Android 8.0+)
@danpawlik
danpawlik / restore android data
Last active January 7, 2021 09:09
This script is restoring android app data in TWRP after unpack TWRP data.ext4.win00{0..6} tars
#!/bin/bash
# At first, unpack TWRP backup by typing:
# NOTE: /data/data is where the application informations are located
# cd TWRP/BACKUPS/<ID>/<BACKUP DIR> ; for i in {0..5}; do tar xvf data.ext4.win00$i /data/data/ -C data ; done
BACKUP_DATA_DIR="data/data"
APPS=$(ls $BACKUP_DATA_DIR/ | grep -E 'authenticator2|inmobile|jakdojade|lidl|mbank|pekao|revolut|securesms|melodis|telegram|uber|yanosik|whatsapp|canon|secret|fitatu|hbogo|brother|player|speed')
if [ ! -d "$BACKUP_DATA_DIR" ]; then
@danpawlik
danpawlik / build-pixelexperience.sh
Last active June 7, 2020 13:20
Build Pixel Experience rom for Pocophone
#!/bin/bash
USE_FEDORA=${USE_FEDORA:-''}
if [ ! -f "/swapfile" ]; then
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
fi