Skip to content

Instantly share code, notes, and snippets.

View niradler's full-sized avatar
🎮

Nir Adler niradler

🎮
View GitHub Profile
@niradler
niradler / elastic_stack.sh
Created December 22, 2018 14:25
elastic stack installation on ubuntu
# https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04
# https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-18-04
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
# https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-on-ubuntu-18-04#installing-the-oracle-jdk
# https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elastic-stack-on-ubuntu-18-04
# install nginx
sudo apt update
sudo apt install nginx
sudo ufw app list
@niradler
niradler / bash_profile
Created December 26, 2018 15:22
add alias mac sudo nano ~/.bash_profile
alias l='ls -lah'
alias gac='git add . && git commit -am'
alias gi='git init && gac "init"'
alias gc='git checkout'
alias glo='git pull origin'
alias gd='gc develop && glo develop && gc master && glo master && git merge develop && git push'
alias prt='prettier --write ./*.js'
mkdir -p src/components/$1
touch src/components/$1/$1.scss
sed -e "s/COMPONENT_NAME/$1/g" ~/code_templates/component.js > src/components/$1/index.js
@niradler
niradler / serverless-policy.json
Created April 16, 2019 14:14
serverless policy for aws sort by resource type.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "edit0",
"Effect": "Allow",
"Action": [
"lambda:CreateFunction",
"lambda:List*",
"lambda:Get*",
@niradler
niradler / apigateway export
Created April 22, 2019 23:28
export docs from apigateway
//https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/APIGateway.html#getExport-property
const fs = require("fs");
const AWS = require("aws-sdk");
const path = require("path");
const apigateway = new AWS.APIGateway({
apiVersion: "2015-07-09",
region: "us-east-1"
});
const getExport = params => {
@niradler
niradler / create_code_template.sh
Created April 29, 2019 09:56
Make Your Own React CLI with Bash
# ~/code_templates/component.js
import React from 'react';
import './COMPONENT_NAME.scss';
function COMPONENT_NAME() {
return <div>Hello</div>;
}
export default COMPONENT_NAME;
@niradler
niradler / bash_arguments .sh
Created April 29, 2019 09:58
How to parse command line arguments using Bash case statements
#!/bin/bash
echo "Starting sctipt $0"
display_usage() {
echo
echo "Usage: $0"
echo
echo " -h, --help Display usage instructions"
echo " -p, --print Print welcome message"
echo
}
@niradler
niradler / resolve_promises_sequentially.js
Created May 1, 2019 11:38
resolve promises sequentially with reduce.
function resolveSequentially(promisesArray) {
return promisesArray.reduce((accumulatorPromise, promise) => {
return accumulatorPromise
.then(() => {
return promise;
})
}, Promise.resolve());
}
@niradler
niradler / After_Installing_Kali.sh
Created May 5, 2019 20:28
The Top 10 Things to Do After Installing Kali Linux on Your Computer
# update & upgrade
sudo apt update && apt upgrade
# create user
adduser <username>
# install packages
apt install tilix maltego metasploit-framework burpsuite wireshark aircrack-ng hydra nmap beef-xss nikto
# install tor
@niradler
niradler / npmjs_api.txt
Created June 2, 2019 20:28
how to get npm info
get detail for package: https://registry.npmjs.org/object-remap
get detail for package by veriosn: https://registry.npmjs.org/object-remap/0.0.8
https://github.com/npm/registry/blob/master/docs/download-counts.md
https://api.npmjs.org/downloads/point/2000-01-01:3000-01-01/object-remap
http://registry.npmjs.org/-/package/babel-core/dist-tags
https://api.npms.io/v2/search?q=cross+spawn
https://api.npms.io/v2/package/react