Skip to content

Instantly share code, notes, and snippets.

View andersondario's full-sized avatar

Anderson Dario andersondario

View GitHub Profile
@phgeraldeli
phgeraldeli / nexus_clean_unused_images.py
Created January 8, 2021 13:54
Clean unused docker images in the past x days
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# python2.7
# ORIGINAL: https://gist.github.com/anjia0532/4a7fee95fd28d17f67412f48695bb6de
from requests import Request, Session
from requests.exceptions import RequestException
from datetime import datetime,timedelta
import urllib3
@phgeraldeli
phgeraldeli / credential.groovy
Created January 8, 2021 13:47
Jenkins credentials discover
// Execute in jenkins script console
String saida = new ProcessBuilder( 'sh', '-c','''
grep -A4 CredentialName credentials.xml | tail -1 | cut -d'>' -f2 | cut -d'<' -f1
''').redirectErrorStream(true).start().text
saida = saida.replaceAll('\\s','')
println( saida )
println( hudson.util.Secret.decrypt(saida) )
@aymericbeaumet
aymericbeaumet / delete-likes-from-twitter.md
Last active May 22, 2024 02:09
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
@kenvontucky
kenvontucky / .gitlab-ci.yml
Created September 28, 2018 13:29
gitlab ci cd google app engine manual deploy
image: node:latest
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- node_modules/
stages:
- test
- build
@berkayunal
berkayunal / ._ Loading variables from .env files in Ansible.md
Created January 16, 2018 20:42
Loading variables from .env files in Ansible

Loading variables from .env files in Ansible

Ansible has various ways of looking up data from outside sources, including plain text password files, CSV files and INI files. But it doesn't seem to have a lookup for .env files, as used in Laravel projects, also available for PHP, Ruby, Node.js, Python and others.

One option is to launch Ansible with the Ruby dotenv command line script... But that requires Ruby, which seems like overkill to me.

So here is a simpler solution that I use. It consists of:

  1. The .env file itself
  2. A small shell script that loads the .env file into environment variables - ansible-playbook.sh
@h4cc
h4cc / install_tl_wn722n.sh
Created July 3, 2017 08:53
Installing a TP-Link TL-WN722N V2 on Ubuntu 16.04 with Kernel 4.4
# Source: https://askubuntu.com/questions/912498/tl-wn722n-is-not-recognized
sudo apt-get install git dkms git make build-essential
cd /usr/src
sudo git clone https://github.com/lwfinger/rtl8188eu.git
sudo dkms add ./rtl8188eu
sudo dkms build 8188eu/1.0
sudo dkms install 8188eu/1.0
sudo modprobe 8188eu
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active April 23, 2024 13:04
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@branneman
branneman / better-nodejs-require-paths.md
Last active April 27, 2024 04:16
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@bencz
bencz / determinante.c
Created March 17, 2013 09:13
Programa para calcular o determinante de uma matriz NxN
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int m = 0;
double **a = 0;
int i = 0, j = 0, k = 0;
double factor = 0;
double temp = 0;