Skip to content

Instantly share code, notes, and snippets.

View arturmartins's full-sized avatar
💭
I may be slow to respond.

Artur Martins arturmartins

💭
I may be slow to respond.
View GitHub Profile
@arturmartins
arturmartins / linode.output.yml
Created July 22, 2015 15:10
Created Linode server ansible : variable output
ok: [localhost] => {
"var": {
"linode": {
"changed": true,
"instance": {
"fqdn": "liXXXXXX.members.linode.com",
"id": LINODE_ID,
"ipv4": "LINODE_PUBLIC_IP",
"name": "LINODE_NAME",
"private": [],
@arturmartins
arturmartins / TCD-install-Bradford-Dissolvable-Agent.md
Created June 24, 2016 15:55
Install TCD Bradford Dissolvable Agent on MAC Yosemite

Instructions how to install the TCD Bradford Dissolvable Agent

(Trinity College Dublin (TCD) on a MACOS Yosemite)

  1. Download the zip file into Downloads folder
  2. Extract the zip file (Downloads/Bradford_Dissolvable_Agent.app)
  3. Open a terminal windown and run the command
sudo Downloads/Bradford_Dissolvable_Agent.app/Contents/MacOS/DissolvableAgent
@arturmartins
arturmartins / keybase.md
Created April 13, 2018 23:16
Keybase proof

Keybase proof

I hereby claim:

  • I am arturmartins on github.
  • I am arturmartins (https://keybase.io/arturmartins) on keybase.
  • I have a public key whose fingerprint is 5AD7 E464 F268 A96C A0DC B5B9 0BF4 27DB 2701 2336

To claim this, I am signing this object:

@arturmartins
arturmartins / postgres_queries_and_commands.sql
Created April 25, 2018 21:14 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Writing Post Mortems - John Allspaw

This talk is also known as ‘PostMortem Facilitation: Theory and Practice of "New View" Debriefings’ Background reading for attendees

@arturmartins
arturmartins / install_bucardo.sh
Created February 24, 2016 11:34
Install bucardo 5.4.1 in ubuntu 12.04 / 14.04 LTS
#!/bin/bash
# Based on the instructions in
# https://bucardo.org/wiki/Bucardo/Installation
# -------- configuration: Variables
BUCARDO_VERSION='5.4.1'
DOWNLOAD_URL="http://bucardo.org/downloads/Bucardo-${BUCARDO_VERSION}.tar.gz"
# -------------------------------
TEMP_FILE="/tmp/${RANDOM}.tar.gz"
@arturmartins
arturmartins / HelloWorld.sol
Created July 14, 2023 16:04
Ethereum Smart Contract - HelloWorld example
// SPDX-License-Identifier: MIT
pragma solidity 0.8.20;
// This defines a contract named “HelloWorld”.
//
// A contract is a collection of functions and data (its state).
// Once deployed, a contract will exist at an address on the Ethereum blockchain.
contract HelloWorld {
// This is a public function that returns the string “Hello World”.
@arturmartins
arturmartins / HelloWorld-2.sol
Last active July 14, 2023 16:11
Ethereum smart contract with set/get (not pure)
pragma solidity 0.8.20;
contract HelloWorld2{
string userInput;
function set(string memory finalValue) public
{
userInput = finalValue;
}
@arturmartins
arturmartins / etcd_install.sh
Created October 8, 2023 22:01
Script to download and install etcd for linux amd64
#!/bin/bash
# Utility to download latest etcd version for linux
SYSTEM_VERSION="linux-amd64"
fail(){
echo "[${0##*/}]: FATAL: ${@}"
exit 1
}
@arturmartins
arturmartins / webvtt2txt.py
Created October 26, 2023 10:53
Converts WEBVTT subtitles (vtt) to plain text.
#!/usr/bin/env python3
"""
Converts WEBVTT subtitles (vtt) to plain text.
It removes all time related info as well as duplicated and empty lines.
"""
# Author: Artur Martins <arturmartins@gmail.com>
# Version: 1.0
# Date: 2023-Oct-25