Skip to content

Instantly share code, notes, and snippets.

View marcelaraujo's full-sized avatar

Marcel Araujo marcelaraujo

View GitHub Profile
@marcelaraujo
marcelaraujo / gist:9a9fe07c5a4bcaea8c06
Created October 1, 2015 03:22
MacOS disable services
System process daemons that are system-wide provided by mac os x are described by launchd preference files that can be showed with the command:
$ sudo ls -all /System/Library/LaunchDaemons/
Third party process daemons that are system-wide provided by the administrator are described by preference files that can be showed with the command:
$ sudo ls -all /Library/LaunchDaemons/
Launch Agents that are per-user provided by mac os x usually loaded when the user logs in. Those provided by the system can be found with:
$ sudo ls -all /System/Library/LaunchAgents/
Launch Agents that are per-user provided by the administrator and usually loaded when the user logs in. Those provided by the system can be found with:
@marcelaraujo
marcelaraujo / gist:10610377
Created April 14, 2014 01:50
PHP Build compile
./configure \
--prefix=/usr/local \
--disable-debug \
--enable-pdo \
--enable-inline-optimization \
--enable-xml \
--enable-fpm \
--enable-ftp \
--enable-gd-jis-conv \
--enable-intl \
@marcelaraujo
marcelaraujo / README.md
Last active October 14, 2023 18:17
Convert P12 to PEM and extract RSA public and private keys

Convert P12 into PEM

openssl pkcs12 -in google-service-account-key.p12 -nocerts -nodes -out google-service-account-key.pem

openssl pkcs12 -in google-service-account-key.p12 -clcerts -nokeys -out google-service-account-crt.pem

Private RSA key

openssl rsa -in google-service-account-key.pem -out google-service-account-key-rsa

Public RSA key

openssl rsa -in google-service-account-key.pem -out google-service-account-key-rsa.pub -pubout

@marcelaraujo
marcelaraujo / goGetPrivate.md
Created October 6, 2023 11:08 — forked from StevenACoffman/goGetPrivate.md
How to `go get` private repos using SSH key auth instead of password auth.

Set GOPRIVATE to match your github organization

Cloning the repo using one of the below techniques should correctly but you may still getting an unrecognized import error.

As it stands for Go v1.13, I found in the doc that we should use the GOPRIVATE variable like so:

GOPRIVATE=github.com/ORGANISATION_OR_USER_NAME go get -u -f github.com/ORGANISATION_OR_USER_NAME/REPO_NAME

The 'go env -w' command (see 'go help env') can be used to set these variables for future go command invocations.

How to go get private repos using SSH key auth instead of password auth.

@marcelaraujo
marcelaraujo / react-track-elements.md
Created September 6, 2021 10:29
React Tracking Elements DOM changes
    import { useState, useEffect, useRef } from "react";
    import "./styles.css";
    
    const weak = new WeakMap();
    
    let i = 0;
    const unique = () => i++;
    
    export default function App() {
@marcelaraujo
marcelaraujo / extract-libraries-jobs.groovy
Created February 24, 2021 17:55
Extract Libraries from job executions
import java.util.regex.Pattern
import java.util.regex.Matcher
import jenkins.branch.BranchSource
import org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject
Pattern p = Pattern.compile("Loading\\slibrary\\s(jenkins-(\\w+)-library(@.*)?)");
Jenkins.instance.getAllItems(WorkflowMultiBranchProject.class).each { it ->
if (it.fullName.contains("Maintenance")) {
return
@marcelaraujo
marcelaraujo / Jenkinsfile
Created February 9, 2021 12:14 — forked from docwhat/Jenkinsfile
Example pipeline usage of the Jenkins Mask Passwords plugin
// Requires https://plugins.jenkins.io/mask-passwords to run
/**
* Runs code with secret environment variables and hides the values.
*
* @param varAndPasswordList - A list of Maps with a 'var' and 'password' key. Example: `[[var: 'TOKEN', password: 'sekret']]`
* @param Closure - The code to run in
* @return {void}
*/
def withSecretEnv(List<Map> varAndPasswordList, Closure closure) {
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Clash of Clans Auto Tool for Genymotion (VirtualBox Android VM)
"""
import os
import sys
import virtualbox
import subprocess
import cv2.cv as cv
@marcelaraujo
marcelaraujo / gist:f25b5839d0617e591323
Created October 1, 2015 03:24 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan Developer Preview 2

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@marcelaraujo
marcelaraujo / macos-port-forward.sh
Created November 30, 2020 10:22 — forked from gregjhogan/macos-port-forward.sh
local port forwarding on macOS
#!/bin/bash
ifconfig lo0 alias 127.0.1.1
ifconfig lo0 alias 127.0.10.1
# clear rules
pfctl -F all -f /etc/pf.conf
# set rules
echo "