Skip to content

Instantly share code, notes, and snippets.

View guimou's full-sized avatar

Guillaume Moutier guimou

  • Red Hat
  • Québec, Canada
View GitHub Profile
@guimou
guimou / command.sh
Created October 30, 2020 18:11
Copy directly from URL to S3
wget -qO- <url> | aws s3 cp - s3://<s3_bucket>/<s3_key>
@guimou
guimou / ffmpeg.sh
Last active November 5, 2021 14:36
ffmpeg split/merge commands
Merge:
ffmpeg -i video_input.mp4 -i audio_input.m4a -map 0:v -map 1:a -c copy -acodec copy output.mp4
Split Audio:
ffmpeg -vn -acodec copy audio.mp3 -i input.mp4
@guimou
guimou / oc_delete_items.sh
Last active December 4, 2021 13:45
[OC delete items in one line] Deletes OpenShift item in one line
# Delete Running pods
for pod in $(oc get pods | grep Running | awk '{print $1}'); do oc delete pod ${pod} --grace-period=1;done
# Delete Secrets
for secret in $(oc get secrets | awk '{if (NR!=1){print $1}}'); do oc delete secret ${secret};done
import sys
import boto3
import numpy as np
import os
import logging
import json
import random
import http.server
import socketserver
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@guimou
guimou / pil_s3.py
Created December 11, 2019 20:13 — forked from ghandic/pil_s3.py
Load image from S3 directly into memory as PIL image and write to S3 directly from memory from PIL image
import boto3
from PIL import Image
from io import BytesIO
import os
class S3ImagesInvalidExtension(Exception):
pass
class S3ImagesUploadFailed(Exception):
pass
@guimou
guimou / bashrc
Last active March 30, 2023 17:20
colored bash prompt (add to your .bashrc)
# .bashrc
#######################
# Colored bash prompt #
#######################
################################################################################
## FUNCTIONS ##
@guimou
guimou / http-to-s3.ipynb
Last active October 1, 2019 19:53
Python notebook: Transfer http-accessible data directly to a S3 bucket (no disk or memory usage)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
while true; do sleep 1; curl http://template-ul-demo-ul.apps.10.2.2.2.xip.io/hostname; echo ' ';done