Skip to content

Instantly share code, notes, and snippets.

View ricardoccpaiva's full-sized avatar

Ricardo Paiva ricardoccpaiva

View GitHub Profile
@gnepud
gnepud / gist:98da812130ec79bf942e4e038b0ab02e
Created October 23, 2019 14:12
[Postgresql docker] PANIC: could not locate a valid checkpoint record
mkdir {pg_commit_ts,pg_dynshmem,pg_tblspc,pg_twophase,pg_stat,pg_stat_tmp,pg_replslot,pg_snapshots,pg_logical}
mkdir pg_logical/{snapshots,mappings}
mkdir pg_xlog/archive_status
docker run -it -v /path/to/postgres_data:/var/lib/postgres/data postgres:9.6 /bin/bash
gosu postgres pg_resetxlog -f /var/lib/postgres/data
@jkotchoff
jkotchoff / emailed_zip_file_extractor.rb
Created November 29, 2016 00:23
Rails example of how to connect to the Gmail API using Ruby and download a Zip File attachment and then unzip contents from the zip archive
class EmailedZipFileExtractor
# This class downloads an email from gmail and extracts a file out of a .zip attachment
require 'google/apis/gmail_v1'
require 'googleauth'
require 'zip'
# These credentials come from creating an OAuth Web Application client ID
# in the Google developer console
#
@pnc
pnc / observer.md
Last active September 9, 2023 23:32
Using Erlang observer/appmon remotely

Using OTP's observer (appmon replacement) remotely

$ ssh remote-host "epmd -names"
epmd: up and running on port 4369 with data:
name some_node at port 58769

Note the running on port for epmd itself and the port of the node you're interested in debugging. Reconnect to the remote host with these ports forwarded:

$ ssh -L 4369:localhost:4369 -L 58769:localhost:58769 remote-host