Skip to content

Instantly share code, notes, and snippets.

@devfraga
devfraga / modelo.md
Created May 6, 2024 21:58
Modelo contato freela

Modelo e-mail

Modelo 1


Assunto: Alcance mais clientes para sua empresa de forma eficaz.

Olá [Nome do Proprietário] ou [Empresa],

@mdonkers
mdonkers / server.py
Last active May 6, 2024 23:32
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@liam-russell
liam-russell / Readme.md
Last active May 6, 2024 23:30
TP-Link Kasa Smart Plug - get energy consumption statistics as a CSV file

TP-Link Kasa Smart Plug - get energy consumption statistics as a CSV file

Background

The TP Link Kasa smart switches log energy consumption data over time, however the app is very limited and won't let you get out data, graph it or see historical usage. This script extracts and saves to a CSV file.

The python-kasa library is used to communicate with the Kasa switch.

Requirements

  • Python must be installed
  • You must be on the same wifi network as the Kasa switch
@russellmcc
russellmcc / fish.el
Last active May 6, 2024 23:29
How to use fish shell paths from emacs
(let*
((fish-path (shell-command-to-string "/opt/homebrew/bin/fish -i -c \"echo -n \\$PATH[1]; for val in \\$PATH[2..-1];echo -n \\\":\\$val\\\";end\""))
(full-path (append exec-path (split-string fish-path ":"))))
(setenv "PATH" fish-path)
(setq exec-path full-path))
@theskumar
theskumar / restricted_usernames.py
Created April 9, 2015 06:48
Restricted usernames
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
'''
List of reserved usernames (pre-defined list of special banned and reserved keywords in names,
such as "root", "www", "admin"). Useful when creating public systems, where users can choose
a login name or a sub-domain name.
__References:__
1. http://www.bannedwordlist.com/
2. http://blog.postbit.com/reserved-username-list.html
@MyITGuy
MyITGuy / file01.ps1
Last active May 6, 2024 23:21
PowerShell: Get-MsiProducts / Get Windows Installer Products
function Get-MsiProducts {
function Get-MsiUpgradeCode {
[CmdletBinding()]
param (
[System.Guid]$ProductCode
,
[System.Guid]$UpgradeCode
)
function ConvertFrom-CompressedGuid {
@zytek
zytek / README.md
Last active May 6, 2024 23:16
Terraform to manage AWS RDS PostgreSQL databases, users and owners

Terraform vs PostgreSQL RDS

Thanks to new resources (postgresql_default_priviledges) and some fixes Terraform can now add new databases and manage ownership / access to them.

This example creates new database and two users. You can use owner to create new tables and run migrations and user for normal read/write access to database.