Skip to content

Instantly share code, notes, and snippets.

View res0nat0r's full-sized avatar
🤗

Stefhen Hovland res0nat0r

🤗
  • Austin, TX
View GitHub Profile
@res0nat0r
res0nat0r / multiple-repository-and-identities-git-configuration.md
Created December 8, 2021 17:54 — forked from bgauduch/multiple-repository-and-identities-git-configuration.md
Git config with multiple identities and multiple repositories

Setup multiple git identities & git user informations

/!\ Be very carrefull in your setup : any misconfiguration make all the git config to fail silently ! Go trought this guide step by step and it should be fine 😉

Setup multiple git ssh identities for git

  • Generate your SSH keys as per your git provider documentation.
  • Add each public SSH keys to your git providers acounts.
  • In your ~/.ssh/config, set each ssh key for each repository as in this exemple:
@res0nat0r
res0nat0r / kexec-installer.nix
Created October 18, 2020 05:20 — forked from Mic92/kexec-installer.nix
kexec-based installer for nixos to install nixos from every linux!
## USAGE
# $ nix-build kexec-installer.nix
# can be deployed remote like this
# $ rsync -aL -e ssh result/ root@host:
# $ ssh root@host ./kexec-installer
## Customize it like this
# # custom-installer.nix
# import ./kexec-installer.nix {
# extraConfig = {pkgs, ... } {
# user.extraUsers.root.openssh.authorizedKeys.keys = [ "<your-key>" ];
(ns prime-factors.core
(:require [clojure.core.logic :refer :all])
(:require [clojure.core.logic.fd :refer [in interval eq]]))
(defn factor-pairs [number]
(run* [pair]
(fresh [factor1 factor2]
(in factor1 factor2 (interval 2 number))
(eq (= number (* factor1 factor2)))
(== pair [factor1 factor2]))))
@res0nat0r
res0nat0r / README.md
Last active July 16, 2021 17:17 — forked from emersonf/s3etag.sh
A Bash script to compute ETag values for S3 multipart uploads on OS X.

Verifying Amazon S3 multi-part uploads with the ETag hash

Uploading big files to Amazon S3 can be a bit of pain when you're on an unstable network connection. If an error occurs, your transfer will be cancelled and you can start the upload process all over again.

To check the integrity of a file that was uploaded in multiple parts, you can calculate the checksum of the local file and compare it with the checksum on S3. Problem is: Amazon doesn't use a regular md5 hash for multipart uploads. In this post we'll take a look at how you can compute the correct checksum on your computer so you can compare it to the checksum calculated by Amazon.

The solution So if you want to check if your files where transferred correctly, you have to compute the ETag hash in the same way that Amazon does. Luckily there is this bash script which splits up your files (like the multipart upload) and calculates the correct ETag hash.

@res0nat0r
res0nat0r / aws.sg.unused
Created June 13, 2019 18:43 — forked from thibautsacreste/aws.sg.unused
Bash: list unused AWS security groups
#!/usr/bin/env bash
# lists all unused AWS security groups.
# a group is considered unused if it's not attached to any network interface.
# requires aws-cli and jq.
# all groups
aws ec2 describe-security-groups \
| jq --raw-output '.SecurityGroups[] | [.GroupName, .GroupId] | @tsv' \
| sort > /tmp/sg.all
@res0nat0r
res0nat0r / preapprove.groovy
Last active February 20, 2019 23:13 — forked from tknerr/preapprove.groovy
pre-approve all Jenkins groovy scripts
import jenkins.*
import jenkins.model.*
Jenkins.instance.getExtensionList('org.jenkinsci.plugins.scriptsecurity.scripts.ScriptApproval')[0].get().preapproveAll()
pipeline {
agent any
parameters {
string(defaultValue: '', description: 'The name of the organization working on this repository.', name: 'orgName')
}
stages{
stage("Create Repo Piplines") {
steps {
@res0nat0r
res0nat0r / readme.md
Created January 28, 2019 04:14 — forked from maxivak/readme.md
Provisioning Docker containers with Chef

Provisioning Docker container with Chef

Chef provisioning

  • Chef provisioning is a framework that allows clusters to be managed by the chef-client and the Chef server in the same way nodes are managed: with recipes.

  • Chef provisioning is a collection of resources that enable the creation of machines and machine infrastructures using the chef-client.

@res0nat0r
res0nat0r / how-to-install-latest-gcc-on-ubuntu-lts.txt
Created March 12, 2018 05:48 — forked from application2000/how-to-install-latest-gcc-on-ubuntu-lts.txt
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@res0nat0r
res0nat0r / 2-bindings
Last active January 11, 2018 05:15 — forked from Soft/keys
vim for mpd / ncmpcpp
Located in ~/.ncmpcpp/bindings
key_move_song_up = 'K'
key_move_song_down = 'J'
key_next_found_position = 'n'
key_prev_found_position = 'N'
key_prev_column = 260 'h'
key_next_column = 261 'l'
key_lyrics = '.'
key_home = 262 'g'