Skip to content

Instantly share code, notes, and snippets.

View inawrath's full-sized avatar

Iván Nawrath Castillo inawrath

View GitHub Profile
@inawrath
inawrath / L3250_Reset.py
Created February 23, 2024 21:33 — forked from Bloody-Badboy/L3250_Reset.py
EPSON L3250 Series Waste Ink Counter Reset Using SNMP Protocol (Remove Service Required)
import re
from easysnmp import Session
from pprint import pprint
from struct import pack, unpack
printer_ip = "10.0.0.222"
session = Session(hostname=printer_ip, community="public", version=1, timeout=1)
password = [74, 54]
@inawrath
inawrath / create_user_in_postgresql.sql
Created September 11, 2023 12:40
Command to create a user in the PostgreSQL database and grant permissions only to a specific table
create user username with encrypted password 'password_to_user';
-- Permissions
GRANT SELECT ON TABLE database.public.table_db TO username;
@inawrath
inawrath / deploy-django.md
Last active November 6, 2021 04:11 — forked from rmiyazaki6499/deploy-django.md
Deploying a Production ready Django app on AWS

Deploying a Production ready Django app on AWS

In this tutorial, I will be going over to how to deploy a Django app from start to finish using AWS and EC2. Recently, my partner Tu and I launched our app Hygge Homes (a vacation home rental app for searching and booking vacation homes based off Airbnb) and we wanted to share with other developers some of the lessons we learned along the way.

Following this tutorial, you will have an application that has:

  • An AWS EC2 server configured to host your application
  • SSL-certification with Certbot
  • A custom domain name
  • Continuous deployment with Github Actions/SSM Agent
@inawrath
inawrath / Problem homebrew bigsur.md
Last active November 19, 2020 14:27
Problem homebrew bigsur
  1. Install Tools Xcode
  2. Run in terminal sudo xcode-select --switch /Library/Developer/CommandLineTools
  3. Profit

Alternative if first solution not working

  1. Download Xcode beta 12.3
  2. Install (double click)
  3. Run in terminal xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
  4. Profit
@inawrath
inawrath / open-tab.js
Created September 29, 2020 02:06
Open Tab in iOS Safari with JavaScript vanilla
const loadingPage = `
<style>
/*Huge thanks to @tobiasahlin at http://tobiasahlin.com/spinkit/ */
.spinner {
margin: 100px auto 0;
width: 70px;
text-align: center;
}
.spinner > div {
@inawrath
inawrath / install_php55_ubuntu.sh
Created March 28, 2020 03:28 — forked from jniltinho/ install_php55_ubuntu.sh
Install PHP 5.5.38 on Ubuntu 16.04 64Bits
#!/bin/bash
### Install PHP 5.5.38 on Ubuntu 16.04 64Bits
### https://www.howtoforge.com/tutorial/how-to-install-php-5-6-on-ubuntu-16-04/
apt-get -y install build-essential libxml2-dev libxslt1-dev
apt-get -y install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libxml2-dev
apt-get -y install libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
apt-get -y install libbz2-dev libcurl4-openssl-dev libjpeg-dev libpng12-dev
apt-get -y install libfreetype6-dev libkrb5-dev libpq-dev libicu-dev
@inawrath
inawrath / settings_sublime.json
Created November 28, 2018 13:16
Permute Unique lines sublime
{ "keys": ["f8"], "command": "permute_lines", "args": {"operation": "unique"} }
@inawrath
inawrath / clip.py
Created November 7, 2018 14:49
Copy to clipboard in IPython
from IPython.core.magic import register_line_magic
@register_line_magic
def clip(line):
global_dict = globals()
if not line in global_dict:
return
value = global_dict[line]
import os
os.system("echo '%s' | pbcopy" % str(value))
del clip
@inawrath
inawrath / index.html
Last active July 19, 2018 06:23
Example ReactJS
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNext Bin Sketch</title>
<!-- put additional styles and scripts here -->
<link href="https://fonts.googleapis.com/css?family=Glass+Antiqua" rel="stylesheet" type="text/css">
<!-- CSS Reset -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css">
@inawrath
inawrath / example.js
Created June 26, 2018 16:03
Multiple request axios
axios.all([
axios.get('http://google.com'),
axios.get('http://apple.com')
])
.then(axios.spread((googleRes, appleRes) => {
// do something with both responses
});