Skip to content

Instantly share code, notes, and snippets.

View vinnix's full-sized avatar
🥄

Vinícius Abrahão Bazana Schmidt vinnix

🥄
View GitHub Profile
@vinnix
vinnix / fb_ok.dns
Created December 10, 2012 23:38
Facebook's DNS is working at Sao Paulo/Brazil
vnxs:~ Vinnix$ dig www.facebook.com
; <<>> DiG 9.4.3-P3 <<>> www.facebook.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19911
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.facebook.com. IN A
vinicius.schmidt@dls110:~$ export PGSERVICE=a4c_dump_test
vinicius.schmidt@dls110:~$ psql9
psql9 (9.2.1, server 9.1.5)
WARNING: psql9 version 9.2, server version 9.1.
Some psql features might not work.
Type "help" for help.
a4c_dump_test=> \d
No relations found.
a4c_dump_test=> \l

Preparing Jboss environment

Create Jboss user and group

Create a group for a system user (daemnos and program users like www-data, mysql...)

# addgroup --system jboss

Create a user (system user, without home -> See below the command, to the jboss group and no login shell)

@vinnix
vinnix / myLilLibrary.c
Created October 30, 2013 16:03
Exemplo de biblioteca em linguagem C, para utilizar dentro do PostgreSQL / plpgsql.
#include "postgres.h"
#include <sys/file.h>
#include <sys/stat.h>
#include <unistd.h>
#include "catalog/pg_type.h"
#include "funcapi.h"
#include "miscadmin.h"
#include "postmaster/syslogger.h"
@vinnix
vinnix / example.md
Created November 27, 2015 13:49 — forked from kkung/example.md
Getting AWS RDS Log files
$ python get_logs.py rds-db-instance-name rds.log aws-access-key aws-secret-key
$ ./pgbadger -p '%t:%r:%u@%d:[%p]:' ./rds.log

$ open out.html

@vinnix
vinnix / json_manipulator.sql
Created September 10, 2016 17:19 — forked from wsdookadr/json_manipulator.sql
Simple PostgreSQL functions to manipulate json objects. (Note: performance is not a concern for those functions)
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
@vinnix
vinnix / json_manipulator.sql
Created September 10, 2016 17:20 — forked from matheusoliveira/json_manipulator.sql
Simple PostgreSQL functions to manipulate json objects. (Note: performance is not a concern for those functions)
CREATE OR REPLACE FUNCTION public.json_append(data json, insert_data json)
RETURNS json
IMMUTABLE
LANGUAGE sql
AS $$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
@vinnix
vinnix / valgrind_bitcoind.log
Last active December 26, 2017 02:48
Result of potential memleak using bitcoin-qt
$ ./bitcoin-qt --version
Bitcoin Core version v0.15.99.0-5180a86 (64-bit)
Copyright (C) 2009-2017 The Bitcoin Core developers
[vinnix@vnxsam bin]$ valgrind --leak-check=full --show-leak-kinds=all --leak-check=yes ./bitcoind
==2817== Memcheck, a memory error detector
==2817== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==2817== Using Valgrind-3.12.0 and LibVEX; rerun with -h for copyright info
==2817== Command: ./bitcoind
==2817==
@vinnix
vinnix / gist:cbc1e5ed8819d465107932e9a23606f0
Created March 3, 2018 11:49 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
##
## Trying to learn something from here:
## http://profmarcello.blogspot.com/search/label/PostGIS%20Raster
##
## Bottom (past) -> Top(now) worklog chronology
-- Using 2nd patch!