Skip to content

Instantly share code, notes, and snippets.

@solanoepalacio
solanoepalacio / load_dotenv.sh
Created June 6, 2023 14:01 — forked from mihow/load_dotenv.sh
Load environment variables from dotenv / .env file in Bash
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
#!/usr/bin/env bash
usage="Usage: $(basename "$0") region stack-name [aws-cli-opts]
where:
region - the AWS region
stack-name - the stack name
aws-cli-opts - extra options passed directly to create-stack/update-stack
"
@solanoepalacio
solanoepalacio / delay-el.js
Last active July 17, 2020 02:38
event-loop
/**
* Shows how the event loop can be delayed to the execution of a timer.
* inspired on node-js docs example: https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/
*/
'use-strict';
const { spawn } = require('child_process');
// Create a task that takes 95ms to complete
# Make sure you grab the latest version
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip
# Unzip
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3
# Move protoc to /usr/local/bin/
sudo mv protoc3/bin/* /usr/local/bin/
# Move protoc3/include to /usr/local/include/
@solanoepalacio
solanoepalacio / print_colors.py
Created September 5, 2019 14:01
python ansi colors
def print_format_table():
"""
prints table of formatted text format options
"""
for style in range(8):
for fg in range(30,38):
s1 = ''
for bg in range(40,48):
format = ';'.join([str(style), str(fg), str(bg)])
s1 += '\x1b[%sm %s \x1b[0m' % (format, format)
Attaching to program: /home/solano.palacio/ardb/src/ardb-server, process 22474
[New LWP 22475]
[New LWP 22476]
[New LWP 22477]
[New LWP 22478]
[New LWP 22479]
[New LWP 22480]
[New LWP 22481]
[New LWP 22482]
[New LWP 22483]
solano.palacio@AR-IT03759: ~/ardb (master) $ cat gdb.log
GNU gdb (Ubuntu 7.11.1-0ubuntu1~16.5) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
solano.palacio@AR-IT03759: ~/ardb-leveldb (master) $ src/ardb-server
Warning: no config file specified, using the default config. In order to specify a config file use src/ardb-server /path/to/ardb.conf
[27278] 10-24 14:14:48,708 INFO Ardb init engine:leveldb success.
[27278] 10-24 14:14:48,709 INFO Ardb will accept connections on 0.0.0.0:16379
[27278] 10-24 14:14:48,710 INFO Ardb started with version 0.10.0
[27278] 10-24 14:15:00,718 INFO ========================Period Statistics Dump Begin===========================
[27278] 10-24 14:15:00,718 INFO coststat_info_all:calls=36,costs=144089,cost_per_call=4002,percents=100.0000%
[27278] 10-24 14:15:00,718 INFO coststat_info_range[1000-5000]:calls=33,costs=119993,cost_per_call=3636,percents=91.6667%
[27278] 10-24 14:15:00,718 INFO coststat_info_range[5000-10000]:calls=2,costs=14028,cost_per_call=7014,percents=5.5556%
[27278] 10-24 14:15:00,718 INFO coststat_info_range[10000-20000]:calls=1,costs=10068,cost_per_call=10068,percents=2.7778%
@solanoepalacio
solanoepalacio / forest-db-install.log
Created October 24, 2018 16:59
ardb-install-logs
solano.palacio@AR-IT03759: ~/ardb-forestdb (master) $ storage_engine=forestdb make
cd src && make all
make[1]: Entering directory '/home/solano.palacio/ardb-forestdb/src'
rm -f db/engine_factory.o
echo ">>>>> Dowloading JEMALLOC" && \
cd /home/solano.palacio/ardb-forestdb/src/../deps && \
wget -O /home/solano.palacio/ardb-forestdb/src/../deps/jemalloc-5.1.0.tar.bz2 https://github.com/jemalloc/jemalloc/releases/download/5.1.0/jemalloc-5.1.0.tar.bz2 && \
echo "<<<<< Done dowloading JEMALLOC"
>>>>> Dowloading JEMALLOC
--2018-10-24 13:25:12-- https://github.com/jemalloc/jemalloc/releases/download/5.1.0/jemalloc-5.1.0.tar.bz2