Skip to content

Instantly share code, notes, and snippets.

View nenodias's full-sized avatar

Horácio Dias Baptista Neto nenodias

View GitHub Profile
@nenodias
nenodias / ec2-apache.sh
Created December 8, 2020 18:33 — forked from herrera-ignacio/ec2-apache.sh
EC2 User data: install Apache web server for Amazon Linux 2 Image
#!/bin/bash
########################################
##### USE THIS WITH AMAZON LINUX 2 #####
########################################
# get admin privileges
sudo su
# install httpd (Linux 2 version)
@nenodias
nenodias / web-servers.md
Created April 15, 2020 19:40 — forked from willurd/web-servers.md
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
@nenodias
nenodias / pwm.cpp
Last active May 9, 2017 22:54 — forked from anonymous/pwd.cpp
Arduino lendo pino PWD
byte PWM_PIN = 11;
int pwm_value;
void setup() {
pinMode(PWM_PIN, INPUT);
Serial.begin(115200);
}
void loop() {
from abc import ABCMeta
from abc import abstractmethod
class LowerMeta(type):
"""Metaclass thats change the attr and method to be used
with lowercase"""
def __new__(lowerattr_Metaclass, future_ClassName,
@nenodias
nenodias / README.md
Last active December 9, 2016 14:16 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

identification division.
program-id. 99-bottles.
data division.
working-storage section.
77 max pic 9(02) value 99.
77 bottle-word pic x(07).
77 bottles pic 99.
@nenodias
nenodias / clientes.cob
Created November 3, 2016 13:47 — forked from guaracy/clientes.cob
Exemplo crud em cobol para cadastro de clientes
IDENTIFICATION DIVISION.
PROGRAM-ID. CLIENTES.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT FILE1 ASSIGN TO DISK
ORGANIZATION IS INDEXED
ACCESS MODE IS RANDOM
FILE STATUS IS FS-STAT
@nenodias
nenodias / process_name.py
Created November 2, 2016 18:14 — forked from hugoleodev/process_name.py
Retornando e alterando o nome do processo atual com python. Sem utilizar libs externas.
import time
import ctypes
from ctypes.util import find_library
# Instanciando a libc
libc = ctypes.CDLL(find_library('c'))
# Setando as flags para definir e retornar o
# o nome do processo
PR_SET_NAME = 15