Skip to content

Instantly share code, notes, and snippets.

View angelortiz-dev's full-sized avatar
👨‍💻
Working

Angel Ortiz angelortiz-dev

👨‍💻
Working
View GitHub Profile
@angelortiz-dev
angelortiz-dev / encrypt_decrypt.rb
Created October 19, 2018 21:24
Simply encrypt and decrypt Strings in Ruby.
#
# Got from: https://gist.github.com/wteuber/5318013
require 'openssl'
def encrypt(plain_text, key)
cipher = OpenSSL::Cipher.new('DES-EDE3-CBC').encrypt
cipher.key = Digest::SHA1.hexdigest key
s = cipher.update(plain_text) + cipher.final
@angelortiz-dev
angelortiz-dev / mysql-docker.sh
Created August 14, 2017 23:01 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@angelortiz-dev
angelortiz-dev / hello.erl
Last active March 1, 2017 17:24
Hello World Erlang/Elixir
-module(hello).
io:format("compiling~n").
world() ->
io:format("hello world~n").
@angelortiz-dev
angelortiz-dev / flatten.ex
Last active February 21, 2017 18:14
Flatten a list exercise
defmodule Flatten do
@moduledoc """
This module has the flatten function that takes an arbitrary list of integers
and lists then builds a new one with only integers
"""
@doc """
## Examples
@angelortiz-dev
angelortiz-dev / Info.plist
Last active July 28, 2016 03:30
toledaARPT.kext patches AirPortAtheros40.kext plugin for IO80211Family.kext to allow Atheros 9285 in MacOS Sierra
<!-- Credits toleda: https://github.com/toleda
based on https://github.com/toleda/wireless_half-mini/tree/master/Deprecated%20Files/airport_kext_enabler
This Info.plist just updates the dependencies to work in macOS Sierra -->
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>15A284</string>
<key>CFBundleDevelopmentRegion</key>
@angelortiz-dev
angelortiz-dev / multiple_ssh_setting.md
Created February 5, 2016 21:53 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
# cuando un dir interno era un repo y no se agrega al parent repo se procede a esto para poder incluir los archivos.
git rm -rf --cached directory/
git add directory/
@angelortiz-dev
angelortiz-dev / docker-commands.txt
Created September 2, 2015 17:25
Useful commands for docker
# copy file from host to a container
cat /local/file/path | docker exec -i <running-container-id> sh -c 'cat > /inside/docker/file/path'
# copy file from a container to host
docker cp <containerId>:/file/path/within/container /host/path/target
@angelortiz-dev
angelortiz-dev / pentaho-firebird-jdbc-setup.txt
Created September 1, 2015 03:19
How to add firebird support to pentaho data integration on jdk 1.7 environment in archlinux
# install oracle jdk in archlinux
yaourt -S jdk7
# using jdk 1.7 instead of 1.8 due to some compatibility issues
# download firebird jdbc driver
wget https://github.com/FirebirdSQL/jaybird/releases/download/v2.2.8/Jaybird-2.2.8-JDK_1.7.zip
# this driver is for current firebird release (2.5.4)
# unzip and copy jaybird-2.2.8.jar to data-integration-directory/lib directory
@angelortiz-dev
angelortiz-dev / firebird-arch-setup.txt
Last active May 25, 2021 21:48
How to setup firebird super server on archlinux
# install with yaourt
yaourt -S firebird-superserver
# create symlink for firebird isql due to a conflict with unixODBC isql
# check with this command:
whereis isql (ENTER)
isql: /usr/bin/isql /opt/firebird/bin/isql /usr/share/man/man1/isql.1.gz
# creating symlink:
sudo ln -s /opt/firebird/bin/isql /usr/bin/isql-fb