Skip to content

Instantly share code, notes, and snippets.

View marcoemorais's full-sized avatar

Marco Morais marcoemorais

  • Yahoo!, AWS, NVIDIA
  • Santa Clara
View GitHub Profile
@weakish
weakish / backup-providers.md
Last active August 30, 2024 09:57
reviews of vps, storage, mail forward
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active May 11, 2025 00:12
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), 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(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@willurd
willurd / web-servers.md
Last active May 10, 2025 14:01
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@yihuang
yihuang / uwsgi-gevent-benchmark.rst
Last active July 17, 2019 10:20
uwsgi gevent benchmark
CPU:Intel(R) Xeon(R) CPU E5-2620 0 @ 2.00GHz (X8)
OS:debian7
PYTHON:python2.7.3
GEVENT:gevent-1.0rc1
UWSGI:1.9.15-dev

hello world

@martijnvermaat
martijnvermaat / ssh-agent-forwarding-screen.md
Created December 21, 2013 15:06
SSH agent forwarding and screen

SSH agent forwarding and screen

When connecting to a remote server via SSH it is often convenient to use SSH agent forwarding so that you don't need a separate keypair on that server for connecting to further servers.

This is enabled by adding the

ForwardAgent yes

option to any of your Host entries in ~/.ssh/config (or alternatively with the -A option). Don't set this option in a wildcard Host * section since any user on the remote server that can bypass file permissions can now als use keys loaded in your SSH agent. So only use this with hosts you trust.

@afolarin
afolarin / docker-log-gist.md
Last active March 16, 2023 13:02
docker-logs
@jqtrde
jqtrde / modern-geospatial-python.md
Last active August 1, 2023 14:50
Modern remote sensing image processing with Python
@narutaro
narutaro / Nerdtree in docker container.md
Last active February 14, 2019 01:17
Nerdtree in docker container

Nerdtree in docker container

Symptom

  • In the tree view of nerdtree, you see ?~V? instead of arrow shape.

Possible reason

  1. vim is not installed but vi
  2. The locale setting is wrong

Solutions

@kyrs
kyrs / opencv_tensor.cc
Last active February 15, 2024 12:44
File Takes an Image Mat file as an input and convert it to tensor.
/*
Following file take opencv mat file as an input and run inception model on it
Created by : Kumar Shubham
Date : 27-03-2016
*/
//Loading Opencv fIles for processing
#include <opencv2/opencv.hpp>
@hlissner
hlissner / codesign_gdb.md
Last active September 29, 2024 00:25
Codesign gdb on OSX