Category

Linux

error parsing HTTP 403 response body: invalid character ‘F’ looking for beginning of value: “Forbidden\n”

By | Linux | No Comments

To fix this Gitlab error please edit your /etc/gitlab/gitlab.rb file and update your whitelist with

gitlab_rails['rack_attack_git_basic_auth'] = {
'enabled' => true,
'ip_whitelist' => ["127.0.0.1, x.x.x.x"],
'maxretry' => 20,
'findtime' => 60,
'bantime' => 360
}

Replacing x.x.x.x with the IP you are trying to login with.

Then do gitlab-ctl reconfigure

Bonus round, also docker login -u <your username> -p <token> registry.gitlab.com Should help.

aufs diff folder full docker

By | Linux | No Comments

This will clean the mess up.

sudo docker system prune -af

But sometimes that’s not enough.  The following will nuke all your images and reclaim your space.


sudo service docker stop
sudo rm -rf /var/lib/docker
sudo service docker start

Install Berkeley 4.8 db libs on Ubuntu 16.04

By | Crypto Mining, Linux | No Comments

sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev

OR

wget http://download.oracle.com/berkeley-db/db-4.8.30.zip
unzip db-4.8.30.zip
cd db-4.8.30
cd build_unix/
../dist/configure --prefix=/usr/local --enable-cxx
make
make install

OR


BITCOIN_ROOT=$(pwd)

# Pick some path to install BDB to, here we create a directory within the bitcoin directory
BDB_PREFIX="${BITCOIN_ROOT}/db4"
mkdir -p $BDB_PREFIX

# Fetch the source and verify that it is not tampered with
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
echo '12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef db-4.8.30.NC.tar.gz' | sha256sum -c
# -> db-4.8.30.NC.tar.gz: OK
tar -xzvf db-4.8.30.NC.tar.gz

# Build the library and install to our prefix
cd db-4.8.30.NC/build_unix/
# Note: Do a static build so that it can be embedded into the executable, instead of having to find a .so at runtime
../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$BDB_PREFIX
make install

# Configure Bitcoin Core to use our own-built instance of BDB
cd $BITCOIN_ROOT
./autogen.sh
./configure LDFLAGS="-L${BDB_PREFIX}/lib/" CPPFLAGS="-I${BDB_PREFIX}/include/" # (other args...)

Also commonly fixes :
libdb_cxx headers missing ubuntu
found berkeley db other than 4.8, required for portable wallets
berkeley db 4.8 ubuntu

Install linux homebrew (brew) Ubuntu 16.04 LTS

By | Linux | No Comments

sudo apt-get install -y curl g++ gawk m4 make patch ruby tcl

PATH=~/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin
unset LD_LIBRARY_PATH PKG_CONFIG_PATH
yes | ruby -e "$(curl -fsSL https://raw.github.com/Linuxbrew/linuxbrew/go/install)"
brew doctor

brew install gcc --with-glibc
brew tap homebrew/dupes
brew install git
brew install coreutils findutils gawk gnu-sed gnu-which grep make ruby

PATH=$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin
brew install hello && brew test hello; brew remove hello

Mail-In-A-Box and Gitlab Install Script Same Server

By | Linux | No Comments

apt-get update && apt-get dist-upgrade
curl -s https://mailinabox.email/setup.sh | sudo bash
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.deb.sh | sudo bash
wget https://packages.gitlab.com/gitlab/gitlab-ee/packages/ubuntu/trusty/gitlab-ee_8.11.6-ee.0_amd64.deb/download
mv download download.deb
dpkg -i download.deb

DigitalOcean Block Storage Speed and Benchmarks

By | digitalocean, Linux | No Comments

Here are some simple stats from the new block storage available over at DigitalOcean.  Tested on a 1gb droplet.

hdparm -t /dev/sda Reads

Timing buffered disk reads: 536 MB in  3.01 seconds = 178.15 MB/sec

Timing buffered disk reads: 586 MB in  3.01 seconds = 194.63 MB/sec

Timing buffered disk reads: 574 MB in  3.00 seconds = 191.32 MB/sec

hdparm -T /dev/sda Cached Reads

Timing cached reads:   15090 MB in  2.00 seconds = 7551.96 MB/sec

Timing cached reads:   15056 MB in  2.00 seconds = 7535.53 MB/sec

Timing cached reads:   14810 MB in  2.00 seconds = 7411.46 MB/sec

time sh -c "dd if=/dev/sda of=ddfile bs=8k count=1000000 && sync"; rm ddfile Writes

8192000000 bytes (8.2 GB) copied, 49.4442 s, 166 MB/s

real 0m49.523s

user 0m0.348s

sys 0m12.384s