Skip to content

Instantly share code, notes, and snippets.

View uZer's full-sized avatar
🛰️
Taming patch cables

Youenn Piolet uZer

🛰️
Taming patch cables
View GitHub Profile
@uZer
uZer / ffmpeg_instagram.sh
Created October 22, 2021 12:44
Convert vertical video to Instagram story format. Add black borders to ensure format.
# Convert vertical video to Instagram story format.
# Add black borders to ensure format.
ffmpeg \
-i in.avi \
-c:v libx264 -b:v 2333k \
-vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2,setsar=1" \
-pix_fmt yuv420p -c:a aac \
out.mp4
#!/bin/bash
#set -e
# install-wifi - 13/01/2021 - by MrEngman.
UPDATE_SELF=${UPDATE_SELF:-1}
UPDATE_URI="http://downloads.fars-robotics.net/wifi-drivers/install-wifi"
ROOT_PATH=${ROOT_PATH:-"/"}
WORK_PATH=${WORK_PATH:-"${ROOT_PATH}/root"}
awsprofile() {
profile=${AWS_CREDENTIAL_FILE:-${HOME}/.aws/credentials}
list=$(grep '\[' ${profile} | tr -d '[' | tr -d ']' | xargs)
if [ ! $# -eq 1 ]; then
echo "Available profiles:"
echo $list | sed 's/ /\n/g' | sed 's/^/* /g'
else
if ! grep -q "\[$1\]" ${profile}; then
echo "Profile ${1} doesn't exist in ${profile}."
@uZer
uZer / git-change-user.sh
Created September 7, 2018 22:58
Change git username/email from all commits matching a certain email
#!/bin/sh
echo "What was your old email? [Default: email@example.com]"
read _WRONG_EMAIL
echo "What name do you want to use? [Default: newuser]"
read _NEW_NAME
echo "What email do you want to use instead? [Default: newuser@example.com]"
read _NEW_EMAIL
echo
@uZer
uZer / ansible-role-test.sh
Last active May 29, 2017 22:41 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
# Fork from geerlingguy's
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)
@uZer
uZer / keybase.md
Last active May 31, 2017 18:27
keybase.md

Keybase proof

I hereby claim:

  • I am uzer on github.
  • I am ypiolet (https://keybase.io/ypiolet) on keybase.
  • I have a public key whose fingerprint is 0BB8 6EA4 B04B 1A56 8DD1 5FBC 6534 FBBC 86B7 DB4D

To claim this, I am signing this object:

@uZer
uZer / ProxyPass.conf
Created September 16, 2014 11:47
ProxyPass Apache2
<VirtualHost *:80>
ServerName example.com
ServerSignature Off
<Proxy http://127.0.0.1:5050>
Allow from all
</Proxy>
<IfModule mod_proxy.c>
ProxyRequests Off
@uZer
uZer / ProxyPass.conf
Created September 16, 2014 11:45
Basic ProxyPass Nginx
server {
listen 80;
listen [::]:80;
server_name exmample.com;
index index.php;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
@uZer
uZer / gist:6286415
Last active December 21, 2015 09:39
Block Steam services IP with Windows 7/8 Firewall without using the per application filter - reinstallproof (for your kids or your little brother). If you move folders from `Program Files (x86)\Steam\userdata` he won't be able to connect anymore.
# With cmd/powershell as administrator
## Add rule
netsh
advfirewall
firewall
add rule name="mySteam" dir=out action=block remoteip=24.89.185.8-24.89.185.15,49.143.234.0-49.143.234.255,63.145.202.0-63.145.202.15,63.150.152.136-63.150.152.143,63.228.223.96-63.228.223.111,63.236.109.96-63.236.109.103,65.113.241.32-65.113.241.47,65.122.178.64-65.122.178.79,67.132.200.128-67.132.200.191,67.134.197.240-67.134.197.255,67.134.199.64-67.134.199.79,68.177.101.0-68.177.101.127,72.165.61.128-72.165.61.191,77.67.56.160-77.67.56.191,77.67.60.32-77.67.60.63,77.67.60.128-77.67.60.135,77.67.60.152-77.67.60.159,103.10.124.0-103.10.125.255,103.28.54.0-103.28.55.255,146.66.152.0-146.66.153.255,146.66.156.0-146.66.157.255,207.159.120.144-207.159.120.159,213.202.254.128-213.202.254.143,213.202.254.192-213.202.254.207,216.207.205.96-216.207.205.111,63.98.16.176-63.98.16.183,65.113.241.32-65.113.241.47,67.134.197.240-67.134.197.255,67.134.199.64-67.134.199.79,72.165.61.128-72.165.61.191,207.173.176.0-207.173.179.255,216.190.227.0-
@uZer
uZer / [NGINX] Proxy Pass any domain name to web server
Last active December 21, 2015 05:19
Nginx configuration file for a webserver 'proxy', redirecting by default all the HTTP / HTTPS requests to the <webServerIP>. The redirection is effective with any domain name, and preserves the name for the <webServerIP>'s vhost configuration.
## HTTP
server {
listen 80 default_server;
access_log /var/log/nginx/default.http.access.log;
location / {
proxy_pass http://<webServerIP>;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;