Skip to content

Instantly share code, notes, and snippets.

View marcellodesales's full-sized avatar

Marcello DeSales marcellodesales

View GitHub Profile
@marcellodesales
marcellodesales / Auth value incorrect
Last active August 29, 2015 14:07
npm publish on NEXUS 2.10.0 - Packets captured using Wireshark
Based on https://www.ietf.org/rfc/rfc2045.txt, something needs to be transformed.
$ echo 'admin:admin123' | openssl base64
YWRtaW46YWRtaW4xMjMK
$ Accepted:
YWRtaW46YWRtaW4xMjM=
Last character used was "=".
@marcellodesales
marcellodesales / formatted.sh
Last active November 14, 2023 19:22
One-liner REST server using netcat - nc
rm -f out
mkfifo out
trap "rm -f out" EXIT
while true
do
cat out | nc -w1 -l 1500 > >( # parse the netcat output, to build the answer redirected to the pipe "out".
export REQUEST=
while read line
do
line=$(echo "$line" | tr -d '[\r\n]')
#!/usr/bin/env python
# Compare a file on S3 to see if we have the latest version
# If not, upload it and invalidate CloudFront
import fnmatch
import os
import boto
import pprint
import re
mdesales@ubuntu [11/30/201423:36:56] ~/dev/github-intuit/docker-images/platform/mule-3.4/source (master *) $ go run trying.go
Will start downloading file1... It might take 3787
Will start downloading file2... It might take 8639
Will start downloading file3... It might take 5633
FINISHED: file1 downloaded in 3787
FINISHED: file3 downloaded in 5633
FINISHED: file2 downloaded in 8639
[file1 downloaded in 3787 file3 downloaded in 5633 file2 downloaded in 8639]
8.641097774s
/** @module lib/Todos Docs */
"use strict";
var builder = require("xmlbuilder");
/**
* @param {object} todosJson is instance of the json report.
* @return {object} An XML representation of the todos based on sourceforge's todo.
*/
### Keybase proof
I hereby claim:
* I am marcellodesales on github.
* I am marcellodesales (https://keybase.io/marcellodesales) on keybase.
* I have a public key whose fingerprint is E1A5 0439 EE01 0DF4 D70A 377F 2B6A FBE5 7EB7 4C28
To claim this, I am signing this object:
@marcellodesales
marcellodesales / build.gradle
Created January 23, 2015 08:31
Java POJO Code Generation from XSD using Gradle 2.1 (See gradle xjc screen below)
buildscript {
repositories {
maven { url "https://repo.spring.io/libs-release" }
mavenLocal()
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.1.10.RELEASE")
//####################### XJC - JDK 1.7/1.8 ####################
// Confirm the new user by retrieving the password submitted.
User.confirmNewUser = function(id, code, submittedUser, next) {
console.log("Submitted User ID: " + id + "; Data to confirm: " + JSON.stringify(submittedUser));
// Find the user by ID submitted
// http://docs.strongloop.com/display/public/LB/Exposing+models+over+REST
User.findById(id, function (err, savedUser) {
if (err) {
throw err;
@marcellodesales
marcellodesales / 1.INSTALLING EPEL
Created June 21, 2015 18:41
NPM Enterprise Installation on RHEL 7
[root@pppdc9prd8tl tmphttps://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/chap-Managing_Services_with_systemd.html
$ sudo ln -s /usr/lib/systemd/system /etc/init
[root@pppdc9prd8tl npme]# mkdir /etc/systemd/system/npme.d
[root@pppdc9prd8tl npme]# ln -s /etc/systemd/system/npme.d /etc/init
[root@pppdc9prd8tl npme]# ls -la /etc/init
lrwxrwxrwx. 1 root root 26 Jun 20 13:36 /etc/init -> /etc/systemd/system/npme.d]# cd /tmp
[root@pppdc9prd8tl tmp]# wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
[root@pppdc9prd8tl tmp]# ls *.rpm
@marcellodesales
marcellodesales / renew-amazon-ec2-ips-by-tag.sh
Last active January 8, 2016 13:42
Renew all of your Amazon aws EC2 Fleet IP addresses by rebooting all of them by Tag:key=value using
#!/bin/bash
ACCESS_KEY=ADD_YOUR_KEY
SECRET_KEY=ADD_YOUR_SECRET
echo "########################################################";
echo "IP Renewal Scheduler at $(date)";
echo "########################################################";
echo "";