Skip to content

Instantly share code, notes, and snippets.

View fjlopezs's full-sized avatar

Francisco Lopez fjlopezs

View GitHub Profile
#!/bin/sh
set -e
touch .gitignore
rm -f package-lock.json
rm -rf node_modules
echo '{"dependencies": {"@types/sequelize": {"version": "4.27.14", "from": "@types/sequelize@4.27.14", "dependencies": {"@types/lodash": {"version": "4.14.106", "from": "@types/lodash@4.14.106"} } } } }' > npm-shrinkwrap.json
npm i
rm npm-shrinkwrap.json
npm i --package-lock-only
sed -i '' '/package-lock.json/d' ./.gitignore;
@fjlopezs
fjlopezs / download.sh
Created May 18, 2018 00:45
Download All repisotories from your Organization
# Require jq, git, curl, private key and personal token
GITHUB_TOKEN=YOUR_PRIVATE_TOKEN see: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
ORGANIZATION=YOUR_ORGANIZATION_NAME
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/orgs/$ORGANIZATION/repos\?per_page\=500 | jq -r '.[].ssh_url' | xargs -n 1 git clone
@fjlopezs
fjlopezs / jenkins-decrypt.groovy
Last active April 19, 2018 15:44 — forked from tuxfight3r/jenkins-decrypt.groovy
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#<username>jenkins</username>
#<passphrase>your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J</passphrase>
#go to the jenkins url
http://jenkins-host/script
#In the console paste the script
hashed_pw='your-sercret-hash-S0SKVKUuFfUfrY3UhhUC3J'
@fjlopezs
fjlopezs / create_user_with_prompt_password.sh
Created April 17, 2018 15:11
Creating a Mac OS X user via shell script with a prompt password
#!/bin/sh
# https://apple.stackexchange.com/questions/82472/what-steps-are-needed-to-create-a-new-user-from-the-command-line/84039#84039
LastID=`dscl . -list /Users UniqueID | awk '{print $2}' | sort -n | tail -1`;
NextID=$((LastID + 1));
NewUser=administrator
. /etc/rc.common
dscl . create /Users/$NewUser
dscl . create /Users/$NewUser RealName "Admin"
# dscl . create /Users/$NewUser hint "Password Hint"
# curl -LJO "http://site.com/Picture.png"
@fjlopezs
fjlopezs / create_user.sh
Last active August 4, 2020 16:32 — forked from dimitardanailov/create_user.sh
Creating a Mac OS X user via shell script
#!/bin/sh
# https://apple.stackexchange.com/questions/82472/what-steps-are-needed-to-create-a-new-user-from-the-command-line/84039#84039
LastID=`dscl . -list /Users UniqueID | awk '{print $2}' | sort -n | tail -1`;
NextID=$((LastID + 1));
NewUser=administrator
. /etc/rc.common
dscl . create /Users/$NewUser
dscl . create /Users/$NewUser RealName "Admin"
# dscl . create /Users/$NewUser hint "Password Hint"
# curl -LJO "http://site.com/Picture.png"
@fjlopezs
fjlopezs / install.sh
Last active April 17, 2018 14:47 — forked from franciscocpg/install.sh
docker completion for CoreOS
# Run this as CoreOS user at home folder
#set -e
toolbox dnf -y install bash-completion wget \
&& toolbox wget https://raw.githubusercontent.com/docker/cli/master/contrib/completion/bash/docker -O /usr/share/bash-completion/completions/docker \
&& toolbox cp /usr/share/bash-completion /media/root/var/ -R \
&& source /var/bash-completion/bash_completion;
unlink ~/.bashrc; echo "source /var/bash-completion/bash_completion" >> ~/.bashrc
@fjlopezs
fjlopezs / setup-modernie-vagrant-boxes.md
Last active March 30, 2017 14:04 — forked from andrealbinop/setup-modernie-vagrant-boxes.md
Setup modern.ie vagrant boxes

Setup modern.ie vagrant boxes

Since modern.ie released vagrant boxes, it' no longer necessary to manually import the ova file to virtualbox, as mentioned here.

However, the guys at modern.ie didn't configured the box to work with WinRM. This how-to addresses that, presenting steps to proper repackage these boxes, adding WinRM support. Additionally configures chocolatey package manager and puppet provisioner.

Pre-requisites

@fjlopezs
fjlopezs / CursorRecyclerAdapter.java
Created November 11, 2015 03:41 — forked from Shywim/CursorRecyclerAdapter.java
A custom Adapter for the new RecyclerView, behaving like the CursorAdapter class from previous ListView and alike. Now with Filters and updated doc.
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matthieu Harlé
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
<?php
include '../vendor/autoload.php';
$classLoader = new \Doctrine\Common\ClassLoader('Entities', __DIR__);
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Proxies', __DIR__);
$classLoader->register();
// config
$config = new \Doctrine\ORM\Configuration();