Skip to content

Instantly share code, notes, and snippets.

@rogervila
rogervila / daemon.json
Created June 13, 2019 10:27
Change docker persistence path (/var/lib/docker) with /etc/docker/daemon.json
{
"graph": "/full/path/docker"
}
@rogervila
rogervila / find-by-content.sh
Created May 8, 2019 14:08
Find files by its content
#!/usr/bin/env bash
find /full/path/ -type f -exec grep -Hn "search term" {} \;
@gmazzo
gmazzo / jacoco.gradle
Created December 16, 2018 17:09
Jacoco script for Android unit and instrumentation tests coverage report, supporting Kotlin
apply plugin: 'jacoco'
jacoco {
toolVersion = '0.8.2'
}
android {
buildTypes {
debug {
@rogervila
rogervila / docker-cleanup.sh
Last active September 1, 2022 08:46
Docker cleanup
# Stop all containers
docker stop $(docker ps -aq)
# Cleanup
docker rm $(docker ps -aq)
docker container prune --force
docker volume prune --force
docker image prune -a --force
docker network prune --force
docker system prune --volumes --force
@thomaslarsen
thomaslarsen / README.md
Last active October 25, 2024 18:08
Convert PEM certificate to JSON format
@SanderTheDragon
SanderTheDragon / postman-deb.sh
Last active October 20, 2024 16:20
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
# SPDX-FileCopyrightText: 2017-2024 SanderTheDragon <[email protected]>
#
# SPDX-License-Identifier: MIT
arch=$(dpkg --print-architecture)
echo "Detected architecture: $arch"
case "$arch" in
@franklinsales
franklinsales / docker-php-list-extensions.txt
Created January 26, 2017 07:53
Docker php list extensions
RUN apt update
RUN apt upgrade -y
RUN apt install -y apt-utils
RUN a2enmod rewrite
RUN apt install -y libmcrypt-dev
RUN docker-php-ext-install mcrypt
RUN apt install -y libicu-dev
RUN docker-php-ext-install -j$(nproc) intl
RUN apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng12-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
@rb2k
rb2k / gist:8372402
Last active April 15, 2024 19:30
A jenkins script to clean up workspaces on slaves
// Check if a slave has < 10 GB of free space, wipe out workspaces if it does
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
for (node in Jenkins.instance.nodes) {
@matthewmccullough
matthewmccullough / gist:988077
Created May 24, 2011 03:02
Visualize Git Orphans via gitk and log
# Put this in your .gitconfig file under the alias section
orphank = !gitk --all `git reflog | cut -c1-7`&
# Then run it by typing 'git orphank' on the command line.
# A text version of the same is
orphanl = !git --pretty=oneline --abbrev-commit --graph --decorate `git reflog | cut -c1-7`