Skip to content

Instantly share code, notes, and snippets.

View h3ct0rjs's full-sized avatar
:shipit:

Héctor F. Jiménez. S h3ct0rjs

:shipit:
View GitHub Profile
@h3ct0rjs
h3ct0rjs / README.rst
Created August 22, 2019 20:18 — forked from offlinehacker/README.rst
Script that learns openvpn hostnames from cert CN filed

ovpn-learnaddress

openvpn learn-address script to manage a hosts-like file

  • intended to allow dnsmasq to resolve openvpn clients
  • written for openwrt (busybox), but should work most anywhere

How it works?

Generally databases are best for data and the file system is best for files. It depends what you're planning to do with the image though.

If you're storing images for a web page then it's best to store them as a file on the server. The web server will very quickly find an image file and send it to a visitor. Sending files to visitors is the main job of a web server.

If you were to store the same image in a database then the amount of steps to get to this image is greatly increased so the image will be slower to download. Also it will use up more server resources. The web server will have to connect to the database and then query the database to get the image, download the image from the database and then send the visitor the image.

This will also tie up the database a little bit while it sends the image. It might not be a problem if your web site is not high traffic but as soon as you start getting a lot of visitors then you'll quickly notice the slowness. Storing files isn't really what databases were mad

@h3ct0rjs
h3ct0rjs / learning-path.md
Created April 17, 2019 18:41
You can do more good by being good than any other way. run from being good. Chase being great.

Learning Path Nodejs

Because being good at something depends only on you, discipline, automativation and hard study, obviously this can not be done if you don't have the proper support ❤️

This is a list of the things that I'm studying to become proeficient in nodejs and some framework(not decided yet but possible vue) stack development.

  • JavaScript concept Review(3weeks, 4hrs daily):
    • Control Flow
    • Loops
  • Datastructures Object manipulation

Notes

nodejs owns global objects as the following in javascript:

console.log()

setTimeOut() # set a timer delay in the client, server, browser
clearTimeOut()
@h3ct0rjs
h3ct0rjs / ES6-Setup.md
Last active April 7, 2019 23:19 — forked from rahman541/ES6-Setup.md
ES6 Setup with nodemon

ES6 Setup

npm init -y
npm i --save-dev nodemon
npm add babel-preset-env babel-cli

Create a .babelrc config in your project root. Insert the following

{
 "presets": ["env"]
#hfjimenez@utp.edu.co
#Create user with pass and add it to the admin group.
$Username =Read-Host -Prompt 'Username for windows Account'
$Pass = Read-Host -AsSecureString -Prompt 'Enter your password'
New-LocalUser $Username -Password $Pass -FullName "Automatic" -Description "Admin User"
Add-LocalGroupMember -Group "Administrators" -Member $Username
@h3ct0rjs
h3ct0rjs / comprehension.json
Created March 26, 2019 13:04
tmp for ctrap python snippets
{
"List comprehension": {
"prefix": "lc",
"body": "[${1:value} for ${2:value} in ${3:iterable}]$0",
"description" : "list comprehension for creating a list based on existing lists"
},
"List comprehension if else": {
"prefix": "lcie",
"body": "[${1:value} if ${2:condition} else ${3:condition} for ${4:value} in ${5:iterable}]$0",
"description" : "list comprehension for creating a list based on existing lists, with conditional if else statement"
@h3ct0rjs
h3ct0rjs / main.py
Created March 8, 2019 20:41
test small db instance.
from src.utils import Database
struct = {}
def main():
struct['host'] = input('Ingrese el hostname: ')
struct['port'] = input('Ingrese el puerto ')
struct['dbname'] = input('Ingrese el dbname ')
struct['user'] = input('Ingrese el user')
struct['password'] = input('Ingrese el password')
#print(struct) #debug
@h3ct0rjs
h3ct0rjs / homeworks.md
Last active April 15, 2019 15:58
Meloo homework.s The idea with this homeworks, exercises, test is to become the best version of yourself, I think that the best way is practice with discipline, practice and more practice. With the proper guideness you can be better and better every day, If you have the proper motivation and empower yourself you my ❤️

Week1

In this week we're going to reinforce a few concepts and improve the tool usage. Your task this week is do the following:

  • ~~Learn to use a couple of editors, Sublime Text check this course and this ~~

one for vscode.

You can use code samples from internet or your own python scripts. check this out

  • ~~Learn to use code snippets in your own code editor. ~~
@h3ct0rjs
h3ct0rjs / change.js
Last active January 23, 2019 16:59
udp test with socket io
//Client implementation.
const WebSocket = require('ws')
const data = '*GS06,358077090893138,151701291218,,SYS:SP4603NS;V2.31;V1.1.8,GPS:A;12;N6.041337;W75.412624,COT:60855,ADC:11.59;3.73,DTT:0;E0;;;0;1#';
const io = require('socket.io-client');
const reconnectInterval = 10 * 1000 * 60;
const connect = (dato) =>{
let timestamp = Math.floor(Date.now() /1000); //epoch unix.
const url = 'http://127.0.0.1:5000'
try {