Skip to content

Instantly share code, notes, and snippets.

View jmilagroso's full-sized avatar
⌨️
ps aux | grep stress | awk '{print $2}' | xargs kill -9

jmilagroso jmilagroso

⌨️
ps aux | grep stress | awk '{print $2}' | xargs kill -9
  • PH
View GitHub Profile
@ganapathichidambaram
ganapathichidambaram / datasourcetocsv_operator.py
Created November 11, 2019 07:10
Airflow - Postgresql DataSource to CSV export
from airflow.hooks.postgres_hook import PostgresHook
from airflow.models import BaseOperator
from airflow.utils.decorators import apply_defaults
from datetime import datetime, timedelta
from os import environ
import csv
class DataSourceToCsvOperator(BaseOperator):
"""
@abacaphiliac
abacaphiliac / run-kafka-container.md
Last active January 21, 2024 12:10
Run Kafka Container

Start Kafka service

The following commands will start a container with Kafka and Zookeeper running on mapped ports 2181 (Zookeeper) and 9092 (Kafka).

docker pull spotify/kafka
docker run -d -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=kafka --env ADVERTISED_PORT=9092 --name kafka spotify/kafka

Why Spotify?

ADVERTISTED_HOST was set to kafka, which will allow other containers to be able to run Producers and Consumers.

@Kartones
Kartones / postgres-cheatsheet.md
Last active April 30, 2024 19:47
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@fideloper
fideloper / install.sh
Last active October 30, 2023 20:03
Vagrant Provisioning Script for PHP applications. This installs a LAMP stack.
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@nasirkhan
nasirkhan / git command.markdown
Last active May 12, 2022 03:17
`git` discard all local changes/commits and pull from upstream

git discard all local changes/commits and pull from upstream

git reset --hard origin/master

git pull origin master

@allwefantasy
allwefantasy / gist:3615650
Created September 4, 2012 01:43
jedis example
public class RedisClient {
private JedisPool pool;
@Inject
public RedisClient(Settings settings) {
try {
pool = new JedisPool(new JedisPoolConfig(), settings.get("redis.host"), settings.getAsInt("redis.port", 6379));
} catch (SettingsException e) {
// ignore