This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/foo | |
; then manually insert .pub key on the github account in settings > SSH and GPG keys > SSH keys | |
ssh-agent bash -c 'ssh-add ~/.ssh/foo; git clone [email protected]:username/repo_name.git' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const { fork } = require('child_process') | |
const app = express() | |
app.get('/', (req, res) => { | |
const name = req.query.name | |
const cp = fork('./greetings.js') // heavy task example | |
cp.send({ "name", name }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const limitter = require('express-rate-limit') | |
const helmet = require('helmet') | |
... | |
// middlewares | |
app.use( | |
limitter({ | |
windowMs: 5000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cluster = require('cluster') | |
const express = require('express') | |
// const compression = require('compression') | |
const os = require('os') | |
const app = express() | |
const port = 3000 | |
const ncpus = os.cpus().length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mediator = (() => { | |
const events = {}; | |
const subscribe = (event, fn) => { | |
if (!events[event]){ | |
events[event] = []; | |
} | |
events[event].push(fn); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; setup replica sets | |
mongod --port 27017 --dbpath ~/mongoc/db0 --replSet Replicante | |
mongod --port 27027 --dbpath ~/mongoc/db1 --replSet Replicante | |
mongod --port 27037 --dbpath ~/mongoc/db2 --replSet Replicante | |
; mongo --port 27017 | |
rs.initiate() | |
rs.add("localhost:27027") ; add second member | |
rs.add("localhost:27037") ; add third member |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; crear bot y grupo en telegram | |
agregar @BotFather en telegram para crear el bot, crea un grupo e invitalo | |
; consigue chatid desde la api de telegram usando el api token del bot | |
https://api.telegram.org/bot<TOKEN>/getUpdates | |
; enviar mensajes usando la api de telegram | |
https://api.telegram.org/bot<TOKEN>/sendMessage?chat_id=<CHATID>&parse_mode=Markdown&text=<MESSAGE>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; find all the files containing `topsykrettz` str in the current folder excluding `node_modules` dir | |
grep -iRl "topsykrettz" ./ | grep -v node_modules | |
; find all `mongodb+srv://` occurences in all git logs | |
git log|grep commit|cut -d' ' -f2|while read commit; do git show $commit; done| grep -i mongodb+srv:// | |
; monitor logs in realtime | |
tail -f logfile | |
; copy file content to clipboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, memory_profiler | |
i_mem = memory_profiler.memory_usage() | |
start = time.time() | |
myfunc() | |
end = time.time() | |
f_mem = memory_profiler.memory_usage() | |
elapsed = end - start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; csgofloat api | |
https://api.csgofloat.com/?url=steam://rungame/730/........................... | |
; query inicial | |
https://steamcommunity.com/market/search?appid=730&q=Case Hardened | |
https://steamcommunity.com/market/search/render/?query=Case Hardened&start=1&count=100&search_descriptions=0&sort_column=price&sort_dir=desc&appid=730&norender=1 | |
; listings por cada resultado del query inicial | |
https://steamcommunity.com/market/listings/730/★ Bayonet | Case Hardened (Battle-Scarred) | |
https://steamcommunity.com/market/listings/730/★ Bayonet | Case Hardened (Battle-Scarred)/render/?query=&start=0&count=100&country=US&language=english¤cy=1 |
NewerOlder