Skip to content

Instantly share code, notes, and snippets.

View mariocesar's full-sized avatar

Mario-César mariocesar

View GitHub Profile
@ajcerejeira
ajcerejeira / Makefile
Last active October 17, 2022 23:22
(Ab)using Makefiles in Django projects
# Lightning talk @ DjangoCon EU 2022
# Afonso Cerejeira <github.com/ajcerejeira>
# Intro
# =====
#
# - Makefiles are a set of rules for building targets based on prerequisites;
# - Usually both targets and prerequisites represent filenames;
# - Makefiles define dependency graphs;
@kuzemkon
kuzemkon / main.tf
Last active June 18, 2024 09:47
AWS ECS events CloudWatch metrics gathering Terraform
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 4.0"
}
}
}
provider "aws" {

Autoscaling色々

はじめに

  • autoscaling全般についてはなします
  • terraformのコードがいっぱい出てきます

はなすこと

  • application autoscaling
@txoof
txoof / HomeBrew_w_TK.md
Last active April 18, 2024 15:59
Setup python with tkinter under homebrew
# Standard Library
import re
# Third Party Stuff
from django.db import models
from django.contrib.postgres.indexes import GinIndex
from django.contrib.postgres.search import (
SearchQuery,
SearchRank,
SearchVector,
@tomhicks
tomhicks / plink-plonk.js
Last active July 26, 2024 01:10
Listen to your web pages

psqlrc:

  • some infos at initial connect
  • predefined queries in ~/.psqlrc-include/ compiled by the _update.sh script into ~/.psqlrc-commands.sql which will be included within .psqlrc

image

typical worksetup:

  • portforwarding from remote to local host via ssh user@host -L 5432:127.0.0.1:5432
# disable the file picker
driver.execute_script("""
HTMLInputElement.prototype.click = function () {
if (this.type !== 'file') {
HTMLElement.prototype.click.call(this);
}
else if (!this.parentNode) {
this.style.display = 'none';
this.ownerDocument.documentElement.appendChild(this);
@elnygren
elnygren / snowflake.sql
Last active November 17, 2022 21:14
PostgreSQL generate unique sorted IDs for timestamps
-- taken from https://rob.conery.io/2014/05/28/a-better-id-generator-for-postgresql/
create schema idgen;
create sequence idgen.global_id_sequence;
CREATE OR REPLACE FUNCTION idgen.id_generator(
myts timestamp,
OUT result bigint) AS $$
DECLARE
our_epoch bigint := 1314220021721;
@mariocesar
mariocesar / README.md
Last active May 6, 2019 13:16
Annoying a sysadmin

Petty things that annoy a Sysadmin, also a How-To avoid madding yourself by remembering Petty things that will annoy you.

Subtle disabling of loading a .bashrc when connecting with ssh.

sysadmin says: My .bashrc file is not loading!

You could make a sysadmin expend hours trying to debug a .bashrc just by creating and empty .bash_profile in the home directory, this will override the loading of .bashrc and load the instructions in the .bash_profile instead.