Skip to content

Instantly share code, notes, and snippets.

@gboddin
gboddin / dpull.sh
Last active June 8, 2018 13:51
noDocker tools
#!/usr/bin/env bash
set -o pipefail
# hello-world latest ef872312fe1b 3 months a910 B
# hello-world latest ef872312fe1bbc5e05aae626791a47ee9b032efa8f3bda39cc0be7b56bfe59b9 3 months ago 910 B
# debian latest f6fab3b798be 10 weeks ago 85.1 MB
# debian latest f6fab3b798be3174f45aa1eb731f8182705555f89c9026d8c1ef230cbf8301dd 10 weeks ago 85.1 MB
if ! command -v curl &> /dev/null; then
echo >&2 'error: "curl" not found!'
@gboddin
gboddin / docker-compose.yaml
Last active May 5, 2018 12:29
docker-compose-pcas
version: '2'
services:
pcas-client:
build:
context: ./
dockerfile: Dockerfile.mock-client
image: openeuropa/pcas-client
ports:
- 8002:8002
volumes:
@gboddin
gboddin / 00-MINING.md
Last active January 27, 2024 11:58
Mining optimisation under Linux

Mining under linux

Disclaimer

I'm in no case responsible for fried hardware, erased software or burning down houses. Make sure your miners are always well cooled.

General recommendation

Though you can easily mix nVidia and AMD in the same rig with Linux, it's recommended to use a different thread for each platform so a Driver crash doesn't bring the whole rig down. It should be noted however, that some mining software have trouble when both architecture are found on the same rig.

@gboddin
gboddin / README.md
Last active November 1, 2017 12:19
Big file download in PHP ( guzzle )

This way ensure the file is streamed to the disk instead of memory.

  1. Install guzzle
composer require guzzlehttp/guzzle:~6.0
  1. Use get.php
@gboddin
gboddin / .drone.yaml
Created August 14, 2017 11:30
a sample .drone.yaml
pipeline:
hello:
image: fpfis/php56-dev
commands:
- composer --version
- echo "Hello world from a gist"
@gboddin
gboddin / post-checkout
Last active June 19, 2017 14:09
docker-compose branch git post-checkout plugin
#!/bin/sh
# Place me in .git/hooks/post-checkout
# Gets name from previous branch
PREVIOUS_BRANCH=$(git name-rev --name-only $1)
# Gets name from current branch
CURRENT_BRANCH=$(git name-rev --name-only $2)
if [ "${PREVIOUS_BRANCH}" != "${CURRENT_BRANCH}" ]; then
echo "Coming from ${PREVIOUS_BRANCH} to ${CURRENT_BRANCH}"
@gboddin
gboddin / makerpm.patch
Created August 19, 2016 10:10
php el6 patch makerpm
--- makerpm 2016-08-18 11:07:46.000000000 +0000
+++ makerpm-patched 2016-08-19 10:10:19.415245429 +0000
@@ -42,8 +42,8 @@
Version: PVERSION
Release: PRELEASE
Group: Networking/Daemons
-Source0: http://www.php.net/distributions/php-%{PACKAGE_VERSION}.tar.gz
-Copyright: PHP License
+Source0: http://www.php.net/distributions/php-PVERSION.tar.gz
+License: PHP License
#!/bin/bash
root=$(pwd)
linker=/lib/x86_64-linux-gnu/ld-2.19.so
my_ld_library_path="${root}/lib64:${root}/usr/lib64"
while read lib_path; do
my_ld_library_path="${root}${lib_path}:${my_ld_library_path}"
done < <(cat "${root}/etc/ld.so.conf.d"/* 2> /dev/null | grep -v '^#')
my_path=${root}/bin:${root}/sbin:${root}/usr/bin:${root}/usr/sbin
LD_LIBRARY_PATH="${my_ld_library_path}" PATH=${my_path} "${root}${linker}" $@
@gboddin
gboddin / build-httpd-2.4-el6.sh
Last active July 3, 2018 20:32
centos-httpd-2.4.x RPM gen
#!/bin/bash
APACHE_VERSION=2.4.23
DISTCACHE_VERSION=1.4.5-23
APR_VERSION=1.5.2
APR_UTIL_VERSION=1.5.4
echo Downloading deps :
rpm -ivh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum install tar expat-devel freetds-devel db4-devel rpm-build postgresql-devel mysql-devel sqlite-devel wget unixODBC-devel nss-devel doxygen automake libtool autoconf zlib-devel libselinux-devel libuuid-devel pcre-devel openldap-devel lua-devel libxml2-devel openssl-devel -y
wget -c https://archives.fedoraproject.org/pub/archive/fedora/linux/releases/18/Fedora/source/SRPMS/d/distcache-${DISTCACHE_VERSION}.src.rpm
@gboddin
gboddin / 00percona.pref
Created November 6, 2015 18:03
Percona pin to avoid conflict
Package: *
Pin: release o=Percona Development Team
Pin-Priority: 1001