Skip to content

Instantly share code, notes, and snippets.

View rredpoppy's full-sized avatar

Adrian Rosian rredpoppy

View GitHub Profile
@rredpoppy
rredpoppy / compiling_asm.md
Created October 9, 2023 03:32 — forked from yellowbyte/compiling_asm.md
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@rredpoppy
rredpoppy / ec2-spot-github-self-hosted-runners.md
Created August 18, 2023 15:53 — forked from terma/ec2-spot-github-self-hosted-runners.md
AWS EC2 Spot Instances for GitHub Self-hosted runners

AWS EC2 Spot Instances for GitHub Self-hosted runners

Below CloudFormation stack which runs GitHub Self-hosted runners on EC2 Spot Instances managed by AutoScalingGroup. It automatically register new instances as self-hosted runners and removes them when Spot is interrupted.

How to use?

  1. Download YML below into file
  2. Create AWS CloudFormation stack
    • Provide values for parameters
  • If you need to install smt in UserData fill stack parameter AdditionalUserData
@rredpoppy
rredpoppy / Main.java
Created September 1, 2017 23:11
BouncyCastle AES 256 CBC Java <-> Js
/*
* Unrestricted security policy files for Java JRE need to be installed from Oracle for 256 keys to work
*/
package com.mycompany.mavenproject1;
import java.security.SecureRandom;
import java.security.Security;
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
@rredpoppy
rredpoppy / playlist.json
Last active December 16, 2019 09:49
Playlist
[
{ "id": "QJ5DOWPGxwg", "title": "It's beginning to look a lot like Christmas" }
, { "id": "xvHQO9LT6ZI", "title": "White Christmas" }
, { "id": "R8CBoVc_OMI", "title": "Santa Claus is coming to town" }
, { "id": "Nx-DvH41Tjo", "title": "Jingle Bells" }
]

Advanced Functional Programming with Scala - Notes

Copyright © 2016-2017 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x
@rredpoppy
rredpoppy / keybase.md
Created January 30, 2018 18:31
keybase

Keybase proof

I hereby claim:

  • I am rredpoppy on github.
  • I am rredpoppy (https://keybase.io/rredpoppy) on keybase.
  • I have a public key ASAOz55mLspQSB2oHg6DHDAuZqkZLsAoOUdarVvkw3MtrQo

To claim this, I am signing this object:

@rredpoppy
rredpoppy / uri.js
Created March 13, 2017 15:36 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@rredpoppy
rredpoppy / AidaClient.java
Created February 23, 2017 09:51
Aida client
package aidaclient;
import com.sun.xml.internal.ws.developer.WSBindingProvider;
import com.whitecitycode.aida.*;
import java.util.List;
/**
*
* @author adrian
*/
@rredpoppy
rredpoppy / install.sh
Created February 19, 2017 09:18 — forked from younes200/install.sh
UV4L + Webrtc
curl http://www.linux-projects.org/listing/uv4l_repo/lrkey.asc | sudo apt-key add -
sudo vi /etc/apt/sources.list
cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://www.linux-projects.org/listing/uv4l_repo/raspbian/ wheezy main
sudo apt-get update
sudo apt-get install uv4l-webrtc
sudo apt-get install uv4l-raspicam-extras
sudo service uv4l_raspicam restart
@rredpoppy
rredpoppy / 00_destructuring.md
Created February 9, 2017 07:42 — forked from john2x/00_destructuring.md
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors