Skip to content

Instantly share code, notes, and snippets.

View ecelis's full-sized avatar
🏹
📷 🥊

Ernesto Celis ecelis

🏹
📷 🥊
View GitHub Profile
@ecelis
ecelis / gui.c
Created January 25, 2025 23:39
Simple X11 program
#include <X11/Xlib.h>
int main() {
XEvent event;
Display* display = XOpenDisplay(NULL);
Window w = XCreateSimpleWindow(display, DefaultRootWindow(display), 50, 50, 250, 250, 1, BlackPixel(display, 0), WhitePixel(display, 0));
XMapWindow(display, 0);
XSelectInput(display, w, ExposureMask);
for (;;) {
#!/usr/bin/env python3
"""
Git Time Analyzer - Enhanced Version
Based on original work by MiKatre (https://gist.github.com/MiKatre/0d6bdd4664cef1ed5d6d67ba531821b8)
Features:
- Commit size analysis
- Working hours consideration (including overnight shifts)
- Smart time allocation
@ecelis
ecelis / Xmodmap
Created January 11, 2025 19:10
Disable left CTRL and ALT keys for HP Pavillion dv5
# it will work only in systems with X11/X.org
# put this file in /etc/X11/Xmodmap
# If it is not loadaded at boot X init, you can load it manually
# xmodmap /etc/X11/Xmodmap
keycode 37 =
keycode 64 =
keycode 133 = Alt_L
@ecelis
ecelis / install_aseprite.sh
Created February 14, 2021 06:35 — forked from tobiasvl/install_aseprite.sh
The commands to build aseprite on Fedora
# Copied from https://github.com/aseprite/aseprite/blob/master/INSTALL.md#skia-on-linux
sudo yum install -y gcc-c++ cmake ninja-build libX11-devel libXcursor-devel mesa-libGL-devel fontconfig-devel
mkdir $HOME/deps
cd $HOME/deps
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
git clone -b aseprite-m71 https://github.com/aseprite/skia.git
export PATH="${PWD}/depot_tools:${PATH}"
cd skia
@ecelis
ecelis / Dockerfile
Last active June 3, 2020 19:44
Django Dockerfile
FROM python:3.8
COPY ./ /app
WORKDIR /app
RUN apt-get update -q && apt-get install -qy libmariadbclient-dev && \
pip install Django
CMD ["python", "manage.py", "runserver"]
@ecelis
ecelis / nginx_api_spa.conf
Created October 3, 2019 21:19
Nginx REST API and SPA configuration
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name _;
@ecelis
ecelis / provision_codedeploy_ec2ami
Created February 22, 2019 03:35
Provision CodeDeploy Agent to EC2 AWS AMI (RHEL/CentOS)
#!/bin/bash
sudo yum -y update
sudo yum -y install ruby
sudo yum -y install wget
cd /home/ec2-user/
wget https://aws-codedeploy-us-east-1.s3.amazonaws.com/latest/install
chmod +x ./install
sudo ./install auto
@ecelis
ecelis / cw-monitor-memusage.py
Last active March 21, 2018 20:09 — forked from shevron/LICENSE
Send EC2 instance memory usage stats to CloudWatch using boto and IAM Roles
#!/usr/bin/env python
'''
Copyright (c) 2015, Shahar Evron
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
@ecelis
ecelis / nginx_ssl_proxy.conf
Created February 10, 2018 20:28
Nginx SSL Proxy
server {
listen 443 ssl;
server_name _;
ssl_certificate /path/to/cert.crt;
ssl_certificate_key /path/to/cert.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
ssl_prefer_server_ciphers on;
ssl_session_cache shared:TLS:2m;
## Delete empty line from file
sed -i '/^$/d' <file.ext>
## Delete empty espace at the begining of line
sed -i '/^\s//g' <file.ext>
## Delete email prefix (address@)
sed -i -e 's/[[:alnum:]].\.*[[:alnum:]]*@//g' <file.ext>
## Delete only numbers line