Skip to content

Instantly share code, notes, and snippets.

View igorzg's full-sized avatar
🎯
Focusing

igorzg igorzg

🎯
Focusing
View GitHub Profile
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
@igorzg
igorzg / fedora_gpu_passthroug_configs.md
Last active July 11, 2022 09:05
AMD Fedora GPU Passthrough

It's correct vfio configuration for GPU Passthrough, you will need to change ids to your GPU pci slot.

packages

sudo dnf group install virtualization

Verify IOMMU is enabled

dmesg | grep IOMMU
@igorzg
igorzg / debian_gpu_passthroug_configs.md
Last active July 8, 2022 10:39
AMD Ubuntu / Debian GPU Passthrough

It's correct vfio configuration for GPU Passthrough, you will need to change ids to your GPU pci slot.

packages

sudo apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-daemon-system libvirt-clients bridge-utils

Verify IOMMU is enabled

dmesg | grep IOMMU
@igorzg
igorzg / Microsoft.PowerShell_profile.ps1
Created November 18, 2021 21:35
Microsoft PowerShell profile
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@igorzg
igorzg / ohmyposh.json
Created November 18, 2021 21:01
Oh My Posh Theme
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
npm init
npm i --save-dev @types/node \
                 @types/jest \
                 @typescript-eslint/eslint-plugin \
                 @typescript-eslint/eslint-plugin-tslint \
                 @typescript-eslint/parser \
                 coveralls \
                 eslint \
 jest \
@igorzg
igorzg / CMakeLists.txt
Last active April 16, 2018 14:40
NodeJS native Cmake config - MacOS
cmake_minimum_required(VERSION 3.10)
project(NodeProject)
set(CMAKE_CXX_STANDARD 17)
file(READ $ENV{HOME}/.nvm/alias/default NODE_VER)
string(STRIP ${NODE_VER} NODE_VER)
set(LIBUV_VER "1.20.0")
set(LIBUV_PATH "/usr/local/Cellar/libuv/${LIBUV_VER}")
@igorzg
igorzg / AWS-Lambda-To-ElasticBeanStalk-Deployment-CodePipeLine.js
Created November 20, 2017 15:41
CodePipeline AWS Lambda to ElasticBeanstalk deployment
"use strict";
const util = require('util');
const AWS = require("aws-sdk");
/**
* Deploy env
* @param event
* @param context
* @param callback
* Example of params
@igorzg
igorzg / async_resolution.java
Created June 18, 2017 17:04
Jaxrs async marshaling feature reqeust
@Path("/{partner}/sync")
@Produces(MediaType.APPLICATION_JSON)
public class SyncResource {
@PathParam("partner") String partner;
@Inject SyncService syncService;
@igorzg
igorzg / dynamodb_dynamic_structure.java
Created March 24, 2017 14:21
Dynamodb dynamic low level api map converter
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConverter;
import com.amazonaws.services.dynamodbv2.document.internal.InternalUtils;
import com.amazonaws.services.dynamodbv2.model.AttributeValue;
import java.util.Map;
public class DynamicStructure implements DynamoDBTypeConverter<Map<String, AttributeValue>, Map<String, Object>> {
@Override
public Map<String, AttributeValue> convert(Map<String, Object> object) {