Skip to content

Instantly share code, notes, and snippets.

View defel's full-sized avatar
🐧
I use arch btw

defel

🐧
I use arch btw
View GitHub Profile
@sualeh
sualeh / how_to_sign_and_release_to_the_central_repository_with_github_actions.md
Last active June 8, 2024 17:46
How to Sign and Release to The Central Repository with GitHub Actions

How to Sign and Release to The Central Repository with GitHub Actions

GitHub allows automated builds using GitHub Actions. A commonly asked question is how to release artifacts (packaged Java jars) built by Maven and Gradle to The Central Repository. The GitHub Actions documentation provides only part of the answer.

So, first, configure your Maven project for staging artifacts to The Central Repository, by reading through Configuring Your Project for Deployment and following those steps. Please make sure that the maven-gpg-plugin is configured to prevent gpg from using PIN entry programs, as follows:

<configuration>
  <gpgArguments>
      <arg>--pinentry-mode</arg>
 loopback
@gfodor
gfodor / ffmpeg-minimalist-build-nvenc-static.md
Last active January 20, 2023 14:55
Static FFmpeg build on Ubuntu 16.04 with Nvidia NVENC enabled.

Minimalist static FFmpeg build on Ubuntu 18.10 with Nvidia NVENC enabled.

Original guide with a standard build is here.

With this guide, I'm adding more instructions to enable support for NVIDIA CUVID and NVIDIA NPP for enhanced encode and decode performance.

First, prepare for the build and create the work space directory:

cd ~/

---
AWSTemplateFormatVersion: '2010-09-09'
Description: Mobile App CICD Demo
Parameters:
DeviceFarmProjectName:
Type: String
Default: demo-app-devicefarm
@adrianhall
adrianhall / AppSyncAPI.yaml
Last active March 19, 2023 14:57
A CloudFormation template for DynamoDB + Cognito User Pool + AppSync API for the Notes tutorial
---
Description: AWS AppSync Notes API
Parameters:
APIName:
Type: String
Description: Name of the API - used to generate unique names for resources
MinLength: 3
MaxLength: 20
AllowedPattern: '^[a-zA-Z][a-zA-Z0-9_]*$'
@DinosaurDad
DinosaurDad / aws-s3-delete-files-with-extension.sh
Created January 15, 2018 20:57
AWS - S3 - Delete files with extension
aws s3 rm s3://somebucket/somefolder/ --recursive --dryrun --exclude "*" --include "*.json"
@darkarnium
darkarnium / EnumerateIam.md
Last active May 19, 2024 20:31
A quick and VERY dirty IAM enumeration tool.

Enumerate IAM

The following code will attempt to enumerate operations that a given set of AWS AccessKeys can perform.

Usage

Usage: enumerate-iam.py [OPTIONS]

  IAM Account Enumerator.
@Brainiarc7
Brainiarc7 / ffmpeg-multi-instances-xargs.md
Last active July 7, 2023 08:32
This gist will show you how to launch multiple ffmpeg instances with xargs, very useful for NVIDIA NVENC based encoding where standard GPUs limit the maximum simultaneous encode sessions to two.

Spawning multiple ffmpeg processes with xargs:

On standard NVIDIA GPUs (Not the Quadros and Tesla lines), NVENC encodes are limited to two simultaneous sessions. The sample below illustrates how to pass a list of AVI files to ffmpeg and encode them to HEVC on two encode sessions:

$ find Videos/ -type f -name \*.avi -print | sed 's/.avi$//' |\
  xargs -n 1 -I@ -P 2 ffmpeg -i "@.avi" -c:a aac -c:v hevc_nvenc "@.mp4"

This will find all files with the ending .avi in the directory Videos/ and transcode them into HEVC/H265+AAC files with the ending .mp4. The noteworthy part here is the -P 2 to xargs, which starts up to two processes in parallel.

const noop = arg => arg;
const combine = () => Array.from(arguments).reduce((a, b) => a.concat(b));
const compact = arr => arr.filter(el => el);
const difference = () => {
var others = Array.from(arguments).slice(1).reduce((a, b) => a.concat(b));
return arguments[0].filter(el => !others.some(exclude => el === exclude));
};
@bendc
bendc / functional-utils.js
Last active September 15, 2023 12:12
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links