Skip to content

Instantly share code, notes, and snippets.

View aug2uag's full-sized avatar

Reza Fatahi aug2uag

  • Los Angeles, CA
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aug2uag
aug2uag / sentence_similarity.py
Created July 3, 2022 07:28 — forked from talhaanwarch/sentence_similarity.py
CALCULATE SENTENCE SIMILARITY using Pretrained BERT model
# -*- coding: utf-8 -*-
"""
Created on Fri Jun 11 18:58:05 2021
# CALCULATE SENTENCE SIMILARITY
@author: TAC
"""
import torch#pytorch
from transformers import AutoTokenizer, AutoModel#for embeddings
from sklearn.metrics.pairwise import cosine_similarity#for similarity
@aug2uag
aug2uag / socket.ioExpress.md
Last active January 4, 2022 07:20 — forked from patrickbrandt/socket.io_Express_Angular.md
socket.io Express routes

Create socket.io middleware

Include the following code in your app.js module (other standard Express module dependancies and middleware left out for brevity):

var express = require('express');
var http = require('http');
var io = require('socket.io');
var routes = require('./routes/index');

var app = express();

Linksys EA4500 Firmware Decryption

I recently pulled a Linksys EA4500 out of storage for evaluation. The first thing I wanted to do was to update the firmware for the device. https://www.linksys.com/us/support-article?articleNum=148385 offers the latest version of the firmware, which is 3.1.7 as of this writing.

However, we can see with the filename that its probably encrypted: FW_EA4500V3_3.1.7.181919_prod.gpg.img

When I run binwalk I don't get any meaningful results, confirming my suspcicions:

reverse R33-sysupgrade-20180510-910b5192.bin

file

Just to make sure it is a firmware image instead of a zip file:

1

strings

@aug2uag
aug2uag / installing-get-on-centos.md
Last active January 17, 2021 00:58 — forked from bradlucas/installing-get-on-centos.md
Installing Geth on Centos

This document installs Go LTS (1.13) as of the time it is written

1) Install Go (Git should already be installed)

$ cd /tmp/
$ wget https://dl.google.com/go/go1.13.linux-amd64.tar.gz
$ sha256sum go1.13.linux-amd64.tar.gz  # should end with "c48e856"
$ sudo tar -C /usr/local -xzf go1.13.linux-amd64.tar.gz
@aug2uag
aug2uag / interval.py
Created November 14, 2020 07:11 — forked from bbengfort/interval.py
Run a function every n seconds using Python threading.
from threading import Timer
from functools import partial
class Interval(object):
def __init__(self, interval, function, args=[], kwargs={}):
"""
Runs the function at a specified interval with given arguments.
"""
self.interval = interval
@aug2uag
aug2uag / basic_boto_script.py
Created August 31, 2020 22:26
basic_boto_script
import io
import scp
import paramiko
import boto3
import logging
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s :: %(levelname)s :: %(message)s')
boto_logger = logging.getLogger('boto_logger')
###################### Private Stuff
@aug2uag
aug2uag / Setup & Install
Created November 5, 2019 08:45 — forked from dhavaln/Setup & Install
Setting up HAProxy on Mac OSX
Install HAProxy from Homebre:
`brew install haproxy`
For full reference:
https://serversforhackers.com/load-balancing-with-haproxy
@aug2uag
aug2uag / singleton.go
Created November 5, 2019 08:41 — forked from adohe-zz/singleton.go
Golang singleton implementation
package singleton
import (
"sync"
)
type singleton struct {
}
var instance *singleton