Skip to content

Instantly share code, notes, and snippets.

@dantheman213
dantheman213 / aws-ssm-find-param
Last active August 19, 2019 17:56
Quickly find AWS SSM params by partial search, use custom AWS profiles, get an interactive result to query, and get a AWS URL to view and edit target
#!/usr/bin/env node
//
// Quickly find AWS SSM params by partial search, use custom AWS profiles, get an interactive
// result to query, and get a AWS URL to view and edit target.
//
// Requires AWS CLI, NodeJS v10+ and Python 2/3
//
// Before running for first time do:
// npm install inquirer
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active September 15, 2024 15:58
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@msmfsd
msmfsd / es7-async-await.js
Last active February 4, 2024 17:38
Javascript fetch JSON with ES7 Async Await
// Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/
// Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch
// async function
async function fetchAsync () {
// await response of fetch call
let response = await fetch('https://api.github.com');
// only proceed once promise is resolved
let data = await response.json();
// only proceed once second promise is resolved
@joaoBeno
joaoBeno / gist:c4730205580569ab1102db42392b05eb
Created May 21, 2016 10:08
How to circumvent slow as hell Mac App Store dowload...
So, you have a somewhat fast connection, but Apple decided you should have the latest Os X (Or some other app) in 3 days?
Let's change that!
The idea is simply to get the Apple download URL, download the file using some download accelerator, then fake the server on localhost
so App Store download it from your computer instead of the internet!
So, now the instructions (That I found over here: https://7labs.heypub.com/tips-tricks/el-capitan-direct-download.html):
1) Open App Store, then go to the app you wish to download, let the screen there and open a terminal window
2) Type the command below to open your computer's host files (This files store a sort of list relating ip's to domains)
sudo nano /etc/hosts
@bahmutov
bahmutov / Docker shell commands.sh
Last active February 9, 2024 07:55
A personal cheat sheet for running local Node project in a Docker container
# See list of docker virtual machines on the local box
$ docker-machine ls
NAME ACTIVE URL STATE URL SWARM DOCKER ERRORS
default * virtualbox Running tcp://192.168.99.100:2376 v1.9.1
# Note the host URL 192.168.99.100 - it will be used later!
# Build an image from current folder under given image name
$ docker build -t gleb/demo-app .
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active August 31, 2024 18:16
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active September 19, 2024 23:44
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@protrolium
protrolium / ffmpeg.md
Last active September 20, 2024 16:28
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@Abizern
Abizern / loggingPrint.swift
Last active September 22, 2021 14:28
Debug logging for Swift
//
// LoggingPrint.swift
//
import Foundation
/**
Prints the filename, function name, line number and textual representation of `object` and a newline character into
the standard output if the build setting for "Active Complilation Conditions" (SWIFT_ACTIVE_COMPILATION_CONDITIONS) defines `DEBUG`.