Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
<Coding />

Andrea Sonny andreasonny83

:octocat:
<Coding />
View GitHub Profile
@andreasonny83
andreasonny83 / curl.md
Created Sep 24, 2020 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@andreasonny83
andreasonny83 / kali_osx_persistence_wifi.md
Created Sep 15, 2020 — forked from widdowquinn/kali_osx_persistence_wifi.md
Kali Linux Live USB with persistence and wireless on Macbook Pro
View kali_osx_persistence_wifi.md

Kali Linux Bootable USB with Persistence and Wireless on OSX

Download the appropriate Kali Linux .iso

I used a 64 bit .iso image, downloaded via HTTP. I downloaded the amd64 weekly version, as the pool linux headers (needed below for installation of wireless drivers) were ahead of the stable release kernel.

Download the SHA256SUMS and SHA256SUMS.gpg files from the same location.

@andreasonny83
andreasonny83 / flatMap.js
Created Sep 21, 2019
Flat an array recursively
View flatMap.js
const _ = require('lodash');
const x = [1, [2, 3, 4, [5, 6]], 7];
const flat = (input) => Array.isArray(input) ? _.flatMap(input, item => flat(item)) : input;
const y = flat(x)
y // [1, 2, 3, 4, 5, 6, 7]
@andreasonny83
andreasonny83 / README.md
Created Jul 20, 2019
Run node app in background
View README.md

Run node app in background

Running a script in the background in linux can be done using nohup, using nohup we can run node application in the background

$ nohup node server.js > /dev/null 2>&1 &
  • nohup means: Do not terminate this process even when the stty is cut off
  • > /dev/null means: stdout goes to /dev/null (which is a dummy device that does not record any output)
@andreasonny83
andreasonny83 / RELEASE-NOTES.md
Last active Aug 25, 2021
Release Notes Template
View RELEASE-NOTES.md

Release Notes Template

Based off https://palantir.quip.com/pzRwAVr1bpzf

Pro-tip: look through the github diff between the previous release to see what's changed. The commit titles should give an outline of what's happened.

Upgrade Steps

  • List out, as concretely as possible, any steps users have to take when they upgrade beyond just dumping the dependency.
  • Write pseudocode that highlights what code should change and how.
@andreasonny83
andreasonny83 / top.md
Last active Jan 21, 2020
Background processes
View top.md

ps aux | grep node

run top find the process id (PID) ps -efl | grep 10399 kill -9 10399

View class-facade.js
/**
* The Facade pattern simplifies and hides the underlying complexity of a large abody of
* code by providing a cleaner and easy to use interface.
*/
class TaskService {
constructor(data){
this.name = data.name;
this.priority = data.priority;
this.project = data.project;
View class-factory.js
/**
* The factory pattern abstracts object creation by providing an interface, where we can specify the type of
* factory object to be created.
*
* The Factory pattern can be especially useful when applied to the following situations:
*
* - When our object or component setup involves a high level of complexity,
* e.g. if it strongly depends on dynamic factors or application configuration.
* - When we need to easily generate different instances of objects depending on the environment we are in
* - When we're working with many small objects or components that share the same properties
View class-singleton.js
/**
* The singleton pattern is a pattern used to restrict an object to a single instance.
* A singleton creates an instance of an object if that object does not exist.
* If it exists it returns the existing instance.
*/
class Car {
constructor(model, year, miles) {
if(Car.exists){
return Car.instance
View vim.md

Convert to HEX

:%!xxd