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
| Docker Commands : | |
| $ sudo tail -f $(docker inspect --format='{{.LogPath}}' $(docker ps -a | grep "chrome" |awk '{print $1}')) > result.txt | |
| $ docker images --format '{{.Size}}\t{{.Repository}}\t{{.Tag}}\t{{.ID}}' | sed 's/ //' | sort -h -r | |
| $ docker rmi $(docker images --format '{{.ID}}' | sort -h -r) | |
| $ docker rm -f $(docker ps -a | grep -E "hub|chrome" |awk '{print $1}') | |
| $ docker rm -f $(docker ps -a | grep "chrome" |awk '{print $1}') | |
| $ docker rm -f $(docker ps | grep -E "chrome|hub" |awk '{print $1}') | |
| $ docker run -d -p 4444:4444 --name selenium-hub selenium/hub:3.8.1 |
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
| var express = require('express'); | |
| var router = express.Router(); | |
| var multer = require('multer') | |
| var upload = multer({ dest: 'uploads/' }) | |
| router.post('/Upload', upload.single('file'), function (req, res, next) { | |
| console.log(req.body); //form fields | |
| console.log(req.file); //form files | |
| /* example output: | |
| { fieldname: 'upl', | |
| originalname: 'grumpy.png', |
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
| 1. Locust | |
| performance.py | |
| from locust import HttpLocust, TaskSet, task | |
| class UserBehavior(TaskSet): | |
| def on_start(self): | |
| """ on_start is called when a Locust start before any task is scheduled """ | |
| #self.login() | |
| @task(1) | |
| def three(self): |
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
| var jsdiff = require('diff'); | |
| var _ = require('lodash'); | |
| var b = "I'm from Chennai.\n" + | |
| "Live in: mylapore\n" + | |
| "post graduates: [Degree]"; | |
| var a = "I'm from Chennai.\n" + | |
| "Live in: [Location]\n" + | |
| "post graduates: [Degrees]"; |
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 { describe, it } from 'mocha'; | |
| import { expect } from 'chai'; | |
| import _ from 'lodash'; | |
| var path = require('path'), | |
| fs = require('fs'); | |
| function executeFunctionAtRuntime(func) | |
| { | |
| var args = []; | |
| for (var i = 1; i < func.length; i++) |
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
| Linux Tools: | |
| chroot, namespace, cgroups, unshare, cgcreate, nsenter | |
| Blogs: | |
| https://jvns.ca/blog/2016/10/10/what-even-is-a-container/ |
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
| 1. Installing | |
| https://www.digitalocean.com/community/tutorials/how-to-install-puppet-4-on-ubuntu-16-04 | |
| 2. cd /etc/puppetlabs/code/environments/production/manifests | |
| 2.1 site.pp | |
| file {'/tmp/it_works.txt': # resource type file and filename | |
| ensure => present, # make sure it exists | |
| mode => '0644', # file permissions | |
| content => "It works on ${ipaddress_eth0}!\n", # Print the eth0 IP fact | |
| } | |
| 2.2 pack.pp |
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
| https://codesandbox.io/s/lxxj11qqym | |
| import React from "react"; | |
| import PropTypes from "prop-types"; | |
| import { render } from "react-dom"; | |
| const reducers = (state = {}, action) => { | |
| switch (action.type) { | |
| case "initiate": | |
| return Object.assign({ number: 0 }, state); | |
| case "add": |
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
| iftop | |
| tcpdump | |
| SolarWinds Deep Packet Inspection and Analysis Tool (FREE TRIAL) | |
| Paessler Packet Capture Tool (FREE TRIAL) | |
| tcpdump | |
| Windump | |
| Wireshark | |
| tshark | |
| Network Miner | |
| Fiddler |
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
| 1. defineProperty | |
| const object1 = {}; | |
| Object.defineProperty(object1, 'property1', { | |
| value: 42, | |
| writable: false | |
| }); | |
| object1.property1 = 77; | |
| // throws an error in strict mode |