Skip to content

Instantly share code, notes, and snippets.

View VictorNS69's full-sized avatar
🖥️
\_(º-º)_/

Víctor Nieves Sánchez VictorNS69

🖥️
\_(º-º)_/
View GitHub Profile
@VictorNS69
VictorNS69 / .bashrc
Last active September 9, 2019 15:45
Just add these lines to your .bashrc to see in which branch you are working
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
export PS1="${PS1:0:${#PS1}-3}\$(git_branch)\$ "
@VictorNS69
VictorNS69 / virtualenv.md
Last active March 15, 2024 02:47 — forked from miranda-zhang/virtualenv.md
How to install virtualenv and virtualenvwrapper

Install virtualenv and virtualenvwrapper

Install both packages:

sudo apt install virtualenvwrapper
sudo apt install virtualenv

(recomended if have multiple apps running on different enviroments)

$ pip3 install virtualenv

@VictorNS69
VictorNS69 / README-Template.md
Created July 30, 2019 12:53 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@VictorNS69
VictorNS69 / Docker-as-a-non-root-user.md
Last active July 13, 2024 01:12
Manage Docker as a non-root user

Manage Docker as a non-root user

The Docker daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user root and other users can only access it using sudo. The Docker daemon always runs as the root user.

If you don’t want to preface the docker command with sudo, create a Unix group called docker and add users to it. When the Docker daemon starts, it creates a Unix socket accessible by members of the docker group.

Warning: The docker group grants privileges equivalent to the root user. For details on how this impacts security in your system, see Docker Daemon Attack Surface.

Note: To run Docker without root privileges, see Run the Docker daemon as a non-root user (Rootless mode) .

@VictorNS69
VictorNS69 / getPublicKey.js
Last active April 1, 2021 09:35
How to get the public key from a keystore private key in JavaScript
/* Example of how to obtain the public key through
* a private key using a keystore
*/
/* Requires needed. You have to install the following
* packages
* npm install ethereumjs-wallet@1.0.1 keythereum@1.2.0
*/
const Wallet = require('ethereumjs-wallet')
const keythereum = require('keythereum')
@VictorNS69
VictorNS69 / A hack for showing LaTeX formulas in GitHub markdown.md
Last active January 19, 2024 11:47
How to add LaTex formula to a Markdown
@VictorNS69
VictorNS69 / get_address_from_pubk.py
Last active March 10, 2020 15:17
How to get the address from a public key in Python
#!/usr/bin/env python3
"""
You will need to install the pycryptodome package.
You can do it with:
pip3 install pycryptodome
Note: To install pip3, run the following command
sudo apt install python3-pip
"""
@VictorNS69
VictorNS69 / publicKeyTx.js
Created March 10, 2020 15:16
How to get the public key that signed the transaction in JavaScript
/* Example of how to obtain the public key that
* signed the Tx
*/
/* Requires needed. You have to install the following
* packages
* npm install ethereumjs-util ethereumjs-tx
*/
const ethereumTx = require('ethereumjs-tx').Transaction;
const eth_util = require('ethereumjs-util')
@VictorNS69
VictorNS69 / create_eth_keystore.js
Last active August 20, 2021 07:28
Creates a new Ethereum Keystore
// Usage: node create_eth_keystore.js
// Node v10+
// Dependencies
// npm i ethereumjs-wallet@0.6.3
const Wallet = require('ethereumjs-wallet')
const accountPassword = "" // Put here the password you want for your keystore
const key = Wallet.generate(accountPassword)
const privateKey = key._privKey
@VictorNS69
VictorNS69 / fakeRedirect.py
Created October 6, 2021 18:54
FakeRedirect server with Python 3
#!/usr/bin/env python3
from http.server import HTTPServer, BaseHTTPRequestHandler
# Open netcat on port 6969
# nc -lvnp 6969
REDIRECT_URL = f"http://localhost:6969"
LISTENER_PORT = 8080
class FakeRedirect(BaseHTTPRequestHandler):