Skip to content

Instantly share code, notes, and snippets.

View AlexxNica's full-sized avatar
🚀

Alexandre Nicastro AlexxNica

🚀
View GitHub Profile
@AlexxNica
AlexxNica / array_iteration_thoughts.md
Created January 10, 2020 18:06 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.

Intro

JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it much simpler to think about both the old list and the new one, what they contain, and

@AlexxNica
AlexxNica / vyos-packet.md
Created February 8, 2018 08:58
Install Vyos on Packet.net

Vyos Install on Packet.net

VyOS defaults to a console rate of “9600”, which is not compliant with packet.net’s SOS. As such, the squashfs image will need to be unpacked, config.boot.default updated to the correct serial number/BAUD rate, and squashfs image recreated.

VyOS 1.8 (stable) or above is required due to the following vyos-legacy/live-initramfs#1 issue where the “fetch” command is ran prior to network loading

#install tools we need
sudo apt update && sudo apt install squashfs-tools
@AlexxNica
AlexxNica / make-keys.bat
Created January 25, 2018 18:33 — forked from codingoutloud/make-keys.bat
Handy OpenSSL command-line combinations I've used - they might've been hard to find or come up with, so capturing them here.
@echo off
if _%1_==__ goto USAGE
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name"
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint
openssl x509 -in mycert.pem -noout -fingerprint
This document describes about installation and configuration of IPMI simulator.
We need: qemu-kvm, OpenIPMI, OpenIPMI-tools
1) Install the qemu-kvm. We need the qemu, which have the IPMI pacthes.
Use the source https://github.com/cminyard/qemu/tree/stable-2.2-ipmi
./configure, make and make install
2) Download the OpenIPMI libraries, from http://sourceforge.net/projects/openipmi/
Follow the process documented in lanserv/README.vm
./configure --prefix=/opt/openipmi/usr --sysconfdir=/opt/openipmi/etc \
--with-perlinstall=/opt/openipmi/usr/lib/perl \
@AlexxNica
AlexxNica / foreman_proxy_install.md
Created January 18, 2018 14:11 — forked from genadipost/foreman_proxy_install.md
foreman proxy install
yum -y install https://yum.puppetlabs.com/puppetlabs-release-pc1-el-7.noarch.rpm; \
yum -y install http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm; \
yum -y install https://yum.theforeman.org/releases/1.15/el7/x86_64/foreman-release.rpm; \
yum -y install foreman-release-scl; \
yum -y install foreman-installer; \
echo "192.168.227.130 foreman1.test.local foreman1" >> /etc/hosts; \
echo "192.168.227.130 web-foreman.test.local" >> /etc/hosts; \
echo "192.168.227.134 proxy1.test.local proxy1" >> /etc/hosts; \
@AlexxNica
AlexxNica / ol7_addons.repo.sh
Created January 18, 2018 02:08 — forked from dcode/ol7_addons.repo.sh
Enable the OL7 Add-ons repo. Includes virtualbox, docker, R, and others.
cat << EOF | sudo tee /etc/yum.repos.d/ol7_addons.repo
[ol7_addons]
name=Oracle Linux $releasever Add ons (\$basearch)
baseurl=http://public-yum.oracle.com/repo/OracleLinux/OL7/addons/\$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=1
enabled=1
EOF
# Verify this manually if you're paranoid like me
@AlexxNica
AlexxNica / Dockerfile
Created January 17, 2018 22:08 — forked from dcode/Dockerfile
Unprivileged lighttpd container with systemd init on centos7
# Dockerfile for lighttpd
FROM centos/systemd
RUN yum install -y epel-release; \
yum update -y; \
yum install -y lighttpd; \
yum clean all; \
rm -rf /var/cache/yum/*; \
systemctl enable lighttpd;
@AlexxNica
AlexxNica / README.md
Created January 2, 2018 12:56 — forked from dtinth/README.md
Batch File Rename Script

Batch File Rename

Use JavaScript for Automation to rename files in batch!

Motivation

#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@AlexxNica
AlexxNica / README.md
Created December 25, 2017 17:29 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed